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.

第一次程式親密接觸

1,022 views

Published on

本課程將以淺顯易懂的 Swift 語言介紹程式設計的基本概念,讓你第一次就愛上程式設計 !

Published in: Mobile
  • Hey guys! Who wants to chat with me? More photos with me here 👉 http://www.bit.ly/katekoxx
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

第一次程式親密接觸

  1. 1. 彼得潘
  2. 2. https://www.youtube.com/watch?v=zLyhg-CZxiw
  3. 3. 如果我會作詞作曲,我就能成為創作歌手。 我有一絲音感嗎?沒有。 所以,很可惜,我只能當歌手的朋友。 如果我有打不死的小宇宙,我就能成為桌球國手。 我有燃燒小宇宙般地練球嗎?沒有。 所以,很遺憾,我只能打系隊。 如果給我一天一個App的負荷,也澆不熄我對蘋果的熱 情。 一天能夠完成一個App嗎? 可以。 所以,是的,我是愛瘋一切為蘋果的彼得潘。
  4. 4. 彼得潘 : : App App
  5. 5. Steve Jobs https://www.youtube.com/watch?v=bQk7rdcl22o
  6. 6. App :iPhone.iPad Swift
  7. 7. http://www.facebook.com/iphone.peterpan http://deeploveapple.blogspot.tw apppeterpan@gmail.com FB blog email medium https://medium.com/@apppeterpan http://strikingly.us12.list-manage.com/subscribe?u=afa877b4a57124636b33826b0&id=4dd6b92dbb http://apppeterpan.strikingly.com
  8. 8. ? ? Cocoa
  9. 9. ? : 100 0 

  10. 10. ex 4 1. 2. 3. 4. ex 1. 2. 3.
  11. 11. CPU
  12. 12. 0 & 1 0 & 1 0 & 1
  13. 13. bit & byte bit 8 bit byte 32-bit CPU & 64-bit CPU
  14. 14. 10110000 ? 71 ?
  15. 15. 302 302/2 = 151 0 151/2 = 75 1 75/2 = 37 1 37/2 = 18 1 18/2 = 9 0 9/2 = 4 1 4/2 = 2 0 2/2 = 1 0 1 100101110
  16. 16. 10: a 11:b 12:c 13:d 14:e 15:f c0de: 49374: : 1100 0000 1101 1110 32-bit : f f f f f f f f 8-bit : f f 11111111 2 8 -1
  17. 17. unicode 0 1 http://unicode-table.com
  18. 18. Swift https://blog.alphacamp.co/2015/07/27/for-swift-beginners/
  19. 19. Swift • & • ( javascript ) • App crash bug • 
 ( Objective-C ) • Playground • Swift ( )
  20. 20. Swift • • Open Source • • iOS SDK
 ( SDK: App ) • Objective-C • iOS 7
  21. 21. playground
  22. 22. Swift
  23. 23. • Mac ( ! ) • PC Mac ( ) • PC IBM Swift Sandbox 
 Swift iOS App
 http://swiftlang.ng.bluemix.net 
 CPU
  24. 24. Macbook Air / Pro : App
  25. 25. Mac Mini : 15,900
  26. 26. iMac & Mac Pro iMac: App Mac Pro:
  27. 27. Mac Xcode App StoreFree Apple ID https://itunes.apple.com/app/xcode/id497799835
  28. 28. Xcode playground Swift
  29. 29. playground
  30. 30. playground
  31. 31. 1 2 9
  32. 32. " "
  33. 33. Emoji & Symbols
  34. 34. :
  35. 35. playground
  36. 36. var age
  37. 37. Unicode : function struct enum !
  38. 38. var if for while … reserved word
  39. 39. (constant) 18 let
  40. 40. variable & constant • constant ? • constant : • •
  41. 41. type (Type Inference) Int String Double
  42. 42. Christie http://www.ylib.com/hotsale/mystery_paperback/
  43. 43. ! age Int !
  44. 44. Debug Area
  45. 45. : Int String Double
  46. 46. Swift type
  47. 47. :
  48. 48. !
  49. 49. 3 3
  50. 50. string interpolation ( )
  51. 51. string interpolation ( ) https://www.facebook.com/pages/ /205687452779322
  52. 52. string interpolation ( ) ( )
  53. 53. https://www.youtube.com/watch?v=L-YMr0cTH6s
  54. 54. xxx xxx xxx ... (1) : (2) :
  55. 55. • • • : • : https://www.youtube.com/watch?v=wCREDfUEd3Y
  56. 56. if else switch while for https://www.youtube.com/watch?v=qA-TNQXcWiI
  57. 57. (if else) https://www.youtube.com/watch?v=nFPIpTZJ1g8 https://www.youtube.com/watch?v=iOtETdw19GA
  58. 58. https://www.youtube.com/watch?v=Sy1TcpGsQcE
  59. 59. Bool ( true / false)
  60. 60. < <= > >= == !=
  61. 61. else
  62. 62. nested if if
  63. 63. nested if if
  64. 64. else if
  65. 65. &&:
  66. 66. ||: https://www.youtube.com/watch?v=_o0oeyCtoFA
  67. 67. !: var isRain = true if !isRain { }
  68. 68. Ternary Operator ? : var age = 20 var message = age > 18 ? "可以談戀愛":"認真讀書" https://www.youtube.com/watch?v=fdSQ-R1drtg
  69. 69. var age = 35 var weight = 45 var height = 160 if age < 30 || weight < 50 && height < 170 { var message = " ( )" } else { var message = " " } :
  70. 70. var age = 35 var weight = 45 var height = 160 if age < 30 || (weight < 50 && height < 170) { var message = " ( )" } else { var message = " " }
  71. 71. https://www.youtube.com/watch?v=NXhBcA_oZyY
  72. 72. message { } message
  73. 73. if else else if && || penny http://mojim.com/twy105574x1x1.htm
  74. 74. if switch - https://www.youtube.com/watch?v=M79Iq6c-b38
  75. 75. switch if else
  76. 76. switch if else
  77. 77. switch • case case
  78. 78. switch • break case break
  79. 79. switch • case fallthrough ex: 60 80 “ ”
  80. 80. switch • case
  81. 81. switch •
  82. 82. case let: value binding var age = 10 switch age { case let ageNumber where ageNumber >= 18: var message = "(ageNumber) 成年" default: var message = "未成年" } var age = 10 switch age { case 100: var message = "(age)" case let otherAge: var message = "(otherAge)" } where case var ok
  83. 83. • ” ” ” ” ” ” ” ” • ” ” ” ” ” ” ” ” ” ” • case let where 
 50 ” ”
 40 ” ”
 ” ”
  84. 84. https://www.youtube.com/watch?v=owk52BjC77U
  85. 85. 1+2+3 1000 1000 ? ! : https://www.youtube.com/watch?v=uIWypArI73w
  86. 86. for
  87. 87. for i = 1, i<= 1000 i = 2, i<= 1000 i = 1000, i<= 1000 sum = sum + 1000 sum = sum + 1 sum = sum + 2 i = 1001, i<= 1000
  88. 88. Graph https://www.youtube.com/watch?v=3a_oa9CnVjs
  89. 89. Value History Latest Value
  90. 90. 佛曰:「受身無間者永遠不死,壽長乃無間地獄中之⼤劫。」 https://www.youtube.com/watch?v=VHJhwaqEJIs
  91. 91. infinite loop Apple
  92. 92. App var sum = 0 for var i=0;i<=1000;i=i*10 { sum = sum + i } https://www.youtube.com/watch?v=b5ANmLU9XL8
  93. 93. range
  94. 94. switch range var grade = 30 switch grade { case 30: var message = "(grade)" case 20...50: var message = "(grade)" default: var message = "(grade)" }
  95. 95. for in range
  96. 96. for in & where
  97. 97. while repeat while: loop
  98. 98. • 1 2 99 • : for • : for in • 2 4 100 for & while ( )
  99. 99. for in & where
  100. 100. loop break continue break: loop continue: iteration var sum = 0 for var i=0;i<10;i++ { if i == 5 { continue } else if i == 6 { break } sum = sum + i }
  101. 101. :
  102. 102. : >=
  103. 103. function
  104. 104. function func ( ) { }+ + + function { } function + ( )
  105. 105. function
  106. 106. function
  107. 107. function :+ + func addToNumber(number:Int){ var sum = 0 for var i=1;i<number;i++ { sum = sum + i } } addToNumber(100)
  108. 108. function func addToNumber(startNumber:Int, endNumber:Int){ var sum = 0 for var i=startNumber;i<=endNumber;i++ { sum = sum + i } } addToNumber(10, endNumber: 100)
  109. 109. function
  110. 110. function external name & internal name internal name: function external name: function external name ( )
  111. 111. 700cc ? function func eatFood(food:String, price:Int) { } eatFood("chocolate", price:300)
  112. 112. function
  113. 113. function
  114. 114. Swift Standard Library Function function
  115. 115. print https://www.youtube.com/watch?v=_sQSXwdtxlY
  116. 116. function 3 : 10, 20 3 10 + 13 + 16 + 19 = 58
  117. 117. function 3 number 3 98 number 5 ( 5 ) 5 + 10 + 15 + ..... + 95
  118. 118. function 3 number 3 11 number 5 ( 5 ) 3 + 4 + 6 + 7 + 8 + 9 + 11
  119. 119. : function 2
  120. 120. : >= function 2
  121. 121. https://www.facebook.com/miniHanaPreschool/
  122. 122. : class
  123. 123. .+ +
  124. 124. .+ + =+ +
  125. 125. n ( )
  126. 126. (method) function { }
  127. 127. ( ) ( .+ + )+ + +
  128. 128. ( ): ( ):
  129. 129. • • method 
 App • 
 • iOS SDK 
 
 
 App
  130. 130. function function
  131. 131. array 100 100
  132. 132. array [ ] , 0
  133. 133. !Array index out of range
  134. 134. array https://www.youtube.com/watch?v=ZSWeurc1yMw
  135. 135. array append: insert: array struct struct
  136. 136. array
  137. 137. array
  138. 138. array for
  139. 139. array for
  140. 140. array for in
  141. 141. 2 5 array 1. for in 2. array 
 ( array )
  142. 142. for in class Student { var grade = 60 var name = "peter" } var student1 = Student() var student2 = Student() student2.grade = 80 student2.name = "Jack" var student3 = Student() student3.grade = 90 student3.name = "penny" var students = [student1, student2, student3] var maxGrade = 0 var maxName = "" var sum = 0 for student in students { sum = sum + student.grade if student.grade > maxGrade { maxGrade = student.grade maxName = student.name } } maxGrade maxName var average = sum/students.count
  143. 143. array
  144. 144. dictionary array
  145. 145. dictionary nil : key ( ) value (
  146. 146. dictionary
  147. 147. App
  148. 148. App • , Model • : , • • • • • • https://www.youtube.com/watch?v=xr5JQdcqWyM
  149. 149. http://apppeterpan.strikingly.com
  150. 150. App • free vs. 0.99
 
 100 • in-app purchase • • 
 • • App App: 3 PTT App: https://www.youtube.com/watch?v=_iC8jnx32ho
  151. 151. • 
 App , , PM, Server , • 
 App + • 
 App + App + • 
 ios/Android(Windows) PHP/RoR/Python/ASP/Node.js HTML / CSS/ JavaScript photoshop/ illustrator/ sketch
  152. 152. Wealthy !
  153. 153. App mini.Hana Penny V.K https://www.youtube.com/watch?v=snRaHXpS3uI
  154. 154. iOS App : iOS App : 8 App iOS App : Collection View iOS App : iOS 9 Stack View iOS App : Facebook iOS App : iOS App : App
  155. 155. Auto Layout & Adaptive Layout 2016/2/20( ) App 2016/3/6( ) Apple Watch 2016/3/27( ) Apple TV 2016/5/28( )
  156. 156. IOS APP 42 iOS App ( 2 iOS App 42 ( 1 iOS App 42 ( 1 iOS App 35 ( iOS App 35 (
  157. 157. https://www.facebook.com/iphone.peterpan/

×