iOS13 SDK による 全機能置き換え

0fb0b8c6eecbc8e0a3981501f6a6fea6?s=47 notoroid
September 28, 2019

iOS13 SDK による 全機能置き換え

Objective-C + Storyboard

0fb0b8c6eecbc8e0a3981501f6a6fea6?s=128

notoroid

September 28, 2019
Tweet

Transcript

  1. J044%,ʹΑΔ શػೳஔ͖׵͑ 1BSU4XJGU6*ฤ

  2. ࣗݾ঺հ

  3. ೳొཁ !OPUPSPJE w J04ΞϓϦ։ൃऀ w ԰߸͍Γ·͢ిࢉاը w !OPUPSPJE w !JSJNBTV

    w Fεϙʔπ
  4. ୊໨ w ϨΨγʔΞϓϦͷ࡮৽ w 4XJGU6*Λಈ͔ͯ͠ΈΔ w ·ͱΊ

  5. ࿩͢ൣғ w 4XJGU6*5VUPSJBMT w IUUQTEFWFMPQFSBQQMFDPNUVUPSJBMTTXJGUVJUVUPSJBMT w $SFBUJOHBOE$PNCJOJOH7JFXT w #VJMEJOH-JTUTBOE/BWJHBUJPO w

    )BOEMJOH6TFS*OQVU w $PNQPTJOH$PNQMFY*OUFSGBDFT w 8PSLJOHXJUI6*$POUSPMT
  6. ࿩͞ͳ͍ൣғ w طଘ6*ͱͷ૊Έ߹Θͤ w Ξχϝʔγϣϯ w 04͝ͱ΁ͷ4XJGU6*ͷద༻

  7. ࣍ճҎ߱Ͱ࿩͢಺༰ w $PNCJOFGSBNFXPSL w ,FZ1BUI 4XJGU  w !EZOBNJD.FNCFS-PPLVQ

  8. IUUQTHJUIVCDPNOPUPSPJE 4XJGU6*#BUUFSZ.POJUPS ࢿྉ

  9. ϨΨγʔΞϓϦͷ࡮৽

  10. J04ϦϦʔε

  11. J04ʹ߹Θͤͯ طଘΞϓϦΛ࡮৽த

  12. None
  13. (MPSJPVT#BUUFSZ άϩϦΞεόοςϦʔ w όοςϦʔϞχλʔ ϢʔςΟϦςΟʔ  w ࠷େ୆ ࣮ػ ϦϞʔτ୆

     w ख࣋ͪͷJ1IPOF͔ΒJ1BEͳͲͷػثͷόο ςϦʔঢ়ଶ֬ೝՄೳ w ࣗ୐ʹ͋ΔJ1IPOFͷόοςϦʔঢ়ଶ֬ೝՄ ೳ
  14. όʔδϣϯ͸ٕज़σϞ w  όοςϦʔ৘ใ ࣮ػɺϦϞʔτ ͷදࣔ w  όοςϦʔঢ়ଶͷૹ৴ w

     ϦϞʔτઌόοςϦʔঢ়ଶͷड৴ w  ট଴23ίʔυͷੜ੒ͱදࣔ w  ট଴23ίʔυͷಡΈऔΓ ϦϞʔτઌͱ઀ଓ  w  ৭ςʔϚͷબ୒ w  όοΫάϥ΢ϯυಈ࡞ όοςϦʔ৘ใͷૹड৴  w  όοςϦʔϩάͷه࿥ w  όοςϦʔϩάʹج͍ͮͨཤྺͷදࣔ w  όοςϦʔ௿Լ࣌ͷ௨஌ػೳ w  ඇফඅܕΞϓϦ಺՝ۚͷ࣮૷ w  ϩʔΧϥΠζػೳ w 'JSFCBTF ݱࡏͷ'JSFCBTF 3FBMUJNF%BUBCBTF ͷٕज़σϞ w $PSF*NBHF 23$PEF  w *O"QQ1VSDIBTF ඇফඅܕΞϓϦ಺՝ۚ  w όοΫάϥ΢ϯυߋ৽ w ϩʔΧϥΠζ
  15. όʔδϣϯ͸ϨΨγʔԽ ෦෼ͷࠩ͠ସ͑ʹ௅ઓ

  16. Կ͕ϨΨγʔԽͨ͠ͷ w ࢖༻ݴޠ0CKFDUJWF$ w ࠷৽ͷ։ൃख๏ͱ͸ԑԕ͘ͳΓ͕ͪ 4XJGU޲͚͕ଟ͍  w J044%,ΑΓ͸Δ͔Ҏલͷ։ൃख๏͕࢒͍ͬͯͨ w

    όοΫάϥ΢ϯυॲཧ ϦϞʔτ௨஌Ҏ֎ͷ#BDL(SPVOE'FUDI  w όοΫΤϯυαʔόʔ 1BSTF4FSWFS
  17. J044%,ͰඞཁͳରԠ w όοΫάϥ΢ϯυಈ࡞ όοςϦʔ৘ใͷૹड৴  w 3FNPUF/PUJpDBUJPO #BDLHSPVOE'FUDI w J04͔Βͷ#BDLHSPVOE'FUDI͸ϦϞʔτ௨஌Ҏ֎EFQSFDBUFE

    w ΞϓϦ಺Πϝʔδͷஔ͖׵͑ w ΞϓϦ಺Ͱࣗ࡞ͨ͠ΠϝʔδϦιʔεΛ4'4ZNCPMTʹஔ͖׵͑
  18. 4'4ZNCPMT

  19. 0CKFDUJWF$͔Β4XJGUมߋʹ ߹Θͤͯ4XJGU6*Λશ໘ద༻

  20. 4XJGU6*શ໘ద༻͢Δͱ ։ൃख๏ͷେస׵ʹͳΔͷͰ ٕज़తͳ୨Է͠ʹͪΐ͏Ͳྑ͍

  21. ΋ͪΖΜউࢉ΋͋Γ㽂

  22. None
  23. ηϧ 4BGF"SFB·Ͱ ృΓͭͿ͠

  24. None
  25. όοςϦʔྔ ୯Ґ ࣌ؒຖάϥϑ ॆిঢ়ଶ ୺຤໊ ԁάϥσʔγϣϯ

  26. ϢʔςΟϦςΟʔΞϓϦ͔ͩΒ4XJGU6*Λద༻Ͱ͖Δ w ϝΠϯը໘ͱઃఆը໘ w ը໘ߏ੒͕গͳ͍ w ϏδϡΞϧΛલ໘ʹԡ͠ग़ͨ͠ϝΠϯը໘ w ஔ͖׵͕͑༻ҙͦ͏ͳ؆ૉͳઃఆը໘ w

    δΣενϟʔʹରԠ͍ͯ͠Δ w 4XJGU6*ͰδΣενϟʔ͸αϙʔτ
  27. ௅ઓͨ݁͠Ռ

  28. όʔδϣϯͷ࣮ݱ

  29. όʔδϣϯػೳͷ࣮ݱࡁ ࢒Γ͸ΞϓϦ಺՝ۚͱɺϩʔΧϥΠζ

  30. 4XJGU6* w 4XJGUϕʔεͷ6*࡞੒ϑϨʔϜϫʔΫ w %4- ༻్ൣᙝݻ༗ݴޠ ͕4XJGUͰهड़Ͱ͖Δ w 4XJGUʹ࢓༷Λ௥Ճͯ͠%4-ʹدͤͯ͠·͏ w

    6*Λߏ੒͢Δجຊఆٛ͸7JFX w 7JFXΛએݴత %FDMBSBUJWF ʹهड़Ͱ͖؆ܿͳهड़͕Մೳ
  31. 4XJGU6* w 4XJGUϕʔεͷ6*࡞੒ϑϨʔϜϫʔΫ w %4- ༻్ൣᙝݻ༗ݴޠ ͕4XJGUͰهड़Ͱ͖Δ w 4XJGUʹ࢓༷Λ௥Ճͯ͠%4-ʹدͤͯ͠·͏ w

    6*Λߏ੒͢Δجຊఆٛ͸7JFX w 7JFXΛએݴత %FDMBSBUJWF ʹهड़Ͱ͖؆ܿͳهड़͕Մೳ Կ
  32. એݴత %FDMBSBUJWF w ͋Δग़ྗΛಘΔʹ͋ͨͬͯͦΕΛ࡞੒͢Δํ๏Ͱ͸ͳ͘ɺग़ྗͷੑ࣭Λه ड़͢Δ͜ͱΛʮએݴܕʯͱশ͢Δ w એݴతϓϩάϥϛϯάͷʮએݴతʯͬͯʁ   w

    IUUQTTIIBUFOBEJBSZPSHFOUSZ w )5.-͸એݴత
  33. import SwiftUI struct ContentView: View { var body: some View

    { Text("Hello World") } } #if DEBUG struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } } #endif 4XJGU6*ͷςϯϓϨʔτίʔυ 7JFX͸CPEZͰͭͷ7JFXΛ೿ੜ ͨ͠એݴΛ౉͢ඞཁ͕͋Δɻ
  34. ૊ΈࠐΈ7JFX೿ੜ 5FYU *NBHF -JOFBS(SBEJFOU 3BEJBM(SBEJFOU 3FDU"OHMF $JSDMF &MMJQTF (FPNFUSZ3FBEFS "OHVMBS(SBEJFOU

    $BQTVMF
  35. ෳ਺ͷ7JFXΛ഑ஔ͢Δ৔߹͸ɺ 4UBDL )4UBDL 74UBDL ;4UBDL

  36. )4UBDL HStack { RectAngle() .foregroundColor(Color.red) RectAngle() .foregroundColor(Color.green) RectAngle() .foregroundColor(Color.blue) }

    ᶃ ᶄ ᶅ هड़ॱʹࠨ͔Βӈʹ഑ஔ ᶃ ᶄ ᶅ
  37. 74UBDL VStack { RectAngle() .foregroundColor(Color.red) RectAngle() .foregroundColor(Color.green) RectAngle() .foregroundColor(Color.blue) }

    ᶃ ᶄ ᶅ هड़ॱʹ্͔ΒԼʹ഑ஔ ᶃ ᶄ ᶅ
  38. ;4UBDL ZStack { RectAngle() .foregroundColor(Color.red) RectAngle() .foregroundColor(Color.green) RectAngle() .foregroundColor(Color.blue) }

    ᶃ ᶄ ᶅ هड़ॱʹԞʹ഑ஔ ᶃ ᶄ ᶅ
  39. 4UBDLͷ഑ஔ͸7JFXଆʹαΠζ ࢦఆ͕ͳ͍ݶΓ͸౳ഒ഑ஔ

  40. ٧ΊࠐΉ৔߹͸ 4QBDFS Λࢦఆ

  41. 7JFXFEHFT*HOPSJOH4BGF"SFB Λ࢖ ͏ͱ4BGF"SFBΛແࢹ͢ΔΑ͏ʹͳΔ

  42. 4UBDL )4UBDL 74UBDL )4UBDL Λ ࢖Θͳͯ͘΋഑ஔͰ͖Δ

  43. 7JFXʹ഑ஔ

  44. 7JFXʹ഑ஔ

  45. CBDLHSPVOE͸CPEZͷDMJQϑΟϧλʔʹ Өڹ͢Δɻ

  46. CBDLHSPVOE͸7JFXDMJQ ͷ ݁Ռ͕൓ө͞ΕΔ

  47. Rectangle() .fill( Color.clear ).background( എܠඳը͢ΔView ) .clipped()

  48. Ϧιʔε w ϑΥϯταΠζ w ౓਺ϑΥϯταΠζP⒎TFU  w ϑΥϯτશମΦϑηοτ w άϥσʔγϣϯΧϥʔ

    w άϥσʔγϣϯΧϥʔ
  49. RadialGradient(gradient: .init(colors: [Self.gradientStart, Self.gradientEnd]), center: .init(x: 0.5, y: 0.5), startRadius:

    50, endRadius: 150) .aspectRatio(contentMode: .fill) static let gradientStart = Color(red: 102.0 / 255, green: 196.0 / 255, blue: 66.0 / 255) static let gradientEnd = Color(red: 87.0 / 255, green: 161.0 / 255, blue: 58.0 / 255) // .previewDevice(PreviewDevice(rawValue: "iPhone 8") ) .previewDevice(PreviewDevice(rawValue: "iPhone X") )
  50. import SwiftUI struct GraphView: View { var body: some View

    { HStack(spacing:0) { ForEach(0 ..< 12) { item in GraphLineView() } Spacer() } } } #if DEBUG struct GraphVioew_Previews: PreviewProvider { static var previews: some View { GraphView() // .previewDevice(PreviewDevice(rawValue: "iPhone 8") ) .previewDevice(PreviewDevice(rawValue: "iPhone X") ) } } #endif struct GraphLineView: View { var body: some View { ZStack { // Rectangle() // .foregroundColor(Color.green) ForEach(0 ..< 12 ) { item in GeometryReader { geometry in Path { path in let verticalOffset = 0.5 + (item == 0 ? 0 : (geometry.size.height * 0.2)) path.move( to: CGPoint( x: 0.5 + CGFloat(item) * 2.5, y: verticalOffset ) ) path.addLine( to: CGPoint( x: 0.5 + CGFloat(item) * 2.5, y: 0.5 + geometry.size.height ) ) } .stroke(Self.strokeColor, lineWidth: 1) } } }.frame(width:29.5, height:20) } static let strokeColor = Color(white: 1, opacity: 0.8) }
  51. 4XJGU6*Λಈ͔ͯ͠ΈΔ

  52. IUUQTHJUIVCDPNOPUPSPJE 4XJGU6*#BUUFSZ.POJUPS ࢿྉ

  53. αϯϓϧ w 4XJGU6*#BUUFSZ.POJUPS4UBSUJOH1PJOU͕։࢝࣌఺ w 4UFQɺ4UFQ͕தؒεςοϓ w 4XJGU6*#BUUFSZ.POJUPS$PNQMFUF͕׬੒

  54. σʔλ࿈ಈͷͨΊͷΩʔϫʔυ w 0CTFSWBCMF0CKFDU!1VCMJTIFE w 4XJGU6*ଆ΁৘ใΛ1VCMJTI͢ΔͨΊͷఆٛηοτ w FOWJSPONFOU0CKFDU !&OWJSPONFOU0CKFDU w 4XJGU6*શମͰ༗ޮͳ؀ڥΦϒδΣΫτͷઃఆ

    w !4UBUF!#JOEJOH
  55. ը໘ߏ੒ͷΩʔϫʔυ w 'PS&BDI w 74UBDL )4UBDL ;4UBDL w -JTU

  56. ·ͱΊ w J04ʹ߹ΘͤͯϨΨγʔͳΞϓϦΛ࡮৽தͰ͢ w J044%,Ͱࣔ͞Εͨ։ൃख๏ʹ߹Θͤ·͢ w 4XJGU6*͸લఏ஌ࣝ࣋ͪ։ൃऀ΋ॳ৺ऀ΋͍͍ͩͨυπϘʹϋϚΓ·͢ w 4XJGU6*Λ࢖͏ͱίϯύΠϥ͕൵໐Λ͋͛·͢