<br />
In this series I&#8217;ll show you how to create a simple Day Counter on iOS, using Objective-C and Xcode 9. The idea is to set a date in a settings screen, and then see how many days have elapsed on the main screen right after launching the app.<br />
This is a 3-Part Mini-Series:<br />
<br />
* Part 1 is all about building the interface in Interface Builder<br />
* Part 2 is about coding the NSDate subtraction methods, using NSCalendar and loading/saving data using NSUserDefaults<br />
* Part 3 will introduce Key/Value Observing to update the first view controller as soon as the date is changed in the settings and deals with how to normalise an NSDate object.<br />
<br />
You can find the full code on GitHub:<br />
<br />
* https://github.com/versluis/Day-Counter/<br />
<br />
Happy Hacking!<br />
Watch the full course in one convenient playlist:<a href='https://www.youtube.com/playlist?list=PLPcx_LSSGfZcVp24gpg_PqyEmJAQA8AMb' target='_blank'></a>Catch this episode on my iOS Dev Diary Podcast:<a href='https://itunes.apple.com/us/podcast/the-ios-dev-diary/id865706315' target='_blank'></a><a href='https://www.stitcher.com/s?fid=228530&refid=stpr' target='_blank'></a>

The iOS Dev Diary

Jay Versluis

Building a Day Counter on iOS – Part 3

APR 11, 201819 MIN
The iOS Dev Diary

Building a Day Counter on iOS – Part 3

APR 11, 201819 MIN

Description

In this series I’ll show you how to create a simple Day Counter on iOS, using Objective-C and Xcode 9. The idea is to set a date in a settings screen, and then see how many days have elapsed on the main screen right after launching the app. This is a 3-Part Mini-Series: Part 1 is all about building the interface in Interface Builder Part 2 is about coding the NSDate subtraction methods, using NSCalendar and loading/saving data using NSUserDefaults Part 3 will introduce Key/Value Observing to update the first view controller as soon as the date is changed in the settings and deals with how to normalise an NSDate object. You can find the full code on GitHub: https://github.com/versluis/Day-Counter/ Happy Hacking! Watch the full course in one convenient playlist:Catch this episode on my iOS Dev Diary Podcast: