API diffsからiOS10を妄想する

API diffsからiOS10を妄想する

Oasisさんで行われた"iOS Creators' Meetup vol.1" http://oi-study.connpass.com/event/32826/ に参加してきました

D36d6bab8f1e0ff4bb3377571e5f7dcd?s=128

Yutaro Muta

June 30, 2016
Tweet

Transcript

  1. API diffs͔Β iOS10Λໝ૝͢Δ 2016/06/28_iOS Creators' Meetup vol.1 Yutaro (@yutailang0119)

  2. ͓લ୭Αʁ • ໂా ༟ଠ࿠ (@yutailang0119) • iOS App Developer •

    ΞϥΠυΞʔΩςΫπ, Inc.ɺ৽ଔ2೥໨ • iOSྺ10ϲ݄ڧ(Objective-C : Swift = 9 : 1)
  3. ࣾ಺ͰiOSΤϯδχΞ͸গ਺ • جຊWeb (PHP, Java) ͷձࣾ • அยతʹ͔࣍͠ظόʔδϣϯͷΩϟονΞο ϓ͕͞Εͯͳ͍͜ͱ͕ଟ͍

  4. ࣾ಺ͰiOSΤϯδχΞ͸গ਺ • جຊWeb (PHP, Java) ͷձࣾ • அยతʹ͔࣍͠ظόʔδϣϯͷΩϟονΞο ϓ͕͞Εͯͳ͍͜ͱ͕ଟ͍ =>

    ແཧ೉୊Λఏࣔ͞ΕΔ͜ͱ͕ଟ͍…
  5. ʮʓʓΈ͍ͨͳʙʙɺ˚˚Έ͍ͨͳʙʙʯ ؾ͍ͮͨΒࣗ෼Ͱ΋Α͘Θ͔Βͳ͍ίʔυ͕૿͑Δ iOSͷόʔδϣϯΞοϓʹ௥ै͢Δͷ͕ਏ͍ ݱঢ়࢓༷͕ෆ໌ྎ

  6. ΍Γ͍ͨ͜ͱɺͰ͖Δ͜ͱΛ ͖ͪΜͱڞ༗Ͱ͖͍ͯΕ͹ ඪ४APIͰղܾͰ͖͍ͯͨ (͸ͣ)

  7. ʲ໨ඪʳ API DiffsϕʔεͰ iOS10ͰมΘΔ͜ͱɺ Ͱ͖ͦ͏ͳ͜ͱΛ ਖ਼͘͠ཧղ͢Δ (΍Γ͍ͨ͜ͱ΋఻͑Δ)

  8. ؾʹͳͬͨ͜ͱ • Interests, InterestsUI • UserNotifications, UserNotificationsUI • UIKit

  9. 1. Interests, InterestsUI https://developer.apple.com/reference/intents https://developer.apple.com/reference/intentsui

  10. 1. Interests, InterestsUI • SiriͱMapsʹؔΘΔFramework (SiriKit) • Ͱ͖Δ͜ͱ͸ి࿩ֻ͚ͨΓɺϝοηʔδૹͬͨΓ (Intents Domain

    6ͭ) • ಛఆͷޠኮΛొ࿥ͯ͠ɺSiriʹೝࣝͤ͞Δ͜ͱ΋Մ ೳ • (࡞Δ࣌ʹ࿩͔͚͠Δͷஏ͔͍ͣ͠)
  11. Intents Domain • Audio or video calling • Messaging •

    Payments • Searching photos • Workouts • Ride Booking @mo_to_44͞ΜͷεϥΠυ͕ৄ͍͠ͷͰͪ͜ΒΛ https://speakerdeck.com/mnat44/sirikit
  12. Appleతʹ΋ iOS10͸SiriKitԡͬ͠Ά͍ (͕ɺϢʔβʔ͕࢖͍ͬͯΔֆ͕૝૾Ͱ͖ͳ͍…)

  13. 2. UserNotifications, UserNotificationsUI https://developer.apple.com/reference/usernotifications https://developer.apple.com/reference/usernotificationsui

  14. 2. UserNotifications, UserNotificationsUI • ௨஌ڐՄ͞Εͨ͜ͱΛCallBackϋϯυϧͰ͖ ΔΑ͏ʹͳΔʂʂʂ => ѻ͍΍͘͢ͳͬͨʂʂʂʂ UNUserNotificationCenter.current().requestAuthorization([.alert, .so

    und, .badge]) { (granted, error) in if granted == true { //ڐՄ͞Ε͍ͯΔ } else { //ڐՄ͞Ε͍ͯͳ͍ } } //ࠓͷઃఆঢ়ଶͷऔಘ΋Ͱ͖Δ UNUserNotificationCenter.current().getNotificationSettings { (settings) in }
  15. 2. UserNotifications, UserNotificationsUI • ϑΥΞάϥ΢ϯυͰ΋௨஌ΛදࣔͰ͖ΔΑ͏ ʹͳΔʂʂʂ => ಠࣗͷΞϥʔτग़͞ͳͯ͘ࡁΉ func userNotificationCenter(_

    center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler handlerBlock: (UNNotificationPresentationOptions) -> Void) { //Roll banner and sound alert handlerBlock([.alert, .sound]) } ※ ศརͳ൒໘ɺPush͔ΒͷભҠʹΑͬͯɺͦΕ·Ͱͷϑϩʔ่͕յ͢ΔՄೳੑ͕͋ΔͷͰɺे෼ ͳߟྀ͕ඞཁ
  16. 2. UserNotifications, UserNotificationsUI • ௨஌ΛΧελϚΠζͰ͖Δʂʂʂ => ࣸਅɺΧϨϯμʔɺTextField౳

  17. ᙱ͍ॴʹ΍ͬͱख͕ಧ͍ͨײ UXʹ௚݁͢ΔͷͰ ݸਓతʹ͸༏ઌ౓ߴ͍

  18. 3. UIKit https://developer.apple.com/library/prerelease/content/ releasenotes/General/iOS10APIDiffs/Swift/UIKit.html

  19. UIColor https://developer.apple.com/videos/play/wwdc2016/712/ https://developer.apple.com/reference/uikit/uicolor/ 1648568-init

  20. UIColor.init(displayP3Red:green:blue:alpha:) • Display P3 ʹରԠͨ͠ΠχγϟϥΠβ • දࣔͰ͖ͳ͍৔߹͸sRGBʹม׵͞ΕΔ • ݱঢ়iOSͰରԠ͍ͯ͠Δͷ͸iPad ProͷΈ

    => iPhone7͸Display P3͔΋ʁʁʁ
  21. UITabBarItem https://developer.apple.com/reference/uikit/uitabbaritem

  22. UITabBarItem.badgeColor UITabBarItem.setBadgeTextAttributes(_:for:) • TabBarItemʹ͚ͭΔόοδͷ৭Λ͍͡Δ͜ͱ ͕Ͱ͖ΔΑ͏ʹͳΔ => ੺஍ʹനจࣈҎ֎͕࢖͑ΔΑ͏ʹͳΔ • ஍ຯʹخ͍֦͠ு

  23. UIViewPropertyAnimator https://developer.apple.com/videos/play/wwdc2016/216/ https://developer.apple.com/reference/uikit/ uiviewpropertyanimator

  24. UIViewPropertyAnimator • iOS10͔ΒͷΞχϝʔγϣϯ • ΞχϝʔγϣϯͷPause͕Ͱ͖Δ • Ξχϝʔγϣϯͷ్தʹผͷΞχϝʔγϣϯΛ ։࢝Ͱ͖Δ • Ϣʔβʔͷૢ࡞ʹ߹ΘͤͯɺΞχϝʔγϣϯΛ

    ૢ࡞͢Δ͜ͱ΋Մೳ
  25. جຊͷ࢖͍ํ let timing = UICubicTimingParameters(animationCurve: .easeInOut) let animator = UIViewPropertyAnimator(duration:

    2.0, timingParameters: timing) animator.addAnimations { //Ξχϝʔγϣϯͷऴ఺Λఆٛ } animator.addCompletion {_ in //Ξχϝʔγϣϯऴྃ࣌ͷॲཧ } animator.startAnimation()
  26. جຊͷ࢖͍ํ let timing = UICubicTimingParameters(animationCurve: .easeInOut) let animator = UIViewPropertyAnimator(duration:

    2.0, timingParameters: timing) animator.addAnimations { //Ξχϝʔγϣϯͷऴ఺Λఆٛ } animator.addCompletion {_ in //Ξχϝʔγϣϯऴྃ࣌ͷॲཧ } animator.startAnimation()
  27. Ξχϝʔγϣϯϑϩʔ animator.startAnimation() //ελʔτ ->ɹstatus: active animator.pauseAnimation() //ϙʔζ -> status: active

    animator.stopAnimation(_ withoutFinishing: Bool) //ετοϓ /* withoutFinishing: ture -> status: inactive false -> status: stopped */ animator.finishAnimation(at: UIViewAnimatingPosition) //ऴྃ /* status: inactive at: .end: Ξχϝʔγϣϯͷऴྃ఺ .start: Ξχϝʔγϣϯͷ։࢝఺ .current: ࠓͷ஍఺ */
  28. UISpringTimingParametersͰ͜Μͳ͜ͱ΋Ͱ͖ΔΒ͍͠ https://developer.apple.com/videos/play/wwdc2016/216/

  29. Ͱ͖ͦ͏ͳΞχϝʔγϣϯΛ νʔϜͰߟ͍͑ͨ (؆୯ʹͳͬͨͱ͸͍͑ɺΞχϝʔγϣϯ͸َ໳)

  30. • (iOS9·ͰΛͲ͏͢Δ͔ͷ໰୊ௐࠪͭͭ͠ɺ) UserNotifications͸ૣΊʹରԠ͍ͨ͠ • (ݸਓతʹ) SiriKit࢖ͬͯΈ͍ͨ • Ξχϝʔγϣϯ͸΋͏গ͠ௐ͕ࠪඞཁ ॴײ +

    ఏҊ
  31. ͜͜·Ͱ

  32. ʲએ఻ʳ

  33. PyCon JP 2016ʹདྷ·ͤΜ͔? • https://pycon.jp/2016/ • WebɺαΠΤϯε౳༷ʑͳόοΫάϥ΢ϯυ ͷਓ͕͍ΔͷͰɺiOSͷਓ΋ָ͠ΊΔ͸ͣ • 2೔ؒͷ͓னͱॳ೔ͷύʔςΟ୅ࠐͰ1ສԁ!!!

  34. • νϡʔτϦΞϧ: 9/20 • ΧϯϑΝϨϯε: 9/21-22 • εϓϦϯτ: 9/23-24 νέοτ:

    http://pyconjp.connpass.com/event/30692/ PyCon JP 2016։࠵֓ཁ
  35. • https://github.com/pyconjp/pyconjp-ios • 7݄຤ϦϦʔε༧ఆ (·ͩશવ׬੒ͯ͠ͳ͍) • PR͓଴͍ͪͯ͠·͢ʂʂʂ PyCon JP 2016

    iOSΞϓϦ࡞ͬͯ·͢
  36. ʲ؇ืʳ (cocoapods-keysҎ֎Ͱ) XcodeϓϩδΣΫτΛ Git౳Ͱެ։͢Δ࣌ͷ APIKeyͷӅ͠ํ