Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


Share this Page URL
Help

8 Gesten und Berührungen > 8.9 Rezept: Schüttelgesteuerte Widerrufsmöglichkeite... - Pg. 395

8.9 Rezept: Schüttelgesteuerte Widerrufsmöglichkeiten hinzufügen [UIView beginAnimations:@"" context:nil]; [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; [UIView setAnimationDuration:0.1f]; self.center = pos; // animiere [UIView commitAnimations]; } - (void) touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event { [self setPosition:self.center]; // Berechnet und speichert den Offset und bringt die Ansicht ggf. in den // Vordergrund CGPoint pt = [[touches anyObject] locationInView:self]; startLocation = pt; [[self superview] bringSubviewToFront:self]; }