SlideShare ist ein Scribd-Unternehmen logo
1 von 43
Downloaden Sie, um offline zu lesen
Televisió de Catalunya
Formación en movilidad
Conceptos de desarrollo en iOS
3ª sesión mayo 2013
1
Qué veremos hoy
Repaso de la sesión anterior
UIWebView
View Cotroller en iPad
Simulador
2
Recursos
Tutoriales de Ray Wenderlich
www.raywenderlich.com/tutorials
Cursos de Stanford en iTunes U
itunes.stanford.edu
iOS Developer Library
developer.apple.com/library/ios
3
Repaso
View Controller
UIViewController
4
Repaso
Navigation Bar
UINavigationItem
UIBarButtonItem - NSString - UIBarButtonItem
5
Repaso
UIBarButtonItem
self.navigationItem.rightBarButtonItem
6
Repaso
UIStoryboardSegue
Modal
7
Repaso
// MasterViewController.m
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([[segue identifier] isEqualToString:@"newDetail"]) {
! ! NewVideoViewController *viewController = (NewVideoViewController *)[segue destinationViewController];
! ! viewController.masterViewController = self;
! }
}
8
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
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
Debugging
11
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;
@end
12
UIWebView
// DetailViewController.m
- (void)configureView
{
// ...
self.titleLabel.text = [self.detailItem valueForKey:@"title"];
self.authorLabel.text = [self.detailItem valueForKey:@"author"];
}
13
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
UIWebView
UIWebViewDelegate
// 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
UIWebView
UIWebViewDelegate
// 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
UIWebView
UIActivityIndicatorView
// 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;
@end
17
UIWebView
UIActivityIndicatorView
// 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
UIWebView
UIActivityIndicatorView
// 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
UIWebView
UIActivityIndicatorView
// 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
UIWebView
UIActivityIndicatorView
// 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
UIWebView
UIActivityIndicatorView
// 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
Coffee Break!
23
MVC
View Controller Lifecycle
viewDidLoad:
viewWillAppear:
viewDidAppear:
didReceiveMemoryWarning:
24
MVC
View Controller Lifecycle
viewDidLoad:
“This method is called after the view controller has loaded its view hierarchy into memory.
You usually override this method to perform additional
initialization 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
MVC
View Controller Lifecycle
viewWillAppear:
“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 tasks
associated 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
MVC
View Controller Lifecycle
viewDidAppear:
“You can override this method to perform additional
tasks 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
MVC
View Controller Lifecycle
didReceiveMemoryWarning:
“You can override this method to release any
additional memory used by your view
controller”
28
Ejercicio
NewVideoView Controller en iPad
29
iOS Simulator
File
Open Printer Simulator
Save Screen Shot ⌘S
30
iOS Simulator
Hardware
Device
iPad 2, mini
iPad (Retina)
iPhone 3G, 3GS
iPhone (Retina 3.5-inch) 4, 4S
iPhone (Retina 4-inch) 5, iPod Touch
Version
5.0 (9A334) WWDC 2011
5.1 (9B176)
6.0 (10A403) WWDC 2012
6.1 (10B141)
31
iOS Simulator
Hardware
Rotate Left ⌘←
Rotate Right ⌘→
Shake Gesture ^⌘Z
32
iOS Simulator
Hardware
Home ⇧⌘H
Lock ⌘L
33
iOS Simulator
Hardware
Simulate Memory Warning didReceiveMemoryWarning:
Toggle In-Call Status Bar ⌘T
Simulate Hardware Keyboard
TV Out
Disabled
640 x 480
720 x 480
1024 x 768
1280 x 720 (720p)
1920 x 1024 (1080p)
34
iOS Simulator
Debug
Toggle Slow Animations
35
iOS Simulator
Debug
Color Blended Layers Reduce amount of red to improve performance
Color Copied Images
Color Misaligned Images
Color Offscreen-Rendered
36
iOS Simulator
Debug
Location
None
Custom Location...
Apple Stores
Apple
City Bicycle Ride
City Run
Freeway Drive
37
iOS Simulator
Window
Scale
100% ⌘1
75% ⌘2
50% ⌘3
38
Instruments
Profiling
⌘I
39
Instruments
Allocations
40
Instruments
Allocations
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
self.webView = nil;
self.spinner = nil;
self.authorLabel = nil;
self.titleLabel = nil;
self.detailItem = nil;
}
41
Instruments
Leaks
42
¡Gracias!
43

Weitere ähnliche Inhalte

Was ist angesagt?

Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Jeado Ko
 
Beginning iphone 4_devlopement_chpter7_tab_b
Beginning iphone 4_devlopement_chpter7_tab_bBeginning iphone 4_devlopement_chpter7_tab_b
Beginning iphone 4_devlopement_chpter7_tab_b
Jihoon Kong
 
20130528 solution linux_frousseau_nopain_webdev
20130528 solution linux_frousseau_nopain_webdev20130528 solution linux_frousseau_nopain_webdev
20130528 solution linux_frousseau_nopain_webdev
Frank Rousseau
 

Was ist angesagt? (20)

Desenvolvimento iOS - Aula 4
Desenvolvimento iOS - Aula 4Desenvolvimento iOS - Aula 4
Desenvolvimento iOS - Aula 4
 
Enjoy the vue.js
Enjoy the vue.jsEnjoy the vue.js
Enjoy the vue.js
 
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
 
Modern frontend development with VueJs
Modern frontend development with VueJsModern frontend development with VueJs
Modern frontend development with VueJs
 
Beginning iphone 4_devlopement_chpter7_tab_b
Beginning iphone 4_devlopement_chpter7_tab_bBeginning iphone 4_devlopement_chpter7_tab_b
Beginning iphone 4_devlopement_chpter7_tab_b
 
Workshop 15: Ionic framework
Workshop 15: Ionic frameworkWorkshop 15: Ionic framework
Workshop 15: Ionic framework
 
Modular and Event-Driven JavaScript
Modular and Event-Driven JavaScriptModular and Event-Driven JavaScript
Modular and Event-Driven JavaScript
 
[FEConf Korea 2017]Angular 컴포넌트 대화법
[FEConf Korea 2017]Angular 컴포넌트 대화법[FEConf Korea 2017]Angular 컴포넌트 대화법
[FEConf Korea 2017]Angular 컴포넌트 대화법
 
Arquitetura de Front-end em Aplicações de Larga Escala
Arquitetura de Front-end em Aplicações de Larga EscalaArquitetura de Front-end em Aplicações de Larga Escala
Arquitetura de Front-end em Aplicações de Larga Escala
 
iOS
iOSiOS
iOS
 
20130528 solution linux_frousseau_nopain_webdev
20130528 solution linux_frousseau_nopain_webdev20130528 solution linux_frousseau_nopain_webdev
20130528 solution linux_frousseau_nopain_webdev
 
Web Apps building with Webpack
Web Apps building with WebpackWeb Apps building with Webpack
Web Apps building with Webpack
 
Beyond DOMReady: Ultra High-Performance Javascript
Beyond DOMReady: Ultra High-Performance JavascriptBeyond DOMReady: Ultra High-Performance Javascript
Beyond DOMReady: Ultra High-Performance Javascript
 
Angular JS blog tutorial
Angular JS blog tutorialAngular JS blog tutorial
Angular JS blog tutorial
 
Web components
Web componentsWeb components
Web components
 
Workshop 14: AngularJS Parte III
Workshop 14: AngularJS Parte IIIWorkshop 14: AngularJS Parte III
Workshop 14: AngularJS Parte III
 
YUI 3
YUI 3YUI 3
YUI 3
 
iPhone Appleless Apps
iPhone Appleless AppsiPhone Appleless Apps
iPhone Appleless Apps
 
IndexedDB - Querying and Performance
IndexedDB - Querying and PerformanceIndexedDB - Querying and Performance
IndexedDB - Querying and Performance
 
Workshop 12: AngularJS Parte I
Workshop 12: AngularJS Parte IWorkshop 12: AngularJS Parte I
Workshop 12: AngularJS Parte I
 

Andere mochten auch

208_gipuzkoako taldekako infantil txapelketa.doc
208_gipuzkoako taldekako infantil txapelketa.doc208_gipuzkoako taldekako infantil txapelketa.doc
208_gipuzkoako taldekako infantil txapelketa.doc
ElhuyarOlinpiada
 
презентация эксперт
презентация экспертпрезентация эксперт
презентация эксперт
Ivan Lyuberetsky
 
Animated multimedia talking books can pomote phonological awareness in childr...
Animated multimedia talking books can pomote phonological awareness in childr...Animated multimedia talking books can pomote phonological awareness in childr...
Animated multimedia talking books can pomote phonological awareness in childr...
changluchieh
 
Presentation street democracy
Presentation street democracyPresentation street democracy
Presentation street democracy
idemocratic
 
101_ikastolatik munainera.pps
101_ikastolatik munainera.pps101_ikastolatik munainera.pps
101_ikastolatik munainera.pps
ElhuyarOlinpiada
 
179_alhambra eta matematika.odt
179_alhambra eta matematika.odt179_alhambra eta matematika.odt
179_alhambra eta matematika.odt
ElhuyarOlinpiada
 
245_dunboa_udaberriko festa.doc
245_dunboa_udaberriko festa.doc245_dunboa_udaberriko festa.doc
245_dunboa_udaberriko festa.doc
ElhuyarOlinpiada
 
162_buruketaren ebazpena eta granadako alhambra.doc
162_buruketaren ebazpena eta granadako alhambra.doc162_buruketaren ebazpena eta granadako alhambra.doc
162_buruketaren ebazpena eta granadako alhambra.doc
ElhuyarOlinpiada
 
257_zernola zientzia festa 2d.doc
257_zernola zientzia festa 2d.doc257_zernola zientzia festa 2d.doc
257_zernola zientzia festa 2d.doc
ElhuyarOlinpiada
 

Andere mochten auch (20)

166_ibaialde 1t.ppt
166_ibaialde 1t.ppt166_ibaialde 1t.ppt
166_ibaialde 1t.ppt
 
208_gipuzkoako taldekako infantil txapelketa.doc
208_gipuzkoako taldekako infantil txapelketa.doc208_gipuzkoako taldekako infantil txapelketa.doc
208_gipuzkoako taldekako infantil txapelketa.doc
 
Formacion en movilidad: Conceptos de desarrollo en iOS (IV)
Formacion en movilidad: Conceptos de desarrollo en iOS (IV) Formacion en movilidad: Conceptos de desarrollo en iOS (IV)
Formacion en movilidad: Conceptos de desarrollo en iOS (IV)
 
школьной линейка 1 4 классов
школьной линейка 1 4 классовшкольной линейка 1 4 классов
школьной линейка 1 4 классов
 
презентация эксперт
презентация экспертпрезентация эксперт
презентация эксперт
 
Car Anecdote
Car AnecdoteCar Anecdote
Car Anecdote
 
Animated multimedia talking books can pomote phonological awareness in childr...
Animated multimedia talking books can pomote phonological awareness in childr...Animated multimedia talking books can pomote phonological awareness in childr...
Animated multimedia talking books can pomote phonological awareness in childr...
 
Presentation street democracy
Presentation street democracyPresentation street democracy
Presentation street democracy
 
110_4. froga.ppt
110_4. froga.ppt110_4. froga.ppt
110_4. froga.ppt
 
101_ikastolatik munainera.pps
101_ikastolatik munainera.pps101_ikastolatik munainera.pps
101_ikastolatik munainera.pps
 
219_ilargia.ppt
219_ilargia.ppt219_ilargia.ppt
219_ilargia.ppt
 
158_udako kanpamendua.ppt
158_udako kanpamendua.ppt158_udako kanpamendua.ppt
158_udako kanpamendua.ppt
 
179_alhambra eta matematika.odt
179_alhambra eta matematika.odt179_alhambra eta matematika.odt
179_alhambra eta matematika.odt
 
279_4proba dbh2c.ppt
279_4proba dbh2c.ppt279_4proba dbh2c.ppt
279_4proba dbh2c.ppt
 
27_aurkezpena berria.pps
27_aurkezpena berria.pps27_aurkezpena berria.pps
27_aurkezpena berria.pps
 
245_dunboa_udaberriko festa.doc
245_dunboa_udaberriko festa.doc245_dunboa_udaberriko festa.doc
245_dunboa_udaberriko festa.doc
 
162_buruketaren ebazpena eta granadako alhambra.doc
162_buruketaren ebazpena eta granadako alhambra.doc162_buruketaren ebazpena eta granadako alhambra.doc
162_buruketaren ebazpena eta granadako alhambra.doc
 
Concurso karaoke 2012 cardápio musical 2012
Concurso karaoke 2012   cardápio musical 2012 Concurso karaoke 2012   cardápio musical 2012
Concurso karaoke 2012 cardápio musical 2012
 
177_sukaldea_txus1d.ppt
177_sukaldea_txus1d.ppt177_sukaldea_txus1d.ppt
177_sukaldea_txus1d.ppt
 
257_zernola zientzia festa 2d.doc
257_zernola zientzia festa 2d.doc257_zernola zientzia festa 2d.doc
257_zernola zientzia festa 2d.doc
 

Ähnlich wie Formacion en movilidad: Conceptos de desarrollo en iOS (III)

Apple Templates Considered Harmful
Apple Templates Considered HarmfulApple Templates Considered Harmful
Apple Templates Considered Harmful
Brian Gesiak
 
Beginning icloud development - Cesare Rocchi - WhyMCA
Beginning icloud development - Cesare Rocchi - WhyMCABeginning icloud development - Cesare Rocchi - WhyMCA
Beginning icloud development - Cesare Rocchi - WhyMCA
Whymca
 
iOS for ERREST - alternative version
iOS for ERREST - alternative versioniOS for ERREST - alternative version
iOS for ERREST - alternative version
WO Community
 
Hızlı Cocoa Geliştirme (Develop your next cocoa app faster!)
Hızlı Cocoa Geliştirme (Develop your next cocoa app faster!)Hızlı Cocoa Geliştirme (Develop your next cocoa app faster!)
Hızlı Cocoa Geliştirme (Develop your next cocoa app faster!)
Sarp Erdag
 
Курсы по мобильной разработке под iOS. 4 лекция. Возможности телефона
Курсы по мобильной разработке под iOS. 4 лекция. Возможности телефонаКурсы по мобильной разработке под iOS. 4 лекция. Возможности телефона
Курсы по мобильной разработке под iOS. 4 лекция. Возможности телефона
Глеб Тарасов
 

Ähnlich wie Formacion en movilidad: Conceptos de desarrollo en iOS (III) (20)

Apple Templates Considered Harmful
Apple Templates Considered HarmfulApple Templates Considered Harmful
Apple Templates Considered Harmful
 
201104 iphone navigation-based apps
201104 iphone navigation-based apps201104 iphone navigation-based apps
201104 iphone navigation-based apps
 
UIWebView Tips
UIWebView TipsUIWebView Tips
UIWebView Tips
 
Your Second iPhone App - Code Listings
Your Second iPhone App - Code ListingsYour Second iPhone App - Code Listings
Your Second iPhone App - Code Listings
 
Conceitos e prática no desenvolvimento iOS - Mobile Conf 2014
Conceitos e prática no desenvolvimento iOS - Mobile Conf 2014Conceitos e prática no desenvolvimento iOS - Mobile Conf 2014
Conceitos e prática no desenvolvimento iOS - Mobile Conf 2014
 
Beginning icloud development - Cesare Rocchi - WhyMCA
Beginning icloud development - Cesare Rocchi - WhyMCABeginning icloud development - Cesare Rocchi - WhyMCA
Beginning icloud development - Cesare Rocchi - WhyMCA
 
iOS for ERREST - alternative version
iOS for ERREST - alternative versioniOS for ERREST - alternative version
iOS for ERREST - alternative version
 
I os 04
I os 04I os 04
I os 04
 
Leaving Interface Builder Behind
Leaving Interface Builder BehindLeaving Interface Builder Behind
Leaving Interface Builder Behind
 
Hızlı Cocoa Geliştirme (Develop your next cocoa app faster!)
Hızlı Cocoa Geliştirme (Develop your next cocoa app faster!)Hızlı Cocoa Geliştirme (Develop your next cocoa app faster!)
Hızlı Cocoa Geliştirme (Develop your next cocoa app faster!)
 
10 tips for a reusable architecture
10 tips for a reusable architecture10 tips for a reusable architecture
10 tips for a reusable architecture
 
IOS APPs Revision
IOS APPs RevisionIOS APPs Revision
IOS APPs Revision
 
Курсы по мобильной разработке под iOS. 4 лекция. Возможности телефона
Курсы по мобильной разработке под iOS. 4 лекция. Возможности телефонаКурсы по мобильной разработке под iOS. 4 лекция. Возможности телефона
Курсы по мобильной разработке под iOS. 4 лекция. Возможности телефона
 
Developing iOS REST Applications
Developing iOS REST ApplicationsDeveloping iOS REST Applications
Developing iOS REST Applications
 
iOS Beginners Lesson 4
iOS Beginners Lesson 4iOS Beginners Lesson 4
iOS Beginners Lesson 4
 
MBLTDev15: Egor Tolstoy, Rambler&Co
MBLTDev15: Egor Tolstoy, Rambler&CoMBLTDev15: Egor Tolstoy, Rambler&Co
MBLTDev15: Egor Tolstoy, Rambler&Co
 
Aurelia Meetup Paris
Aurelia Meetup ParisAurelia Meetup Paris
Aurelia Meetup Paris
 
ASP.NET MVC Internals
ASP.NET MVC InternalsASP.NET MVC Internals
ASP.NET MVC Internals
 
정오의 데이트 for iOS 코드 정리
정오의 데이트 for iOS 코드 정리정오의 데이트 for iOS 코드 정리
정오의 데이트 for iOS 코드 정리
 
303 TANSTAAFL: Using Open Source iPhone UI Code
303 TANSTAAFL: Using Open Source iPhone UI Code303 TANSTAAFL: Using Open Source iPhone UI Code
303 TANSTAAFL: Using Open Source iPhone UI Code
 

Mehr von Mobivery

Hoy es Marketing 2013: El móvil en la cadena de distribución
Hoy es Marketing 2013: El móvil en la cadena de distribuciónHoy es Marketing 2013: El móvil en la cadena de distribución
Hoy es Marketing 2013: El móvil en la cadena de distribución
Mobivery
 
Mobile Health - Nuevos retos y oportunidades. El caso de éxito de iPediatric
Mobile Health - Nuevos retos y oportunidades. El caso de éxito de iPediatricMobile Health - Nuevos retos y oportunidades. El caso de éxito de iPediatric
Mobile Health - Nuevos retos y oportunidades. El caso de éxito de iPediatric
Mobivery
 

Mehr von Mobivery (20)

Jornada Empresa UOC - Desarrollo de Aplicaciones para Formación en RRHH
Jornada Empresa UOC - Desarrollo de Aplicaciones para Formación en RRHHJornada Empresa UOC - Desarrollo de Aplicaciones para Formación en RRHH
Jornada Empresa UOC - Desarrollo de Aplicaciones para Formación en RRHH
 
Modelo start up: Una forma de encontrar trabajo
Modelo start up: Una forma de encontrar trabajo Modelo start up: Una forma de encontrar trabajo
Modelo start up: Una forma de encontrar trabajo
 
¿Persona o empleado? Algo está cambiando en nuestras empresas
¿Persona o empleado? Algo está cambiando en nuestras empresas¿Persona o empleado? Algo está cambiando en nuestras empresas
¿Persona o empleado? Algo está cambiando en nuestras empresas
 
Móvil y Retail: Cambiando las reglas del juego
Móvil y Retail: Cambiando las reglas del juegoMóvil y Retail: Cambiando las reglas del juego
Móvil y Retail: Cambiando las reglas del juego
 
Presentación de Mobivery en el FET2013
Presentación de Mobivery en el FET2013Presentación de Mobivery en el FET2013
Presentación de Mobivery en el FET2013
 
Curso de formación en Movilidad (Parte III) - Tecnología de Servidor
Curso de formación en Movilidad (Parte III) - Tecnología de ServidorCurso de formación en Movilidad (Parte III) - Tecnología de Servidor
Curso de formación en Movilidad (Parte III) - Tecnología de Servidor
 
Curso de formación en Movilidad (Parte II) - Personalización
Curso de formación en Movilidad (Parte II) - Personalización Curso de formación en Movilidad (Parte II) - Personalización
Curso de formación en Movilidad (Parte II) - Personalización
 
Curso de formación en Movilidad (Parte I) - Mobile Device Management
Curso de formación en Movilidad (Parte I) - Mobile Device ManagementCurso de formación en Movilidad (Parte I) - Mobile Device Management
Curso de formación en Movilidad (Parte I) - Mobile Device Management
 
Formacion en movilidad: Conceptos de desarrollo en iOS (II)
Formacion en movilidad: Conceptos de desarrollo en iOS (II) Formacion en movilidad: Conceptos de desarrollo en iOS (II)
Formacion en movilidad: Conceptos de desarrollo en iOS (II)
 
Formacion en movilidad: Conceptos de desarrollo en iOS (I)
Formacion en movilidad: Conceptos de desarrollo en iOS (I) Formacion en movilidad: Conceptos de desarrollo en iOS (I)
Formacion en movilidad: Conceptos de desarrollo en iOS (I)
 
Formación en movilidad: Conceptos de desarrollo en iOS (V)
Formación en movilidad: Conceptos de desarrollo en iOS (V) Formación en movilidad: Conceptos de desarrollo en iOS (V)
Formación en movilidad: Conceptos de desarrollo en iOS (V)
 
Hoy es Marketing 2013: El móvil en la cadena de distribución
Hoy es Marketing 2013: El móvil en la cadena de distribuciónHoy es Marketing 2013: El móvil en la cadena de distribución
Hoy es Marketing 2013: El móvil en la cadena de distribución
 
Introducción Mobile Apps
Introducción Mobile AppsIntroducción Mobile Apps
Introducción Mobile Apps
 
UrbanSensing - Escuchando la ciudad digital
UrbanSensing  - Escuchando la ciudad digitalUrbanSensing  - Escuchando la ciudad digital
UrbanSensing - Escuchando la ciudad digital
 
Mobile Health - Nuevos retos y oportunidades. El caso de éxito de iPediatric
Mobile Health - Nuevos retos y oportunidades. El caso de éxito de iPediatricMobile Health - Nuevos retos y oportunidades. El caso de éxito de iPediatric
Mobile Health - Nuevos retos y oportunidades. El caso de éxito de iPediatric
 
Marketing de Apps
Marketing de Apps Marketing de Apps
Marketing de Apps
 
Aplicaciones móviles: Usabilidad y Experiencia de Usuario
Aplicaciones móviles: Usabilidad y Experiencia de UsuarioAplicaciones móviles: Usabilidad y Experiencia de Usuario
Aplicaciones móviles: Usabilidad y Experiencia de Usuario
 
Workshop I: Diseño de aplicaciones para iPhone
Workshop I: Diseño de aplicaciones para iPhoneWorkshop I: Diseño de aplicaciones para iPhone
Workshop I: Diseño de aplicaciones para iPhone
 
Cómo monetizar tus apps: Cantidad y Calidad
Cómo monetizar tus apps: Cantidad y CalidadCómo monetizar tus apps: Cantidad y Calidad
Cómo monetizar tus apps: Cantidad y Calidad
 
Formación Aecomo Academy - Monetización de aplicaciones
Formación Aecomo Academy - Monetización de aplicacionesFormación Aecomo Academy - Monetización de aplicaciones
Formación Aecomo Academy - Monetización de aplicaciones
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Kürzlich hochgeladen (20)

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 

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

  • 1. Televisió de Catalunya Formación en movilidad Conceptos de desarrollo en iOS 3ª sesión mayo 2013 1
  • 2. Qué veremos hoy Repaso de la sesión anterior UIWebView View Cotroller en iPad Simulador 2
  • 3. Recursos Tutoriales de Ray Wenderlich www.raywenderlich.com/tutorials Cursos de Stanford en iTunes U itunes.stanford.edu iOS Developer Library developer.apple.com/library/ios 3
  • 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. 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. 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
  • 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; @end 12
  • 13. UIWebView // DetailViewController.m - (void)configureView { // ... self.titleLabel.text = [self.detailItem valueForKey:@"title"]; self.authorLabel.text = [self.detailItem valueForKey:@"author"]; } 13
  • 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. UIWebView UIWebViewDelegate // 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. UIWebView UIWebViewDelegate // 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. UIWebView UIActivityIndicatorView // 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; @end 17
  • 18. UIWebView UIActivityIndicatorView // 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. UIWebView UIActivityIndicatorView // 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. UIWebView UIActivityIndicatorView // 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. UIWebView UIActivityIndicatorView // 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. UIWebView UIActivityIndicatorView // 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
  • 25. MVC View Controller Lifecycle viewDidLoad: “This method is called after the view controller has loaded its view hierarchy into memory. You usually override this method to perform additional initialization 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. MVC View Controller Lifecycle viewWillAppear: “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 tasks associated 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. MVC View Controller Lifecycle viewDidAppear: “You can override this method to perform additional tasks 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. MVC View Controller Lifecycle didReceiveMemoryWarning: “You can override this method to release any additional memory used by your view controller” 28
  • 30. iOS Simulator File Open Printer Simulator Save Screen Shot ⌘S 30
  • 31. iOS Simulator Hardware Device iPad 2, mini iPad (Retina) iPhone 3G, 3GS iPhone (Retina 3.5-inch) 4, 4S iPhone (Retina 4-inch) 5, iPod Touch Version 5.0 (9A334) WWDC 2011 5.1 (9B176) 6.0 (10A403) WWDC 2012 6.1 (10B141) 31
  • 32. iOS Simulator Hardware Rotate Left ⌘← Rotate Right ⌘→ Shake Gesture ^⌘Z 32
  • 34. iOS Simulator Hardware Simulate Memory Warning didReceiveMemoryWarning: Toggle In-Call Status Bar ⌘T Simulate Hardware Keyboard TV Out Disabled 640 x 480 720 x 480 1024 x 768 1280 x 720 (720p) 1920 x 1024 (1080p) 34
  • 36. iOS Simulator Debug Color Blended Layers Reduce amount of red to improve performance Color Copied Images Color Misaligned Images Color Offscreen-Rendered 36
  • 37. iOS Simulator Debug Location None Custom Location... Apple Stores Apple City Bicycle Ride City Run Freeway Drive 37
  • 41. Instruments Allocations - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; self.webView = nil; self.spinner = nil; self.authorLabel = nil; self.titleLabel = nil; self.detailItem = nil; } 41