0
Televisió de CatalunyaFormación en movilidadConceptos de desarrollo en iOS3ª sesión mayo 20131
Qué veremos hoyRepaso de la sesión anteriorUIWebViewView Cotroller en iPadSimulador2
RecursosTutoriales de Ray Wenderlichwww.raywenderlich.com/tutorialsCursos de Stanford en iTunes Uitunes.stanford.eduiOS De...
RepasoView ControllerUIViewController4
RepasoNavigation BarUINavigationItemUIBarButtonItem - NSString - UIBarButtonItem5
RepasoUIBarButtonItemself.navigationItem.rightBarButtonItem6
RepasoUIStoryboardSegueModal7
Repaso// MasterViewController.m- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{if ([[segue identifier...
Repaso// NewVideoViewController.m- (IBAction)done:(id)sender {! [self dismissViewControllerAnimated:YES completion:^{! ! N...
Repaso// MasterViewController.m- (void)insertNewObject:(NSDictionary *)values{// ...[newManagedObject setValue:[NSDate dat...
Debugging11
UIWebView// DetailViewController.h@interface DetailViewController : UIViewController <UISplitViewControllerDelegate, UIWeb...
UIWebView// DetailViewController.m- (void)configureView{// ...self.titleLabel.text = [self.detailItem valueForKey:@"title"...
UIWebView// DetailViewController.m- (void)configureView{// ...self.titleLabel.text = [self.detailItem valueForKey:@"title"...
UIWebViewUIWebViewDelegate// DetailViewController.m- (void)configureView{// ...self.titleLabel.text = [self.detailItem val...
UIWebViewUIWebViewDelegate// DetailViewController.m- (void)configureView{// ...self.titleLabel.text = [self.detailItem val...
UIWebViewUIActivityIndicatorView// DetailViewController.h@interface DetailViewController : UIViewController <UISplitViewCo...
UIWebViewUIActivityIndicatorView// DetailViewController.m- (void)configureView{// ...self.titleLabel.text = [self.detailIt...
UIWebViewUIActivityIndicatorView// DetailViewController.m- (void)configureView{// ...self.titleLabel.text = [self.detailIt...
UIWebViewUIActivityIndicatorView// DetailViewController.m- (void)configureView{// ...self.titleLabel.text = [self.detailIt...
UIWebViewUIActivityIndicatorView// DetailViewController.m- (void)configureView{// ...self.titleLabel.text = [self.detailIt...
UIWebViewUIActivityIndicatorView// DetailViewController.m- (void)configureView{// ...self.titleLabel.text = [self.detailIt...
Coffee Break!23
MVCView Controller LifecycleviewDidLoad:viewWillAppear:viewDidAppear:didReceiveMemoryWarning:24
MVCView Controller LifecycleviewDidLoad:“This method is called after the view controller has loaded its view hierarchy int...
MVCView Controller LifecycleviewWillAppear:“This method is called before the receiver’s view is about to be added to a vie...
MVCView Controller LifecycleviewDidAppear:“You can override this method to perform additionaltasks associated with present...
MVCView Controller LifecycledidReceiveMemoryWarning:“You can override this method to release anyadditional memory used by ...
EjercicioNewVideoView Controller en iPad29
iOS SimulatorFileOpen Printer SimulatorSave Screen Shot ⌘S30
iOS SimulatorHardwareDeviceiPad 2, miniiPad (Retina)iPhone 3G, 3GSiPhone (Retina 3.5-inch) 4, 4SiPhone (Retina 4-inch) 5, ...
iOS SimulatorHardwareRotate Left ⌘←Rotate Right ⌘→Shake Gesture ^⌘Z32
iOS SimulatorHardwareHome ⇧⌘HLock ⌘L33
iOS SimulatorHardwareSimulate Memory Warning didReceiveMemoryWarning:Toggle In-Call Status Bar ⌘TSimulate Hardware Keyboar...
iOS SimulatorDebugToggle Slow Animations35
iOS SimulatorDebugColor Blended Layers Reduce amount of red to improve performanceColor Copied ImagesColor Misaligned Imag...
iOS SimulatorDebugLocationNoneCustom Location...Apple StoresAppleCity Bicycle RideCity RunFreeway Drive37
iOS SimulatorWindowScale100% ⌘175% ⌘250% ⌘338
InstrumentsProfiling⌘I39
InstrumentsAllocations40
InstrumentsAllocations- (void)didReceiveMemoryWarning{[super didReceiveMemoryWarning];self.webView = nil;self.spinner = ni...
InstrumentsLeaks42
¡Gracias!43
Upcoming SlideShare
Loading in...5
×

Formacion en movilidad: Conceptos de desarrollo en iOS (III)

265

Published on

En esta tercera sesión formativa, impartida por Sergi Hernando, CTO de Mobivery, se trataron los siguientes conceptos: UIWebView, View Cotroller en iPad y el Simulador

Published in: Technology, Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
265
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Formacion en movilidad: Conceptos de desarrollo en iOS (III) "

  1. 1. Televisió de CatalunyaFormación en movilidadConceptos de desarrollo en iOS3ª sesión mayo 20131
  2. 2. Qué veremos hoyRepaso de la sesión anteriorUIWebViewView Cotroller en iPadSimulador2
  3. 3. RecursosTutoriales de Ray Wenderlichwww.raywenderlich.com/tutorialsCursos de Stanford en iTunes Uitunes.stanford.eduiOS Developer Librarydeveloper.apple.com/library/ios3
  4. 4. RepasoView ControllerUIViewController4
  5. 5. RepasoNavigation BarUINavigationItemUIBarButtonItem - NSString - UIBarButtonItem5
  6. 6. RepasoUIBarButtonItemself.navigationItem.rightBarButtonItem6
  7. 7. RepasoUIStoryboardSegueModal7
  8. 8. Repaso// MasterViewController.m- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{if ([[segue identifier] isEqualToString:@"newDetail"]) {! ! NewVideoViewController *viewController = (NewVideoViewController *)[segue destinationViewController];! ! viewController.masterViewController = self;! }}8
  9. 9. Repaso// NewVideoViewController.m- (IBAction)done:(id)sender {! [self dismissViewControllerAnimated:YES completion:^{! ! NSDictionary *values = @{! ! ! @"title": self.videoTitle.text, @"author": self.videoAuthor.text, @"url": self.videoURL.text! ! };! ! [self.masterViewController insertNewObject:values];! }];}9
  10. 10. Repaso// MasterViewController.m- (void)insertNewObject:(NSDictionary *)values{// ...[newManagedObject setValue:[NSDate date] forKey:@"timeStamp"];[newManagedObject setValue:[values objectForKey:@"title"] forKey:@"title"];[newManagedObject setValue:[values objectForKey:@"author"] forKey:@"author"];[newManagedObject setValue:[values objectForKey:@"url"] forKey:@"url"];// ...}10
  11. 11. Debugging11
  12. 12. UIWebView// DetailViewController.h@interface DetailViewController : UIViewController <UISplitViewControllerDelegate, UIWebViewDelegate>@property (strong, nonatomic) id detailItem;@property (nonatomic, weak) IBOutlet UILabel *titleLabel;@property (nonatomic, weak) IBOutlet UILabel *authorLabel;@property (nonatomic, weak) IBOutlet UIWebView *webView;@end12
  13. 13. UIWebView// DetailViewController.m- (void)configureView{// ...self.titleLabel.text = [self.detailItem valueForKey:@"title"];self.authorLabel.text = [self.detailItem valueForKey:@"author"];}13
  14. 14. UIWebView// DetailViewController.m- (void)configureView{// ...self.titleLabel.text = [self.detailItem valueForKey:@"title"];self.authorLabel.text = [self.detailItem valueForKey:@"author"];NSURL *theURL = [[NSURL alloc] initWithString:[self.detailItem valueForKey:@"url"]];NSURLRequest *request = [[NSURLRequest alloc] initWithURL:theURL];[self.webView loadRequest:request];}14
  15. 15. UIWebViewUIWebViewDelegate// DetailViewController.m- (void)configureView{// ...self.titleLabel.text = [self.detailItem valueForKey:@"title"];self.authorLabel.text = [self.detailItem valueForKey:@"author"];NSURL *theURL = [[NSURL alloc] initWithString:[self.detailItem valueForKey:@"url"]];NSURLRequest *request = [[NSURLRequest alloc] initWithURL:theURL];[self.webView setDelegate:self];[self.webView loadRequest:request];}15
  16. 16. UIWebViewUIWebViewDelegate// DetailViewController.m- (void)configureView{// ...self.titleLabel.text = [self.detailItem valueForKey:@"title"];self.authorLabel.text = [self.detailItem valueForKey:@"author"];NSURL *theURL = [[NSURL alloc] initWithString:[self.detailItem valueForKey:@"url"]];NSURLRequest *request = [[NSURLRequest alloc] initWithURL:theURL];[self.webView setDelegate:self];[self.webView loadRequest:request];}#pragma mark - UIWebViewDelegate- (void)webViewDidStartLoad:(UIWebView *)webView {}- (void)webViewDidFinishLoad:(UIWebView *)webView {}16
  17. 17. UIWebViewUIActivityIndicatorView// DetailViewController.h@interface DetailViewController : UIViewController <UISplitViewControllerDelegate, UIWebViewDelegate>@property (strong, nonatomic) id detailItem;@property (nonatomic, weak) IBOutlet UILabel *titleLabel;@property (nonatomic, weak) IBOutlet UILabel *authorLabel;@property (nonatomic, weak) IBOutlet UIWebView *webView;@property (nonatomic, strong) IBOutlet UIActivityIndicatorView *spinner;@end17
  18. 18. UIWebViewUIActivityIndicatorView// DetailViewController.m- (void)configureView{// ...self.titleLabel.text = [self.detailItem valueForKey:@"title"];self.authorLabel.text = [self.detailItem valueForKey:@"author"];self.spinner =[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];self.spinner.center = self.view.center;NSURL *theURL = [[NSURL alloc] initWithString:[self.detailItem valueForKey:@"url"]];NSURLRequest *request = [[NSURLRequest alloc] initWithURL:theURL];[self.webView setDelegate:self];[self.webView loadRequest:request];}#pragma mark - UIWebViewDelegate- (void)webViewDidStartLoad:(UIWebView *)webView {}- (void)webViewDidFinishLoad:(UIWebView *)webView {}18
  19. 19. UIWebViewUIActivityIndicatorView// DetailViewController.m- (void)configureView{// ...self.titleLabel.text = [self.detailItem valueForKey:@"title"];self.authorLabel.text = [self.detailItem valueForKey:@"author"];self.spinner =[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];self.spinner.center = self.view.center;NSURL *theURL = [[NSURL alloc] initWithString:[self.detailItem valueForKey:@"url"]];NSURLRequest *request = [[NSURLRequest alloc] initWithURL:theURL];[self.webView setDelegate:self];[self.webView loadRequest:request];}#pragma mark - UIWebViewDelegate- (void)webViewDidStartLoad:(UIWebView *)webView {dispatch_async(dispatch_get_main_queue(), ^{});}- (void)webViewDidFinishLoad:(UIWebView *)webView {}19
  20. 20. UIWebViewUIActivityIndicatorView// DetailViewController.m- (void)configureView{// ...self.titleLabel.text = [self.detailItem valueForKey:@"title"];self.authorLabel.text = [self.detailItem valueForKey:@"author"];self.spinner =[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];self.spinner.center = self.view.center;NSURL *theURL = [[NSURL alloc] initWithString:[self.detailItem valueForKey:@"url"]];NSURLRequest *request = [[NSURLRequest alloc] initWithURL:theURL];[self.webView setDelegate:self];[self.webView loadRequest:request];}#pragma mark - UIWebViewDelegate- (void)webViewDidStartLoad:(UIWebView *)webView {dispatch_async(dispatch_get_main_queue(), ^{[self.view addSubview:self.spinner];[self.spinner startAnimating];});}- (void)webViewDidFinishLoad:(UIWebView *)webView {}20
  21. 21. UIWebViewUIActivityIndicatorView// DetailViewController.m- (void)configureView{// ...self.titleLabel.text = [self.detailItem valueForKey:@"title"];self.authorLabel.text = [self.detailItem valueForKey:@"author"];self.spinner =[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];self.spinner.center = self.view.center;NSURL *theURL = [[NSURL alloc] initWithString:[self.detailItem valueForKey:@"url"]];NSURLRequest *request = [[NSURLRequest alloc] initWithURL:theURL];[self.webView setDelegate:self];[self.webView loadRequest:request];}#pragma mark - UIWebViewDelegate- (void)webViewDidStartLoad:(UIWebView *)webView {dispatch_async(dispatch_get_main_queue(), ^{[self.view addSubview:self.spinner];[self.spinner startAnimating];});}- (void)webViewDidFinishLoad:(UIWebView *)webView {dispatch_async(dispatch_get_main_queue(), ^{});}21
  22. 22. UIWebViewUIActivityIndicatorView// DetailViewController.m- (void)configureView{// ...self.titleLabel.text = [self.detailItem valueForKey:@"title"];self.authorLabel.text = [self.detailItem valueForKey:@"author"];self.spinner =[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];self.spinner.center = self.view.center;NSURL *theURL = [[NSURL alloc] initWithString:[self.detailItem valueForKey:@"url"]];NSURLRequest *request = [[NSURLRequest alloc] initWithURL:theURL];[self.webView setDelegate:self];[self.webView loadRequest:request];}#pragma mark - UIWebViewDelegate- (void)webViewDidStartLoad:(UIWebView *)webView {dispatch_async(dispatch_get_main_queue(), ^{[self.view addSubview:self.spinner];[self.spinner startAnimating];});}- (void)webViewDidFinishLoad:(UIWebView *)webView {dispatch_async(dispatch_get_main_queue(), ^{[self.spinner stopAnimating];[self.spinner removeFromSuperview];});}22
  23. 23. Coffee Break!23
  24. 24. MVCView Controller LifecycleviewDidLoad:viewWillAppear:viewDidAppear:didReceiveMemoryWarning:24
  25. 25. MVCView Controller LifecycleviewDidLoad:“This method is called after the view controller has loaded its view hierarchy into memory.You usually override this method to perform additionalinitialization on views that were loaded from nib files”- (void)viewDidLoad{[super viewDidLoad];self.spinner =[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];self.spinner.center = self.view.center;}25
  26. 26. MVCView Controller LifecycleviewWillAppear:“This method is called before the receiver’s view is about to be added to a view hierarchy.You can override this method to perform custom tasksassociated with displaying the view”- (void)viewDidLoad{[super viewDidLoad];self.spinner =[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];self.spinner.center = self.view.center;}- (void)viewWillAppear:(BOOL)animated{[super viewWillAppear:animated];self.titleLabel.text = [self.detailItem valueForKey:@"title"];self.authorLabel.text = [self.detailItem valueForKey:@"author"];}26
  27. 27. MVCView Controller LifecycleviewDidAppear:“You can override this method to perform additionaltasks associated with presenting the view”- (void)viewDidLoad{[super viewDidLoad];self.spinner =[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];self.spinner.center = self.view.center;}- (void)viewWillAppear:(BOOL)animated{[super viewWillAppear:animated];self.titleLabel.text = [self.detailItem valueForKey:@"title"];self.authorLabel.text = [self.detailItem valueForKey:@"author"];}- (void)viewDidAppear:(BOOL)animated{[super viewDidAppear:animated];NSURL *theURL = [[NSURL alloc] initWithString:[self.detailItem valueForKey:@"url"]];NSURLRequest *request = [[NSURLRequest alloc] initWithURL:theURL];[self.webView setDelegate:self];[self.webView loadRequest:request];}27
  28. 28. MVCView Controller LifecycledidReceiveMemoryWarning:“You can override this method to release anyadditional memory used by your viewcontroller”28
  29. 29. EjercicioNewVideoView Controller en iPad29
  30. 30. iOS SimulatorFileOpen Printer SimulatorSave Screen Shot ⌘S30
  31. 31. iOS SimulatorHardwareDeviceiPad 2, miniiPad (Retina)iPhone 3G, 3GSiPhone (Retina 3.5-inch) 4, 4SiPhone (Retina 4-inch) 5, iPod TouchVersion5.0 (9A334) WWDC 20115.1 (9B176)6.0 (10A403) WWDC 20126.1 (10B141)31
  32. 32. iOS SimulatorHardwareRotate Left ⌘←Rotate Right ⌘→Shake Gesture ^⌘Z32
  33. 33. iOS SimulatorHardwareHome ⇧⌘HLock ⌘L33
  34. 34. iOS SimulatorHardwareSimulate Memory Warning didReceiveMemoryWarning:Toggle In-Call Status Bar ⌘TSimulate Hardware KeyboardTV OutDisabled640 x 480720 x 4801024 x 7681280 x 720 (720p)1920 x 1024 (1080p)34
  35. 35. iOS SimulatorDebugToggle Slow Animations35
  36. 36. iOS SimulatorDebugColor Blended Layers Reduce amount of red to improve performanceColor Copied ImagesColor Misaligned ImagesColor Offscreen-Rendered36
  37. 37. iOS SimulatorDebugLocationNoneCustom Location...Apple StoresAppleCity Bicycle RideCity RunFreeway Drive37
  38. 38. iOS SimulatorWindowScale100% ⌘175% ⌘250% ⌘338
  39. 39. InstrumentsProfiling⌘I39
  40. 40. InstrumentsAllocations40
  41. 41. InstrumentsAllocations- (void)didReceiveMemoryWarning{[super didReceiveMemoryWarning];self.webView = nil;self.spinner = nil;self.authorLabel = nil;self.titleLabel = nil;self.detailItem = nil;}41
  42. 42. InstrumentsLeaks42
  43. 43. ¡Gracias!43
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×