Day 84
Day 84 ๊ด๋ จ
Project 25, part two
There are a number of well-known quotes from Steve Jobs, but if I had to pick one โ my all-time favorite โ it would be this: โit is in Appleโs DNA that technology alone is not enough โ itโs technology married with liberal arts, married with the humanities, that yields us the results that make our heart sing.โ
Multipeer connectivity is another one of those frameworks that should set off sparks in your brain: โhow can I use this make something great?โ Honestly, I canโt answer that question for you. As Saint Steve said, technology alone is not enough โ you wonโt build something truly great just by shipping a thin layer over Appleโs APIs.
Itโs easy to think to yourself, โwhat can I make thatโs different from everything else?โ What you ought to be thinking is โwhat unique perspective does my background and experience give me that lets me build a fresh take on an existing idea?โ In 2015 (seven years after the App Store launched) Microsoft spent north of $100 million acquiring Wonderlist, which was โ shock! โ a to do list app.
What Iโm saying is that your idea doesnโt need to be special, and really your code doesnโt need to be that special either. Because what matters โ the part that makes our heart sing โ is where you blend all that with what makes you you. If youโve used 10 to do apps and none quite scratch the itch you have, itโs time for you to make your own. And with over a billion people out there using iOS, youโll find that there are hundreds of thousands of people that have exactly that same itch, and would happily hand over a buck or two for your solution.
Whether your app idea ends up building on multipeer networking, iBeacons, Core Image, or more โ it doesnโt matter. What matters is that youโre giving yourself the skills you need to build the app of your dreams, and you should be darned proud of yourself.
Today you should work through the wrap up chapter for project 25, complete its review, then work through all three of its challenges.
Wrap up
Wrap up
Multipeer connectivity is something that used to be awfully hard, but in iOS it's less than 150 lines of code to produce this entire app โ and over half of that is code for the collection view and the image picker!
The advantage it has compared to traditional data sharing over Wi-Fi is that multipeer can use an existing Wi-Fi network, or can silently create a new Wi-Fi network or even a Bluetooth network depending on what's available. All this is an implementation detail that Apple solves on your behalf โ we donโt have to care how it works.
Review what you learned
Anyone can sit through a tutorial, but it takes actual work to remember what was taught. Itโs my job to make sure you take as much from these tutorials as possible, so Iโve prepared a short review to help you check your learning.
Click here to review what you learned in project 25.
Challenge
One of the best ways to learn is to write your own code as often as possible, so here are three ways you should try your new knowledge to make sure you fully understand whatโs going on:
- Show an alert when a user has disconnected from our multipeer network. Something like โPaulโs iPhone has disconnectedโ is enough.
- Try sending text messages across the network. You can create a
Data
from a string usingData(yourString.utf8)
, and convert aData
back to a string by usingString(decoding: yourData, as: UTF8.self)
. - Add a button that shows an alert controller listing the names of all devices currently connected to the session โ use the
connectedPeers
property of your session to find that information.
Wrap up - Additional
Donโt forget to share your progress with others โ holding yourself accountable is particularly important as we approach the final straight of this challenge!