Lecture (November 18th): Basics of iOS Development

1,105

Published on

These are the slides for the lecture I gave on November 18th for the Polytechnic of Milan's Human-Computer Interaction course. It gives pointers to people that want to begin developing for iOS.

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

  • Be the first to like this

No Downloads
Views
Total Views
1,105
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
19
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Lecture (November 18th): Basics of iOS Development

  1. 1. iPHONE + iPAD: SUDDENLY SOMETHING ELSE ∞ · NOVEMBER 18th 2010 · HCI · POLIMI venerdì 19 novembre 2010
  2. 2. THE FUTURE OH MY GOD THE FUTURE venerdì 19 novembre 2010
  3. 3. PROGETTO DATA STATO 1987-2001 SCIENCE FICTION TRICORDER + D-PAD STAR TREK TNG · DS9 · VOYAGER venerdì 19 novembre 2010
  4. 4. FUTURE OH MY GOD THE FUTURE AND IT IS HERE PRESENT venerdì 19 novembre 2010
  5. 5. 1. It’s full of stars (THE FUTURE IS HERE THE FUTURE IS HERE) venerdì 19 novembre 2010
  6. 6. 2. It’s where users are! “THE IPHONE HAS BEEN ABLE TO MAINTAIN OVER 100% Y/Y GROWTH ON AVERAGE.” WWW.ASYMCO.COM venerdì 19 novembre 2010
  7. 7. … (maybe because it’s the most usable?) venerdì 19 novembre 2010
  8. 8. 3. €€€€€€€€€€€€€€€€€€€ (case study: me.) venerdì 19 novembre 2010
  9. 9. APPLE IPHONE 3G AD: “SHARE”. HTTP://WWW.YOUTUBE.COM/WATCH?V=0CIPNTUVX0C venerdì 19 novembre 2010
  10. 10. venerdì 19 novembre 2010
  11. 11. > 2,2 million free d/l > 95,000 paid downloads venerdì 19 novembre 2010
  12. 12. È STATO UN POMERIGGIO DI FINE ESTATE STAVO CAMMINANDO PER LE VIE DEL CENTRO MILANESE (IN CUI PIACE MOLTO PERDERMI) ED ERO IN ZONA BRERA QUANDO SENTO SQUILLARE IL MIO CELLULARE SECCATO LO TIRO FUORI, MA UNO SGUARDO ALLO SCHERMO ACCENDE LA MIA CURIOSITÀ. “+44” DICE LO SCHERMO (NON RICORDAVO AL MOMENTO MA QUELLO ERA IL PREFISSO INTERNAZIONALE DEL REGNO UNITO). ALL’ALTRO CAPO UNA VOCE ITALIANA MI FA “CIAO, SONO NONPOSSODIRLO DI APPLE, CHIAMO DA LONDRA. VORRESTI METTERE LA TUA APP NEL NOSTRO SPOT?” venerdì 19 novembre 2010
  13. 13. YOU, MAKING APPS. (Let’s talk about it.) venerdì 19 novembre 2010
  14. 14. Design. venerdì 19 novembre 2010
  15. 15. The iPhone IS A BUNCH OF SENSORS IN YOUR POCKET WITH A SCREEN. venerdì 19 novembre 2010
  16. 16. PLAYING MAKE-BELIEVE EXCEPT IT WORKS FOR REAL venerdì 19 novembre 2010
  17. 17. IBOOKS BY APPLE. venerdì 19 novembre 2010
  18. 18. OCARINA BY SMULE. HTTP://WWW.YOUTUBE.COM/WATCH?V=RHCJQ7EAJJA venerdì 19 novembre 2010
  19. 19. The iPhone IS DIFFERENT FROM A DESKTOP COMPUTER BLUH BLUH BLUH venerdì 19 novembre 2010
  20. 20. Desktop differences Quick use. (Pick it up, use it, back in the pocket.) Imprecise input, bad (best-of-breed) keyboard. Made for touching: direct manipulation. Point to pick! venerdì 19 novembre 2010
  21. 21. The iPhone IS DIFFERENT FROM ITS COMPETITORS venerdì 19 novembre 2010
  22. 22. Differences with other phones/OSes (I) All OS tries to rate good-if-not-best. Most needed stuff built in. (Many other factors, but few directly affecting us.) venerdì 19 novembre 2010
  23. 23. Differences with other phones/OSes (II) One thing at a time: discrete apps. Consistency broken very carefully. RELIABLE! venerdì 19 novembre 2010
  24. 24. iOS ≈ Mac OS X (but different) venerdì 19 novembre 2010
  25. 25. venerdì 19 novembre 2010
  26. 26. iOS No filesystem Instead, discrete tasks in apps! Built atop responsiveness Animation everywhere. No virtual memory (writing) Apps must not make the OS go out of memory! venerdì 19 novembre 2010
  27. 27. Apps Isolated! Can communicate (URLs, open files, pasteboard [copy/paste]) User always in control. If user presses Home, YOU QUIT. venerdì 19 novembre 2010
  28. 28. Tools. NOT CHEAP! venerdì 19 novembre 2010
  29. 29. REQUIRED STUFF » venerdì 19 novembre 2010
  30. 30. PLATFORM DATE STATUS NOVEMBER 15 NEW MACS EVERY 3-6 MONTHS A MAC €999+ venerdì 19 novembre 2010
  31. 31. TOOLS DATE STATUS NOVEMBER 15 IN FLUX XCODE XCODE TOOLS + IOS SDK 4 venerdì 19 novembre 2010
  32. 32. http://developer.apple.com/ios TOOLS ARE FREE · INCLUDES SIMULATOR venerdì 19 novembre 2010
  33. 33. OPTIONAL STUFF (at least at the time you start) » venerdì 19 novembre 2010
  34. 34. TEST DEVICE DATE STATUS NOVEMBER 15 EXPENSIVE IPHONE €539+ (ACTUALLY OPTIONAL) venerdì 19 novembre 2010
  35. 35. TEST DEVICE DATE STATUS NOVEMBER 15 MUCH CHEAPER! IPOD TOUCH €239+ (ACTUALLY OPTIONAL · WI-FI ONLY) venerdì 19 novembre 2010
  36. 36. http://developer.apple.com/ios DEVICE DEBUG + DEPLOY: € 79/year venerdì 19 novembre 2010
  37. 37. And now ACTUAL DEVELOPMENT STUFF. venerdì 19 novembre 2010
  38. 38. Objective-C. C + OBJECTS. venerdì 19 novembre 2010
  39. 39. float f = 1.23; int x = fabs(f); PURE C. float f = 1.23; int x = fabs(f); OBJECTIVE-C. venerdì 19 novembre 2010
  40. 40. [calculator add:1 to:2 and:3]; // method == “-add:to:and:” // arguments == 1,2,3 venerdì 19 novembre 2010
  41. 41. -(void) add:(int)a to:(int)b and:(int)c; venerdì 19 novembre 2010
  42. 42. NSString* x = …; NSString* y = [x substringToIndex:10]; venerdì 19 novembre 2010
  43. 43. id x = …; id y = [x substringToIndex:10]; venerdì 19 novembre 2010
  44. 44. NSArray* a = …; [a addObject:@“12345”]; venerdì 19 novembre 2010
  45. 45. NSArray* a = …; [a performSelector:@selector (addObject:) withObject:@“1234”]; venerdì 19 novembre 2010
  46. 46. VIEW CONTROLLERS venerdì 19 novembre 2010
  47. 47. VIEWS make up what’s onscreen VIEW CONTROLLERS make up the LOGICAL structure of your app. NAVIGATION ALL SONGS » FAVORITES » EDIT » SONG PICKER venerdì 19 novembre 2010
  48. 48. UIAPPLICATION the app’s DELEGATE WINDOW views for 1 VIEW CTL 1 VIEW CTL 2 views for 2 owns venerdì 19 novembre 2010
  49. 49. UIAPPLICATION the app’s DELEGATE WINDOW views for 1 VIEW CTL 1 VIEW CTL 2 views for 2 BRING YOUR OWN DONE! DONE! DONE! BRING YOUR OWN BRING YOUR OWN DONE! COMBINE ‘EM ALL! COMBINE ‘EM ALL! owns venerdì 19 novembre 2010
  50. 50. A SIMPLE APP · TOOLS DEMO. venerdì 19 novembre 2010
  51. 51. Memory management (IMPORTANT BUT BRIEF) venerdì 19 novembre 2010
  52. 52. Memory management No automatic garbage collection! (unlike Java, C#) Reference counting! If you do it wrong your app will leak or crash or both!!! venerdì 19 novembre 2010
  53. 53. CREATED!1 -retain; 2! -release; 1! -release; 0! DEALLOCATED! - venerdì 19 novembre 2010
  54. 54. NSArray* a = [[NSArray alloc] init]; // you own it [a retain]; // you own it x2 [a release]; // you own it [a release]; // gone! venerdì 19 novembre 2010
  55. 55. NSArray* a = [NSArray array]; // what do I have to do here?!? // the answer: NOTHING! no release, no retain, // unless you need it PAST this function’s return. venerdì 19 novembre 2010
  56. 56. CREATED!1 -autorelease; 1 AUTORELEASE POOL LATER!(release) 0! DEALLOCATED! venerdì 19 novembre 2010
  57. 57. THE RULES (1): every use of: •alloc/init •retain •copy… •new… must be balanced by a call to either of: •release •autorelease AND NOTHING ELSE. venerdì 19 novembre 2010
  58. 58. THE RULES (2): if you want to keep an object you don’t own past the end of the current function, you need to call -retain on it (and -release or -autorelease when done with it). venerdì 19 novembre 2010
  59. 59. Goodies you get on iOS + App Store. venerdì 19 novembre 2010
  60. 60. BONJOUR NETWORK AUTODISCOVERY venerdì 19 novembre 2010
  61. 61. GAME CENTER BLUETOOTH + WIFI + ’NET · LEADERBOARDS · ACHIEVEMENTS · INVITES · MATCHMAKING · VOIP venerdì 19 novembre 2010
  62. 62. IAD INTEGRATED ADVERTISING PLATFORM · NO EXTRA BUREAUCRACY venerdì 19 novembre 2010
  63. 63. IN-APP PURCHASE PAYMENT PROCESSING FOR IN-APP FEATURES & CONTENT · NO EXTRA BUREAUCRACY venerdì 19 novembre 2010
  64. 64. COUNTRIES SUPPORTED BY APP STORE WOW. 90! venerdì 19 novembre 2010
  65. 65. LOCALIZATION + TOP-TIER UNICODE SUPPORT BUILT-IN TO THE CORE OF THE PLATFORM. venerdì 19 novembre 2010
  66. 66. GOOGLE MAPS & GEOLOCALIZATION NO NEED TO PAY GOOGLE’S APPLICATION €€€ venerdì 19 novembre 2010
  67. 67. AUDIO AND VIDEO PLAYBACK + ENCODING ON A MOBILE DEVICE! · H.264 + AAC + MP3 + UNCOMPRESSED FORMATS venerdì 19 novembre 2010
  68. 68. CORE DATA OBJECT DATABASE · TONS OF FEATURES · OPTIMIZED FOR MOBILE · > 1MLN OBJECT STORES venerdì 19 novembre 2010
  69. 69. CORE ANIMATION UNDERLIES EVERYTHING ONSCREEN · TWEENING · 3D · HIGH-PERFORMANCE · MADE FOR UIS venerdì 19 novembre 2010
  70. 70. SECURITY ONBOARD AES ACCELERATION · ENCRYPTED STORAGE · API FOR APP USE · REMOTE MANAGEMENT venerdì 19 novembre 2010
  71. 71. App Store venerdì 19 novembre 2010
  72. 72. venerdì 19 novembre 2010
  73. 73. venerdì 19 novembre 2010
  74. 74. WHAT IT IS: • The only way you can get apps on your iPhone (except development) • Hosting • Payment processing • Sales! venerdì 19 novembre 2010
  75. 75. TO PUBLISH YOU NEED: • Mac + dev tools + test devices • Developer program account (79€/year) • Lots of patience • VAT # + good accountant (Italy) • A business plan! venerdì 19 novembre 2010
  76. 76. YOU CAN PUBLISH: • Most stuff. venerdì 19 novembre 2010
  77. 77. YOU CAN’T PUBLISH: • Porn • Stuff that misleads • Stuff that uses Apple trademarks unfairly • Stuff that breaks privacy laws • Stuff whose behavior changes after review • Interpreters (!) (*) • Betas & Demos venerdì 19 novembre 2010
  78. 78. BORDERLINE: • Satire • Crashers • “Lite” • Big downloaders • More apply depending on APIs https://developer.apple.com/appstore/resources/ approval/guidelines.html venerdì 19 novembre 2010
  79. 79. YOU SET THE PRICE: • $0.99 to $999.99 (and international equivalents) • Most apps in the $0.99- $4.99 range • You get 70% • Apple gets 30% (and VAT/taxes if applicable) venerdì 19 novembre 2010
  80. 80. IT’S A GAMBLE. venerdì 19 novembre 2010
  81. 81. iPAD! venerdì 19 novembre 2010
  82. 82. TEST DEVICE DATE PURPOSE NOVEMBER 17TH VARIES IPAD THE NEW HOTNESS venerdì 19 novembre 2010
  83. 83. The iPad is another kind of animal altogether. venerdì 19 novembre 2010
  84. 84. iPhone Take it out, use it, back in the pocket. Small screen means one thing at a time Mostly used for its connectivity iPad Take it out, use it for a longer period of time. Larger screen means more stuff/more details. Mostly used for media consumption and productivity MORE THAN A PHONE NOT ENTIRELY UNLIKE A LAPTOP venerdì 19 novembre 2010
  85. 85. Laptop Traditional mouse/ keyboard paradigm. Chrome around your media Usually portable Good text entry iPad Multitouch, like on iPhone (and better!) Just the media Highly portable Decent text entry OLD AND BUSTED A DIFFERENT THING, CLEARLY venerdì 19 novembre 2010
  86. 86. The iPad is the iPhone, all grown up to be an actual computer. venerdì 19 novembre 2010
  87. 87. There’s more space. USE IT. venerdì 19 novembre 2010
  88. 88. venerdì 19 novembre 2010
  89. 89. → venerdì 19 novembre 2010
  90. 90. venerdì 19 novembre 2010
  91. 91. venerdì 19 novembre 2010
  92. 92. venerdì 19 novembre 2010
  93. 93. → venerdì 19 novembre 2010
  94. 94. venerdì 19 novembre 2010
  95. 95. venerdì 19 novembre 2010
  96. 96. venerdì 19 novembre 2010
  97. 97. venerdì 19 novembre 2010
  98. 98. venerdì 19 novembre 2010
  99. 99. HTTP://WWW.APPLE.COM/IPAD/GUIDED-TOURS/#IBOOKS venerdì 19 novembre 2010
  100. 100. HTTP://WWW.APPLE.COM/IPAD/GUIDED-TOURS/#PAGES venerdì 19 novembre 2010
  101. 101. HTTP://WWW.YOUTUBE.COM/WATCH?V=GEW68QJ5KXW venerdì 19 novembre 2010
  102. 102. We don’t know what the iPad is… venerdì 19 novembre 2010
  103. 103. … because it’s a new kind of computer. venerdì 19 novembre 2010
  104. 104. PLAYING MAKE-BELIEVE EXCEPT IT WORKS FOR REAL venerdì 19 novembre 2010
  105. 105. THE FUTURE OH MY GOD THE FUTURE venerdì 19 novembre 2010
  106. 106. YEAH WE’RE DONE! Questions? venerdì 19 novembre 2010
  1. A particular slide catching your eye?

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

×