Upgrade to Pro — share decks privately, control downloads, hide ads and more …

既存アプリをXcode8対応させた話

Kohei Tabata
September 22, 2016

 既存アプリをXcode8対応させた話

Kohei Tabata

September 22, 2016
Tweet

More Decks by Kohei Tabata

Other Decks in Programming

Transcript

  1. طଘΞϓϦΛXcode8
    ରԠͤͨ͞࿩
    2016/09/22
    SwiftѪ޷ձ@G's ACADEMY

    View full-size slide

  2. ࣗݾ঺հ
    ɾKohei Tabata(@nerd0geek1)
    ɾSaib Studio LLC
    ɾiOS/MacOS/tvOS Developer
    ɾFastlaneେ޷͖
    ɾSwiftѪ޷ձେ޷͖
    Said Studio LLC Kohei Tabata
    Next! Remote quick-zip plus Sleeple

    View full-size slide

  3. http://next.saib-stud.io

    View full-size slide

  4. Xcode8ग़·ͨ͠Ͷ

    View full-size slide

  5. ରԠऴΘΓ·ͨ͠ʁ

    View full-size slide

  6. Xcode8ରԠͯ͠ΈͨͷͰ
    ஌ݟΛڞ༗͠·͢ɻ

    View full-size slide

  7. ୊ࡐ
    ɾNext! Remote(iOSΞϓϦ)ɺNext! for Mac(MacΞϓϦ)
    ɾCocoaPodsɺCarthageΛར༻ͨ͠ϑϧSwiftΞϓϦ
    ɾ51ϑΝΠϧɺ2400ߦ(Next! RemoteɺclocͰܭଌ)
    ɾ21ϑΝΠϧɺ1200ߦ(Next! for MacɺclocͰܭଌ)
    ͱ͍ͬͨൺֱతখن໛ͳΞϓϦ

    View full-size slide

  8. ໨࣍
    ɾSwift3΁ͷҠߦʹ௅ઓ
    ɾSwift2.3΁ͷҠߦʹ௅ઓ
    ɾͦͷଞ

    View full-size slide

  9. Swift3΁ͷҠߦʹ௅ઓ

    View full-size slide

  10. μϝͰͨ͠
    ɾSwift3Ҡߦ͢ΔͨΊʹ͸ɺϥΠϒϥϦ౳͕શͯSwift3Ҡߦ͍ͯ͠Δ
    ɹඞཁ͋Γ
    ɾར༻͍ͯ͠ΔେखOSSͷ͏ͪɺQuick, Nimble͸ରԠࡁɻ
    ɹSnapKit͕ະରԠɻ
    ɾcarthage update —platform iOSͰίέͯ͠·͏ɻ
    ɾͱ͍͏Θ͚Ͱૣʑʹఫୀɻ

    View full-size slide

  11. Swift2.3΁ͷҠߦʹ௅ઓ

    View full-size slide

  12. େ͖ͳࠔ೉΋ͳ͘׬ྃ
    ɾCoreBluetooth.frameworkͰͪΐͬͱͭ·ͮ͘
    ɹiOS9 ɿCBCentralManagerState
    ɹiOS10ɿCBManagerState
    ɹˢޓ׵ੑͳ͠
    ɾͦΕҎ֎͸ɺ
    override func touchesCancelled(touches: Set?, withEvent event: UIEvent?)
    ͱ
    override func touchesCancelled(touches: Set, withEvent event: UIEvent?)
    ͘Β͍

    View full-size slide

  13. ऴΘΓͩͱࢥͬͨʁ

    View full-size slide

  14. ࣗݾ঺հ
    ɾKohei Tabata(@nerd0geek1)
    ɾSaib Studio LLC
    ɾiOS/MacOS/tvOS Developer
    ɾFastlaneେ޷͖
    ɾAKIBA.swiftେ޷͖
    Said Studio LLC Kohei Tabata
    Next! Remote quick-zip plus Sleeple

    View full-size slide

  15. ͓෼͔Γ௖͚ͨͩΖ͏͔…

    View full-size slide

  16. Ͳ͏࢖͍͔ͬͯͨʁ
    CircleCI্Ͱ
    ɾcocoapods/carthage ActionͰϥΠϒϥϦΛηοτΞοϓͯ͠
    ɾscanͰςετ
    ɾsighͰ࠷৽ͷProvisioning Profileμ΢ϯϩʔυͯ͠
    ɾgymͰipaϑΝΠϧΛ࡞੒
    ɾcrashlytics/pilotͰcrashlytics/iTunes Connect΁Ξοϓϩʔυ

    View full-size slide

  17. Xcode8ʹ͢Δͱ
    CircleCI্Ͱ
    ɾcocoapods/carthage ActionͰϥΠϒϥϦΛηοτΞοϓͯ͠
    ɾscanͰςετ
    ɾsighͰ࠷৽ͷProvisioning Profileμ΢ϯϩʔυͯ͠
    ɾgymͰipaϑΝΠϧΛ࡞੒
    ɾcrashlytics/pilotͰcrashlytics/iTunes Connect΁Ξοϓϩʔυ

    View full-size slide

  18. Xcode8ʹ͢Δͱ
    CircleCI্Ͱ
    ɾcocoapods/carthage ActionͰϥΠϒϥϦΛηοτΞοϓͯ͠
    ɾscanͰςετ
    ɾsighͰ࠷৽ͷProvisioning Profileμ΢ϯϩʔυͯ͠
    ɾgymͰipaϑΝΠϧΛ࡞੒
    ɾcrashlytics/pilotͰcrashlytics/iTunes Connect΁Ξοϓϩʔυ

    View full-size slide

  19. Xcode8ʹ͢Δͱ
    CircleCI্Ͱ
    ɾcocoapods/carthage ActionͰϥΠϒϥϦΛηοτΞοϓͯ͠
    ɾscanͰςετ
    ɾsighͰ࠷৽ͷProvisioning Profileμ΢ϯϩʔυͯ͠
    ɾgymͰipaϑΝΠϧΛ࡞੒
    ɾcrashlytics/pilotͰcrashlytics/iTunes Connect΁Ξοϓϩʔυ

    View full-size slide

  20. Xcode8ʹ͢Δͱ
    CircleCI্Ͱ
    ɾcocoapods/carthage ActionͰϥΠϒϥϦΛηοτΞοϓͯ͠
    ɾscanͰςετ
    ɾsighͰ࠷৽ͷProvisioning Profileμ΢ϯϩʔυͯ͠
    ɾgymͰipaϑΝΠϧΛ࡞੒
    ɾcrashlytics/pilotͰcrashlytics/iTunes Connect΁Ξοϓϩʔυ
    ΄΅ࢮ๢ʘ(^o^)ʗśƂŦ

    View full-size slide

  21. Carthage࢖͑ͳ͍໰୊
    ɾXcode8Ͱ͸ɺToolchainsʹSwift2.3༻ͱSwift3༻ͷ΋ͷ͕
    ɹؚ·Ε͍ͯΔ
    ɹ$ ls /Applications/Xcode.app/Contents/Developer/Toolchains/
    ɹSwift_2.3.xctoolchain XcodeDefault.xctoolchain
    ɾσϑΥϧτ͸Swift3ͷToolchain
    ɾexport TOOLCHAINS=com.apple.dt.toolchain.Swift_2_3
    ɹͰSwift2.3Λར༻͢ΔΑ͏ʹઃఆ

    View full-size slide

  22. scanίέΔ໰୊
    ɾXcode7·Ͱ͸destinationͰࢦఆ͍ͯͨ͠஋(OSɺ୺຤)ͰςετΛ
    ɹ࣮ߦ͢ΔΑ͏ʹͳ͍͕ͬͯͨɺXcode8͔Βແࢹ͞ΕΔΑ͏ʹɻ
    ɾ·ͨɺCircleCI্Ͱ͸derived_data_path͕௨ৗͷ
    ɹ~/Library/Developer/Xcode/DerivedData/Ͱ͸ͳ͘ɺ”/”ͱͳΓɺ
    ɹpermissionͷ໰୊Ͱςετ͕ίέΔΑ͏ʹɻ
    ɹˠద౰ͳ஋ΛSCAN_DERIVED_DATA_PATHʹઃఆͯ͠ରԠ

    View full-size slide

  23. gymίέΔ໰୊
    ɾࠓ·Ͱ͸bundle install -j4 --path=vendor/bundleͰΠϯετʔϧ͠ɺ
    ɹbundle exec fast lane …Ͱ࣮ߦ͍ͯ͠Ε͹໰୊ͳ͔͕ͬͨɺ࠷৽൛
    ɹ(1.102.0 or 1.103.0)Ͱ͸Ұ෦ɺγεςϜඪ४rubyͷgem͕ࢀর͞ΕΔ
    ɹΑ͏ʹɻɻɻ(͓ͦΒ͘όά)
    ɹ
    ɾͦͷͨΊɺCircleCI্Ͱsudo gem install fastlaneͱͯ͠ରԠɻ
    ɹॺ໊͸ɺXcode8͔Βͷࣗಈબ୒Ͱ͸͏·͘ಈ͔ͳ͔ͬͨͨΊݸผʹઃఆ
    ɾଞʹ΋ੜ੒͞ΕΔipa/dSYMϑΝΠϧͷϕʔεωʔϜ͕มߋʹɻ
    ɹNext! Remote.ipa→App.ipa

    View full-size slide

  24. pilotίέΔ໰୊
    ɾͲͪΒ͔ͱݴ͑͹ɺfastlaneΑΓiTunes Connectͷมߋɻ
    ɾpush௨஌ʹ͍ͭͯɺentitlements͕ͳͯ͘΋௨͍ͬͯͨ΋ͷ͕
    ɹඞਢʹɻ
    ɾBluetoothΛ࢖༻͍ͯͨͨ͠Ίɺ
    ɹNSBluetoothPeripheralUsageDescriptionΛInfo.plistʹؚΊΔ
    ɹ͜ͱ͕ඞਢʹɻ

    View full-size slide

  25. ·ͱΊ
    ɾXcode8 x Swift2.3͸ͦΜͳʹେม͡Όͳ͍
    ɾXcode8 x Swift3.x͸ΤίγεςϜͷߋ৽଴ͪɻ
    ɾXcodeपลͷࣗಈԽؔ܎͸ɺ·ͩͪΐͬͱෆ҆ఆ
    ɹ஍ཕ͸͋Β͔ͨ౿Έൈ͍ͨʂ(ന໨

    View full-size slide

  26. ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ

    View full-size slide

  27. ࢀߟ
    ɾίϚϯυϥΠϯπʔϧͰ͋ΒΏΔݴޠ͕࢖ΘΕ͍ͯͯ΋ߦ਺Λଌఆ͢Δ
    ɹ(http://qiita.com/GeneralD/items/c4351f42d0a441373033)
    ɾfastlane/fastlane
    ɹ(https://github.com/fastlane/fastlane)
    ɾBuilding dependencies with Swift 2.3 rather than Swift 3 when using Xcode 8 Beta
    ɹ(https://github.com/Carthage/Carthage/issues/1351#issuecomment-226637835)

    View full-size slide