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.
自作アプリを
watchOS 2 対応した話
∼FastCheckin編∼
Kosuke Ogawa (@koogawa)
2015.9.30 もくもくiOS勉強会@ネクスト 1周年記念LT会
• 小川航佑 Kosuke Ogawa
• @koogawa
• nanapi 所属
• iOSアプリを仕事・趣味でいろいろ開発
• foursquare好き
70万DL突破! 20万DL突破!
FastCheckin
•素早く簡単にfoursquareにチェックイ
ンするためのアプリ
ぶち当たった様々な問題
1. App Groupsでデータを共有できない問題
2. 画像がキャッシュできない問題
3. WatchKit Extensionのbundle identifier問題
4. startUpdatingLocation...
App Groupsで
Watch iPhone間の
データ共有ができない問題
watchOS 1
App
Group
(watchOS 2 Transition Guideより引用)
watchOS 2
(watchOS 2 Transition Guideより引用)
App
Group
Watch Connectivity 使おう
DATA
(Introducing Watch Connectivityより引用)
http://qiita.com/koogawa/items/b39e1419cbbcda8efc07
画像がキャッシュ
できない問題
func addCachedImage(_ image: UIImage!, name name: String!) -> Bool
func addCachedImageWithData(_ imageData: NSData!, name ...
watchOS 1
Image
(watchOS 2 Transition Guideより引用)
watchOS 1
(watchOS 2 Transition Guideより引用)
Image
watchOS 1
(watchOS 2 Transition Guideより引用)
Cache
watchOS 2
(watchOS 2 Transition Guideより引用)
Image
watchOS 2ではWatch Extensionが
Apple Watch側に移動したため、
キャッシュする必要がなくなった
WatchKit Extensionの
bundle identifier問題
watchOS 1
Bundle identifier
Watch App com.koogawa.SampleWatchApp.watchkitapp
WatchKit
Extension
com.koogawa.SampleWatchApp....
ビルドすると
Embedded binary's bundle identifier
is not prefixed with the parent app's
bundle identifier.
つまり
watchOS 2では
WatchKit Extension の bundle identifier が、
親の WatchApp の bundle identifier を
Prefix に持ってないといけない
watchOS 2
Bundle identifier
Watch App com.koogawa.SampleWatchApp.watchkitapp
WatchKit
Extension
com.koogawa.SampleWatchApp....
startUpdatingLocationが
使えない問題
watchOS 2
watchOS 2
watchOS 2
• requestLocation 使おう
• 一回きりの位置情報取得が可能
NSURLConnection が
エラーになる問題
watchOS 2
• NSURLSession
• Apple Watch 単体で
サーバと通信可能
(Introducing Watch Connectivityより引用)
一方で…
• NSURLConnection が使えない
• Error Domain=NSURLErrorDomain
Code=-1009 "The Internet connection
appears to be offline."
• N...
参考リンク
• watchOS 2 Transition Guide(必読)
• Introducing Watch Connectivity - WWDC
2015
• What's New in Core Location - WWDC 2...
宣伝
•今だけ無料!(いつもは100円)
•FastCheckinで検索
WE ARE HIRING!!
http://recruit.nanapi.co.jp/
ありがとう
ございました
Upcoming SlideShare
Loading in …5
×

自作アプリを watchOS 2 対応した話 〜FastCheckin編〜

5,085 views

Published on

2015.9.30 もくもくiOS勉強会@ネクスト 1周年記念LT会

Published in: Technology
  • Sex in your area is here: ❶❶❶ http://bit.ly/2F7hN3u ❶❶❶
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Dating for everyone is here: ❤❤❤ http://bit.ly/2F7hN3u ❤❤❤
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

自作アプリを watchOS 2 対応した話 〜FastCheckin編〜

  1. 1. 自作アプリを watchOS 2 対応した話 ∼FastCheckin編∼ Kosuke Ogawa (@koogawa) 2015.9.30 もくもくiOS勉強会@ネクスト 1周年記念LT会
  2. 2. • 小川航佑 Kosuke Ogawa • @koogawa • nanapi 所属 • iOSアプリを仕事・趣味でいろいろ開発 • foursquare好き 70万DL突破! 20万DL突破!
  3. 3. FastCheckin •素早く簡単にfoursquareにチェックイ ンするためのアプリ
  4. 4. ぶち当たった様々な問題 1. App Groupsでデータを共有できない問題 2. 画像がキャッシュできない問題 3. WatchKit Extensionのbundle identifier問題 4. startUpdatingLocationが使えない問題 5. NSURLConnection がエラーになる問題
  5. 5. App Groupsで Watch iPhone間の データ共有ができない問題
  6. 6. watchOS 1 App Group (watchOS 2 Transition Guideより引用)
  7. 7. watchOS 2 (watchOS 2 Transition Guideより引用) App Group
  8. 8. Watch Connectivity 使おう DATA (Introducing Watch Connectivityより引用)
  9. 9. http://qiita.com/koogawa/items/b39e1419cbbcda8efc07
  10. 10. 画像がキャッシュ できない問題
  11. 11. func addCachedImage(_ image: UIImage!, name name: String!) -> Bool func addCachedImageWithData(_ imageData: NSData!, name name: String!) -> Bool func removeCachedImageWithName(_ name: String!) func removeAllCachedImages() キャッシュ系メソッドが 使えなくなっている
  12. 12. watchOS 1 Image (watchOS 2 Transition Guideより引用)
  13. 13. watchOS 1 (watchOS 2 Transition Guideより引用) Image
  14. 14. watchOS 1 (watchOS 2 Transition Guideより引用) Cache
  15. 15. watchOS 2 (watchOS 2 Transition Guideより引用) Image
  16. 16. watchOS 2ではWatch Extensionが Apple Watch側に移動したため、 キャッシュする必要がなくなった
  17. 17. WatchKit Extensionの bundle identifier問題
  18. 18. watchOS 1 Bundle identifier Watch App com.koogawa.SampleWatchApp.watchkitapp WatchKit Extension com.koogawa.SampleWatchApp.watchkitextension
  19. 19. ビルドすると Embedded binary's bundle identifier is not prefixed with the parent app's bundle identifier.
  20. 20. つまり watchOS 2では WatchKit Extension の bundle identifier が、 親の WatchApp の bundle identifier を Prefix に持ってないといけない
  21. 21. watchOS 2 Bundle identifier Watch App com.koogawa.SampleWatchApp.watchkitapp WatchKit Extension com.koogawa.SampleWatchApp.watchkitapp.watchkitextension
  22. 22. startUpdatingLocationが 使えない問題
  23. 23. watchOS 2
  24. 24. watchOS 2
  25. 25. watchOS 2 • requestLocation 使おう • 一回きりの位置情報取得が可能
  26. 26. NSURLConnection が エラーになる問題
  27. 27. watchOS 2 • NSURLSession • Apple Watch 単体で サーバと通信可能 (Introducing Watch Connectivityより引用)
  28. 28. 一方で… • NSURLConnection が使えない • Error Domain=NSURLErrorDomain Code=-1009 "The Internet connection appears to be offline." • NSURLSession ベースに切り替える必要がある
  29. 29. 参考リンク • watchOS 2 Transition Guide(必読) • Introducing Watch Connectivity - WWDC 2015 • What's New in Core Location - WWDC 2015
  30. 30. 宣伝 •今だけ無料!(いつもは100円) •FastCheckinで検索
  31. 31. WE ARE HIRING!! http://recruit.nanapi.co.jp/
  32. 32. ありがとう ございました

×