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

Cocoaheads Berlin - October

Cocoaheads Berlin - October

Building a cross-platform iOS, tvOS and watchOS app using MultipeerConnectivity and WatchKit

I’ve spend over a year of my spare time working as part of the team that built the POKERNIGHT: HOME - an application that helps organizing poker nights with your friends. We started with the tvOS app, but soon expanded it to an iOS and watchOS application. While building the views was the most time-consuming part of the work, the most intriguing was connecting those different platforms using connectivity APIs that iOS/tvOS/watchOS SDKs provide. I’ll try to share some of my experience using those frameworks and get you excited about using it in your app.

Presented at CocoaHeads Berlin meetup on October 2016

Matej Balantič

October 19, 2016
Tweet

More Decks by Matej Balantič

Other Decks in Programming

Transcript

  1. Matej Balantič POKERNIGHT Spare time mobile engineer Spare time copywriter

    Spare time translator Spare time UX researcher Spare time designer
  2. Matej Balantič POKERNIGHT Spare time mobile engineer Spare time copywriter

    Spare time translator Spare time UX researcher Spare time designer
  3. 7 ❞ Why don’t we build this simple app that

    manages our home poker games? ~ Matej, October 2015
  4. 8 ❞ Next time somebody invites me to build a

    simple app I’ll punch him in the face. ~ Lenart, October 2016 ❞ Why don’t we build this simple app that manages our home poker games? ~ Matej, October 2015
  5. 9 Why building an app in free time? • It

    was to solve a real problem we had • We wanted to learn Swift • We wanted to try out tvOS • Go outside the comfort zone
  6. 10 months ago... • Went to Apple’s tvOS workshop in

    Berlin • Asked their AppStore people for feedback ◦ should support iOS ◦ should localize in few languages
  7. Building app with frameworks: TL;DR • Build app by building

    frameworks • Awesome for modularization/reuse • Link against a maximum of 6 frameworks • DO share assets • DON’T share xibs/storyboards
  8. • PokerKit ◦ Everything not depending on UIKit • PokerUIKit

    ◦ All the reusable UIKit components • tvOS target ◦ View controllers ◦ Platform specifics Project structure
  9. 30

  10. 40 Two things bothered us • We supported almost all

    Apple’s devices. • The TV and iOS apps didn’t talk to each other
  11. 42 ❞ We should add the Watch App and make

    iOS talk with the tvOS app. Because we can. ~ Lenart, May 2016 ❞ We will ship only the minimum viable product ~ Matej, October 2015
  12. MultipeerConnectivity ❞ The Multipeer Connectivity framework supports the discovery of

    services provided by nearby devices and supports communicating with those services through message-based data, streaming data, and resources (such as files). https://developer.apple.com/reference/multipeerconnectivity
  13. MultipeerConnectivity • MCNearbyServiceAdvertiser ◦ Advertises the app on the network

    • MCNearbyServiceBrowser ◦ Discovers advertised apps • MCSession ◦ Provides communication API
  14. Should I do a side project? • Yes! It’s the

    best way to grow and learn new stuff • You get to try things just because you can • It’s very rarely a small project • Team up with a friend, it’s more fun, and you can push each other when times are hard
  15. Few advices • Always build using frameworks. Even when it

    feels unlikely you’ll need them. • Always localize, even when you only support 1 language • WatchKit and MultipeerConnectivity are easy, try it out