• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
iOS Tips + ModalVC
 

iOS Tips + ModalVC

on

  • 888 views

 

Statistics

Views

Total Views
888
Views on SlideShare
887
Embed Views
1

Actions

Likes
0
Downloads
3
Comments
0

1 Embed 1

http://www.linkedin.com 1

Accessibility

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    iOS Tips + ModalVC iOS Tips + ModalVC Presentation Transcript

    • TIPS Извадки от xCode проектиThursday, January 26, 12
    • BLOCKS & ANIMATIONS [UIView animateWithDuration:0.3 animations:^{ CGRect newFrame = self.frame; newFrame.origin.y = 0; self.frame = newFrame; self.alpha = 1; shown = YES; } completion:^ (BOOL finished) { if (finished) { //shown = YES; } }];Thursday, January 26, 12
    • ANIMATIONS • когато изпълняваме анимация стойността, която променяме получава новата си стойност незабавно само визуализацията се забавя /в друг thread/ • при прекъсване на анмацията не се изпълнява completion:^ • анимация може да прекъсва друга анимация и да продължава от позицията до която е стигналаThursday, January 26, 12
    • ANIMATIONS - (void)blink { if (shown) return; [UIView animateWithDuration:0.3 animations:^{ CGRect newFrame = self.frame; newFrame.origin.y = 0; self.frame = newFrame; self.alpha = 1; } completion:^ (BOOL finished) { if (finished) { //// Revert image view to original. sleep(3); shown = YES; [self hide:YES]; } }]; [[NSNotificationCenter defaultCenter] postNotificationName:kStatusBarPositionChange object:nil userInfo:[NSDictionary dictionaryWithObject:[NSValue valueWithCGRect:self.frame] forKey:@"frame"]]; } if ([userInfo objectForKey:@"frame"]) { Как да вземем frame от Value ! ! ! } statusBarFrame = [[userInfo objectForKey:@"frame"] CGRectValue];Thursday, January 26, 12
    • USERINFO [[NSNotificationCenter defaultCenter] postNotificationName:kStatusBarPositionChange object:nil userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSValue valueWithCGRect:self.frame], @"frame", [NSNumber numberWithFloat:animationDuration], @"duration", nil]];Thursday, January 26, 12
    • CUSTOM BUTTONS Зареждане на картинки за различни състояния на UIButtonTypeCustom imgName = [imgName stringByReplacingOccurrencesOfString:@".png" withString:@""]; ! [btn setBackgroundImage:[UIImage imageNamed:[NSString stringWithFormat:@"%@.png", imgName]] forState:UIControlStateNormal]; [btn setImage:[UIImage imageNamed:[NSString stringWithFormat:@"%@_high.png", imgName]] forState:UIControlStateHighlighted];Thursday, January 26, 12
    • UISCROLLVIEW Навигация до определен обект [scrollView scrollRectToVisible:temp animated:NO];Thursday, January 26, 12
    • MODAL VIEWS Different view hierarchyThursday, January 26, 12
    • ЗА КАКВО СЕ ИЗПОЛЗВАТ? • Незабавно събиране на информация от потребителя • Временно показване на съдържание • Промяна на работната среда • Различни интерфейси за различните ориентации • Нова иерархия от UIViewThursday, January 26, 12
    • current task or workflow. To learn more about defining a modal view in your code, see UIViewController Class Reference . MODAL VIEW Appearance and Behavior A modal view occupies the entire application screen, which strengthens the user’s perception of entering a Необходим е отговор преди потребителят да може да separate, transient mode in which they can accomplish something. On iPad, a modal view might also occupy the entire area of a parent view, such as a popover. продължи the controls necessary to perform the task. A modal A modal view can display text if appropriate, and contains view generally displays a button that completes the task and dismisses the view, and a Cancel button usersThursday, January 26, 12 can tap to abandon the task.
    • MODALVIEW УПОТРЕБА TransitionThursday, January 26, 12
    • ЗА КАКВО СЕ ИЗПОЛЗВА? Drawing canvas писане на писмо Drawing canvas временно представяне Organizer HelpThursday, January 26, 12
    • UIModalPresentati Presenting View Controllers From Other View Controllers Configuring the Presentation Style for Modal Views IPAD PRESENTATION STYLES Figure 9-4 iPad presentation styles UIModalPresentationFullScreen UIModalPresentati Presenting View Controllers From Other View Controllers Configuring the Presentation Style for Modal Views Figure 9-4 iPad presentation styles UIModalPresentationFullScreen UIModalPresentationPageSheet UIModalPresentati For guidance on when to use the different presentation styles, see “Po Guidelines . UIModalPresentationFullScreenUIModalPresentationPageSheet UIModalPresentationPageSheet UIModalPresentationFormSheet UIModalPresentationFormSheet 2012-‐01-‐09 | © 2012 Apple Inc. All Rights Rese 85 For guidance on when to use the different presentation styles, see “Popover (iPad Only)” in iOS Human Interface Guidelines . UIModalPresentationFormSheet 2012-‐01-‐09 | © 2012 Apple Inc. All Rights Reserved.Thursday, January 26, 12
    • IDESK - SEND EMAILThursday, January 26, 12
    • Presenting View Controllers From Other View Controllers About View Controller Presentation PRESENT MODAL and then presents another view controller (the people picker) in response to that action. Selecting a contact (or canceling the people picker) dismisses that interface and takes the user back to the photo library. Tapping the Done button then dismisses the photo library and takes the user back to the camera interface. Figure 9-2 Creating a chain of modal view controllers Camera Photo library Action sheet People picker view controller navigation controller navigation controller present present modally modally Each view controller in a chain of presented view controllers has pointers to the other objects surrounding itThursday, January 26, 12
    • TRANSITIONS Vertical slide Flip PartialCurlThursday, January 26, 12
    • NAVIGATION OR MODAL Как да изберем?Thursday, January 26, 12
    • NAVIGATION / MODAL VIEW Необходимо е потребителят да въведе текстThursday, January 26, 12
    • NAVIGATION / MODAL VIEWThursday, January 26, 12
    • NAVIGATIONCONTROLLER push push push pop pop pop [self.navigationController pushViewController:tableVC animated:YES]; [self.navigationController popViewControllerAnimated:YES];Thursday, January 26, 12
    • РАЗЛИКАТА push push push pop pop pop present dismissThursday, January 26, 12
    • MODALVIEWCONTROLLER present dismiss [self presentModalViewController:tableVC animated:YES]; [self dismissModalViewControllerAnimated:YES];Thursday, January 26, 12
    • ЗА СЛЕДВАЩИЯТ ПЪТ • nsnotification & targets • blocks • nstimer • mapKitThursday, January 26, 12