Day 44
Day 44 ๊ด๋ จ
Project 10, part three
Thatโs another app completed, and several more important components learned: collection views for grids, image pickers for browsing in the photo library, UUID
for making unique identifiers, and more.
None of those are small things: I hope you can really see your progress, and all being well youโre already mentally preparing for the end-of-project challenges we always have.
I realize these challenges can be tough, but I want to encourage you to keep on going. When you get results youโre learning, but when you make mistakes youโre learning almost as much โ it all counts, and as Denis Waitley said, โthe results you achieve will be in direct proportion to the effort you apply.โ
Today you should work through the wrap up chapter for project 10, complete its review, then work through all three of its challenges.
Wrap up
Wrap up
UICollectionView
and UITableView
are the most common ways of showing lots of information in iOS, and you now know how to use both. You should be able to go back to project 1 and recognize a lot of very similar code, and that's by intention โ Apple has made it easy to learn both view types by learning either one.
You've also learned another batch of iOS development, this time UIImagePickerController
, UUID
, custom classes and more. You might not realize it yet, but you have enough knowledge now to make a huge range of apps!
Before we finish, you may have spotted one problem with this app: if you quit the app and relaunch, it hasn't remembered the people you added. Worse, the JPEGs are still stored on the disk, so your app takes up more and more room without having anything to show for it!
This is quite intentional, and something we'll return to fix in project 12. Before then, let's take a look at another gameโฆ
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 10.
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:
- Add a second
UIAlertController
that gets shown when the user taps a picture, asking them whether they want to rename the person or delete them. - Try using
picker.sourceType = .camera
when creating your image picker, which will tell it to create a new image by taking a photo. This is only available on devices (not on the simulator) so you might want to check the return value ofUIImagePickerController.isSourceTypeAvailable()
before trying to use it! - Modify project 1 so that it uses a collection view controller rather than a table view controller. I recommend you keep a copy of your original table view controller code so you can refer back to it later on.
Wrap up - Additional