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

The front-line of iOS app development at Hatena

The front-line of iOS app development at Hatena

Presented at “【DeployGate x はてな】スマートフォンアプリ開発最前線”, 13 April 2015.

58b40ae3b0db6cf0202a3802e9dd70fe?s=128

cockscomb

April 14, 2015
Tweet

Transcript

  1. ͸ͯͳʹ͓͚ΔiOSΞϓϦ։ൃ࠷લઢ MicroframeworksΞʔΩςΫνϟͱςετࣗಈԽʹΑΔݎ࿚ͳΞϓϦ։ൃ

  2. cockscomb

  3. cockscomb • גࣜձࣾ͸ͯͳɺΞϓϦέʔγϣϯΤϯδχΞ • iOS/Android/αʔόʔαΠυ •  WATCH SPORT
 42mm

    Space Gray Aluminum Case with Black Sport Band
  4. ͸ͯͳʹ͓͚ΔiOSΞϓϦ։ൃ࠷લઢ MicroframeworksΞʔΩςΫνϟͱςετࣗಈԽʹΑΔݎ࿚ͳΞϓϦ։ൃ

  5. ࠷લઢ • Swift • Microframeworks • Automation

  6. Swift

  7. Swift • ܕ҆શ • ߴ଎ (?) • Ϟμϯͳݴޠػೳ

  8. ͸ͯͳʹ͓͚ΔSwift • ৽͍͠ίʔυ͸શͯSwift • ։ൃதͷΞϓϦ͸Swift͚ͩͰॻ͔Ε͍ͯΔ • ࣾ಺ϥΠϒϥϦ΋΄ͱΜͲSwiftʹҠߦ

  9. Swift͍͍ͱ͜Ζ • දݱྗ͕๛͔ • ܕ, δΣωϦΫε, Ϋϩʔδϟ, ߴ֊ؔ਺ • ؆ܿ

    • ܕਪ࿦, Ϋϩʔδϟ • SwiftͷݴޠػೳΛ׆͔ͤΔઃܭ͕ඞཁ
  10. SwiftΛ׆͔͢ • ܕΛ׆༻͢Δ • ܕύϥϝʔλͳͲͰ৘ใΛ૿΍͢ • Enum͕࢖͍΍͍͢ • Objective-Cͷಈతͳಛੑʹґଘ͠ͳ͍

  11. SwiftࠔΓϙΠϯτ • πʔϧνΣʔϯ͕௥͍͍͍ͭͯͳ͍ • Xcode, AppCode • ίϯύΠϧ͕গ͠஗͍ • Swiftͷਐาʹ௥͍͚ͭͳ͍

    • Circle CI
  12. Swiftͷকདྷ΁ͷظ଴ • Swift 1.2 • Swiftʹ߹ΘͤͨFoundationͷ֦ு • πʔϧνΣʔϯͷਐา

  13. Microframeworks

  14. –James Lewis and Martin Fowler, Microservices “In short, the microservice

    architectural style is an approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API.”
  15. View View Controller Model Foundation UIKit

  16. Frameworks

  17. Frameworks ໊લۭؒΛ࣋ͭ ΞΫηε؅ཧͷ୯Ґ ݸผʹίϯύΠϧ͞ΕΔ όϯυϧ͕෼཭͍ͯ͠Δ

  18. Authenticator.framework APIClient.framework AwesomeKit.framework AFNetworking.framework AwesomeApp AwesomeApp.bundle AwesomeToday.appex …

  19. Developing frameworks • ୯ମςετͰಈ࡞Λ֬ೝ • CIαʔόʔͷςετͰಈ࡞Λอূ (Jenkins) • ґଘΛ؅ཧ •

    CocoaPods (>= 0.36) • Carthage
  20. Pros • ϑϨʔϜϫʔΫͷશͯͷϝϦοτ • ݎ͍ެ։ΠϯλʔϑΣʔε • υϝΠϯຖͷ໌ࣔతͳ෼཭ • ։ൃʹςετ͕ඞཁ •

    ՄೳͳݶΓϓϥοτϑΥʔϜʹඇґଘ
  21. Cons • ϞϊϦγοΫͳํ͕ॊೈ • iOS 7ΛαϙʔτͰ͖ͳ͍

  22. Automation

  23. OS X Server

  24. Jenkins

  25. What’s been automated? • ୯ମςετͷ࣮ߦ • ϕʔλ൛ͷϏϧυͱ഑෍ • ਃ੥༻όΠφϦͷϏϧυ •

    εΫϦʔϯγϣοτͷऔಘ
  26. Why automated? • ࠶ݱੑͷ୲อ • ͍ͭͰ΋ςετ͕௨ΓϏϧυͰ͖Δ͜ͱΛอূ • ଵ͚͍ͨ • ख࡞ۀͰ͕Μ͹ΔͱർΕΔ

    • 3.5/4.0/4.7/5.5/9.7 inchͷσΟεϓϨΠͰ
 5छྨͣͭͷεΫϦʔϯγϣοτࡱΔͷ͸ർΕΔ
  27. XCJobs require 'XCJobs'
 
 XCJobs::Test.new do |t|
 t.workspace = 'HatenaBlog'


    t.scheme = 'HatenaBlogTests'
 t.configuration = 'Debug'
 t.add_destination('name=iPhone 6,OS=8.2')
 t.formatter = 'xcpretty -c -r junit'
 end

  28. XCJobs #!/bin/sh -e
 
 bundle install --path vendor/bundle
 bundle exec

    pod install
 bundle exec rake build:archive
 
 bundle exec rake build:export
 bundle exec rake distribute:deploygate
  29. snapshot • snapshot gemΛ࢖͏ • UIAutomationͷ࢓૊ΈΛ࢖͍ͬͯΔ

  30. snapshot devices([
 "iPhone 6",
 "iPhone 6 Plus",
 "iPhone 5",
 "iPhone

    4s",
 "iPad Air",
 ])
 languages([ 'ja' ])
 
 screenshots_path "./screenshots"
 js_file './snapshot/snapshot.js'
 scheme 'HatenaBlog'
 project_path './HatenaBlog.xcworkspace'
  31. snapshot #import "SnapshotHelper.js"
 var target = UIATarget.localTarget();
 var app =

    target.frontMostApp();
 var window = app.mainWindow();
 target.setDeviceOrientation(
 UIA_DEVICE_ORIENTATION_PORTRAIT);
 
 target.delay(1)
 captureLocalizedScreenshot("1-Dashboard")
 
 window.tableViews()[0].cells()[0].tap();
 target.delay(1)
 captureLocalizedScreenshot("2-EntryBrowser")
  32. ࠷લઢ • Swift • Microframeworks • Automation

  33. ͸ͯͳʹ͓͚ΔiOSΞϓϦ։ൃ࠷લઢ MicroframeworksΞʔΩςΫνϟͱςετࣗಈԽʹΑΔݎ࿚ͳΞϓϦ։ൃ