Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
iOS: Sviluppo App iPhone & 
iPad 
Dario Pizzuto 
1
Storyboard 3a parte 
2
Storyboard 
3 
Argomenti! 
• UITableView! 
• UIAlertView! 
• UIImageView! 
• UITextView! 
• UIPickerView
UITableView 
4
Storyboard 
UITableView! 
• Oggetto molto usato! 
• Versatile! 
• Presenta i dati in una lista scorribile 
5
Storyboard 
UITableView! 
• Permette all’utente di navigare 
facilmente dari gerarchici! 
• Permette di presentare una lis...
Storyboard 
UITableView! 
• Lavora unitamente ai Protocols! 
✓UITableViewDelegate! 
✓UITableViewDataSource! 
• Utili per g...
Storyboard 
8 
UITableView! 
• Esiste un componente pronto all’uso! 
✓UITableViewController! 
• È possibile gestire una ta...
Storyboard 
Esempio UITableView custom 
9 
UITableViewCell
Storyboard 
UITableViewDataSource! 
• Protocollo per costruire e modificare 
tableView! 
• Metodi da implementare! 
✓table...
Storyboard 
UITableViewDelegate! 
• Protocol per gestire le azioni sui 
records! 
• Selection, edit, delete …! 
• Si compo...
Storyboard 
NSIndexPath! 
• Fornisce il percorso di un determinato 
nodo all’interno di un albero! 
• Utilizzato in TableV...
Storyboard 
13 
NSIndexPath
Storyboard 
UITableViewCell! 
• Rappresenta la cella della TableView! 
• È possibile scegliere il tipo di cella! 
• È poss...
Storyboard 
Composizione UITableViewCell 
15
Storyboard 
UITableViewCell settings 
16
Storyboard 
UITableViewController Interface 
17
Storyboard 
UITableViewController Implementation 
18
Storyboard 
Esempio UITableViewController 
19
Storyboard 
UITableViewController! 
• Classe custom per la gestione della 
TableView! 
• Classe custom per la view di dett...
Storyboard 
Esempio UITableViewController 
21
Storyboard 
UITableViewController! 
• Per gestire il passaggio di dati è 
necessario preparare la TableView e 
la View di ...
Storyboard 
UITableViewController! 
• Per gestire il passaggio di dati 
utilizziamo il metodo! 
23 
! 
!
Storyboard 
UITableViewController! 
• Istanziare view di dettaglio! 
• Set dati da “trasferire”! 
! 
! 
24
Storyboard 
UITableViewController editing mode! 
• È possibile abilitare la modalità di 
editing per singola cella o inter...
Storyboard 
UITableViewController editing mode! 
- (UITableViewCellEditingStyle)tableView:(UITableView 
*)tableView editin...
Storyboard 
UITableViewController editing mode! 
• È importante aggiornare il modello dati prima di 
ogni operazione di in...
UIAlertView 
28
Storyboard 
UIAlertView! 
• Fornisce un sistema di output visuale 
per l’utente! 
• Permette di scatenare azioni a seguito...
Storyboard 
UIAlertView! 
• Deprecato in iOS 8 in favore di 
UIAlertController! 
• Adesso ingloba anche UIActionSheet 
per...
Storyboard 
UIAlertView! 
• Si compone di 3 elementi! 
31 
✓Title! 
✓Message! 
✓Buttons
Storyboard 
32 
UIAlertView 
Title 
Message 
Buttons
Storyboard 
UIAlertView! 
• Classe istanziata attraverso metodo 
initWithTitle:message:delegate:c 
ancelButtonTitle:otherB...
Storyboard 
UIAlertView! 
• È possibile mostrare alert attraverso 
34 
metodo show
Storyboard 
Esempio UIAlertView! 
UIAlertView *alert = [[UIAlertView 
alloc]initWithTitle:@"Test" 
message:@"Hello World" ...
Storyboard 
36 
UIAlertView
Storyboard 
37 
UIAlertView! 
• Impostiamo delegate se è necessario 
gestire azioni a partire dall’input utente! 
• E.G.! ...
Storyboard 
UIAlertView! 
• Per catturare le azioni dell’utente è 
necessario che la classe sia conforme 
al protocol UIAl...
UIImageView 
39
Storyboard 
UIImageView! 
• Oggetto che ci permette di 
visualizzare un’immagine o una serie 
di immagini generando un’ani...
Storyboard 
41 
UIImageView
Storyboard 
UIImageView! 
• Può essere inizializzata attraverso il 
metodo initWithImage:! 
• È necessario impostare un’im...
Storyboard 
43 
Images.xcassets! 
• Libreria per la gestione degli oggetti 
multimediali importati nel progetto! 
• Utile ...
Storyboard 
44 
Images.xcassets
Storyboard 
45 
Images.xcassets
Storyboard 
Esempio UIImageView 
46
UITextView 
47
Storyboard 
48 
UITextView! 
• Componente per la visualizzazione e input di 
testo! 
• Scrollable! 
• Stile, colori, font,...
Storyboard 
UITextViewDelegate! 
• Metodi uso ricorrente! 
✓textViewDidBeginEditing ! 
✓textViewDidEndEditing ! 
✓textView...
Storyboard 
UITextViewDelegate - 
textViewDidBeginEditing! 
• Metodo chiamato quando l’utente 
inizia l’editing nella text...
Storyboard 
UITextViewDelegate - 
textViewDidEndEditing! 
• Metodo chiamato quando l’utente 
conclude l’editing nella text...
Storyboard 
UITextViewDelegate - 
textViewShouldEndEditing! 
• Metodo chiamato quando l’utente sta 
per concludere l’editi...
Storyboard 
UITextViewDelegate - 
shouldChangeTextInRange! 
• Metodo chiamato ogni qual volta 
l’utente inserisce un carat...
Storyboard 
54 
UITextView
Storyboard 
55 
UITextView 
TextView
UIPickerView 
56
Storyboard 
UIPickerView! 
• Componente di scelta attraverso 
visualizzazione a “slot-machine”! 
• Possibile mostrare più ...
Storyboard 
58 
UIPickerView 
Date Picker 
Single component Picker
Storyboard 
UIPickerView! 
• Si compone di 2 oggetti! 
59 
✓Component! 
✓Row
Storyboard 
60 
UIPickerView 
Components 
Rows
Storyboard 
UIPickerView! 
• Lavora con i protocols! 
✓UIPickerViewDelegate! 
✓UIPickerViewDataSource 
61
Storyboard 
UIPickerViewDelegate! 
• Usato per configurare l’appereance 
della Picker! 
• Metodo 
pickerView:didSelectRow:...
Storyboard 
UIPickerViewDataSource! 
• Usato per configurare i valori delle rows 
della picker! 
✓numberOfComponentsInPick...
Storyboard 
UIPickerView storyboard 
64
Storyboard 
UIPickerView storyboard 
65
Storyboard 
66 
UIPickerView! 
• Possibile presentare la picker a seguito di input 
su textField o altri oggetti! 
• In ta...
Let’s Code 
67
Storyboard 
Let’s Code! 
✦Implementare una TableView con 
layout celle e dati a scelta e 
visualizzazione dati in View 
su...
Storyboard 
Ulteriori approfondimenti! 
TableView programming guide! 
UIAlertView! 
UIImageView! 
UITextView! 
Picker View...
Domande ? 
70
Upcoming SlideShare
Loading in …5
×

iOS_Course_11

303 views

Published on

iOS Course lection 11.
UITableView, UITableViewController, UiTableViewDelegate, UITableViewDataSource, UIAlertView, UIPickerView, UIImageView.

Published in: Software
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

iOS_Course_11

  1. 1. iOS: Sviluppo App iPhone & iPad Dario Pizzuto 1
  2. 2. Storyboard 3a parte 2
  3. 3. Storyboard 3 Argomenti! • UITableView! • UIAlertView! • UIImageView! • UITextView! • UIPickerView
  4. 4. UITableView 4
  5. 5. Storyboard UITableView! • Oggetto molto usato! • Versatile! • Presenta i dati in una lista scorribile 5
  6. 6. Storyboard UITableView! • Permette all’utente di navigare facilmente dari gerarchici! • Permette di presentare una lista di contenuti indicizzati! • Permette di raggruppare le informazioni ! • Permette la divisione dei dati in sezioni 6
  7. 7. Storyboard UITableView! • Lavora unitamente ai Protocols! ✓UITableViewDelegate! ✓UITableViewDataSource! • Utili per gestire i records e layout grafico della TableView 7
  8. 8. Storyboard 8 UITableView! • Esiste un componente pronto all’uso! ✓UITableViewController! • È possibile gestire una tableView da oggetti non di tipo UITableViewController! • Conforme ai protocolli UITableViewDataSource e UITableViewDelegate! • IBoutlet in storyboard e collegamento delegate, data source
  9. 9. Storyboard Esempio UITableView custom 9 UITableViewCell
  10. 10. Storyboard UITableViewDataSource! • Protocollo per costruire e modificare tableView! • Metodi da implementare! ✓tableView:cellForRowAtIndexPath:! ✓numberOfSectionsInTableView:! ✓tableView:numberOfRowsInSection: 10
  11. 11. Storyboard UITableViewDelegate! • Protocol per gestire le azioni sui records! • Selection, edit, delete …! • Si compone di metodi opzionali! • Utilizza la classe NSIndexPath 11
  12. 12. Storyboard NSIndexPath! • Fornisce il percorso di un determinato nodo all’interno di un albero! • Utilizzato in TableView sarà utile per 12 conoscere ! ✓Section! ✓Row
  13. 13. Storyboard 13 NSIndexPath
  14. 14. Storyboard UITableViewCell! • Rappresenta la cella della TableView! • È possibile scegliere il tipo di cella! • È possibile personalizzarla in ogni suo aspetto attraverso una subclass di UITableViewCell 14
  15. 15. Storyboard Composizione UITableViewCell 15
  16. 16. Storyboard UITableViewCell settings 16
  17. 17. Storyboard UITableViewController Interface 17
  18. 18. Storyboard UITableViewController Implementation 18
  19. 19. Storyboard Esempio UITableViewController 19
  20. 20. Storyboard UITableViewController! • Classe custom per la gestione della TableView! • Classe custom per la view di dettaglio ! • Collegare le Views 20
  21. 21. Storyboard Esempio UITableViewController 21
  22. 22. Storyboard UITableViewController! • Per gestire il passaggio di dati è necessario preparare la TableView e la View di destinazione ! • Utilizzare properties adatte a contenere il dato 22
  23. 23. Storyboard UITableViewController! • Per gestire il passaggio di dati utilizziamo il metodo! 23 ! !
  24. 24. Storyboard UITableViewController! • Istanziare view di dettaglio! • Set dati da “trasferire”! ! ! 24
  25. 25. Storyboard UITableViewController editing mode! • È possibile abilitare la modalità di editing per singola cella o intera tableView ! • Attraverso la editing mode è possibile eliminare o inserire una nuova cella 25
  26. 26. Storyboard UITableViewController editing mode! - (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath: (NSIndexPath *)indexPath {! …..! if(….){! return UITableViewCellEditingStyleInsert;! 26 } else {! return UITableViewCellEditingStyleDelete;! }! }
  27. 27. Storyboard UITableViewController editing mode! • È importante aggiornare il modello dati prima di ogni operazione di insert/delete! • È importante aggiornare la TableView dopo le operazioni di insert/delete! • Si utilizza il metodo update reloadData:! • Possibile utilizzare anche i metodi beginUpdates e endUpdates rispettivamente prima e dopo le operazioni di insert/delete 27
  28. 28. UIAlertView 28
  29. 29. Storyboard UIAlertView! • Fornisce un sistema di output visuale per l’utente! • Permette di scatenare azioni a seguito della scelta dell’utente! • Lavora unitamente al delegate UIAlertViewDelegate 29
  30. 30. Storyboard UIAlertView! • Deprecato in iOS 8 in favore di UIAlertController! • Adesso ingloba anche UIActionSheet per la gestione di menu contestuali contenenti azioni 30
  31. 31. Storyboard UIAlertView! • Si compone di 3 elementi! 31 ✓Title! ✓Message! ✓Buttons
  32. 32. Storyboard 32 UIAlertView Title Message Buttons
  33. 33. Storyboard UIAlertView! • Classe istanziata attraverso metodo initWithTitle:message:delegate:c ancelButtonTitle:otherButtonTitl es: 33
  34. 34. Storyboard UIAlertView! • È possibile mostrare alert attraverso 34 metodo show
  35. 35. Storyboard Esempio UIAlertView! UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Test" message:@"Hello World" delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];! [alert show]; 35
  36. 36. Storyboard 36 UIAlertView
  37. 37. Storyboard 37 UIAlertView! • Impostiamo delegate se è necessario gestire azioni a partire dall’input utente! • E.G.! ✓Salvataggio dati imputati! ✓Azioni di cambio view dopo “Ok” o “Annulla”! ✓…
  38. 38. Storyboard UIAlertView! • Per catturare le azioni dell’utente è necessario che la classe sia conforme al protocol UIAlertViewDelegate! • Implementare metodo opzionale dismissWithClickedButtonInde x:animated: 38
  39. 39. UIImageView 39
  40. 40. Storyboard UIImageView! • Oggetto che ci permette di visualizzare un’immagine o una serie di immagini generando un’animazione! • Possibile subclass per personalizzare ogni aspetto del componente! • Disponibile nello storyboard 40
  41. 41. Storyboard 41 UIImageView
  42. 42. Storyboard UIImageView! • Può essere inizializzata attraverso il metodo initWithImage:! • È necessario impostare un’immagine all’interno del progetto 42
  43. 43. Storyboard 43 Images.xcassets! • Libreria per la gestione degli oggetti multimediali importati nel progetto! • Utile per gestire in modo semplice le immagini! • Possibile Drag&Drop delle immagini! • Viene effettuata una copia locale del file, non reference al file
  44. 44. Storyboard 44 Images.xcassets
  45. 45. Storyboard 45 Images.xcassets
  46. 46. Storyboard Esempio UIImageView 46
  47. 47. UITextView 47
  48. 48. Storyboard 48 UITextView! • Componente per la visualizzazione e input di testo! • Scrollable! • Stile, colori, font, personalizzabili! • Lavora unitamente al delegate UITextViewDelegate! • Se lo utilizziamo da storyboard è necessario collegamento delegate
  49. 49. Storyboard UITextViewDelegate! • Metodi uso ricorrente! ✓textViewDidBeginEditing ! ✓textViewDidEndEditing ! ✓textViewShouldEndEditing! ✓shouldChangeTextInRange 49
  50. 50. Storyboard UITextViewDelegate - textViewDidBeginEditing! • Metodo chiamato quando l’utente inizia l’editing nella textView 50
  51. 51. Storyboard UITextViewDelegate - textViewDidEndEditing! • Metodo chiamato quando l’utente conclude l’editing nella textView! • Ultima chiamata del delegate prima di “chiudere” le operazioni sull’oggetto 51
  52. 52. Storyboard UITextViewDelegate - textViewShouldEndEditing! • Metodo chiamato quando l’utente sta per concludere l’editing nella textView e muove il focus ad un altro componente 52
  53. 53. Storyboard UITextViewDelegate - shouldChangeTextInRange! • Metodo chiamato ogni qual volta l’utente inserisce un carattere nella textView 53
  54. 54. Storyboard 54 UITextView
  55. 55. Storyboard 55 UITextView TextView
  56. 56. UIPickerView 56
  57. 57. Storyboard UIPickerView! • Componente di scelta attraverso visualizzazione a “slot-machine”! • Possibile mostrare più slot di selezione! • Es. scelta della data 57
  58. 58. Storyboard 58 UIPickerView Date Picker Single component Picker
  59. 59. Storyboard UIPickerView! • Si compone di 2 oggetti! 59 ✓Component! ✓Row
  60. 60. Storyboard 60 UIPickerView Components Rows
  61. 61. Storyboard UIPickerView! • Lavora con i protocols! ✓UIPickerViewDelegate! ✓UIPickerViewDataSource 61
  62. 62. Storyboard UIPickerViewDelegate! • Usato per configurare l’appereance della Picker! • Metodo pickerView:didSelectRow:inCo mponent: invocato quando l’utente effettua la selezione sulla picker 62
  63. 63. Storyboard UIPickerViewDataSource! • Usato per configurare i valori delle rows della picker! ✓numberOfComponentsInPickerVie w: stabilisce il numero di componenti della picker! ✓pickerView:numberOfRowsInComp onent: stabilisce il numero delle rows del singolo componente 63
  64. 64. Storyboard UIPickerView storyboard 64
  65. 65. Storyboard UIPickerView storyboard 65
  66. 66. Storyboard 66 UIPickerView! • Possibile presentare la picker a seguito di input su textField o altri oggetti! • In tal caso è necessario personalizzare la inputView della textField ed inserire il codice di creazione della picker nel metodo textFieldShouldBeginEditing! • La classe deve contenere i metodi di data source e delegate per configurare correttamente la Picker
  67. 67. Let’s Code 67
  68. 68. Storyboard Let’s Code! ✦Implementare una TableView con layout celle e dati a scelta e visualizzazione dati in View successiva 68
  69. 69. Storyboard Ulteriori approfondimenti! TableView programming guide! UIAlertView! UIImageView! UITextView! Picker Views 69
  70. 70. Domande ? 70

×