Showing posts with label extension. Show all posts
Showing posts with label extension. Show all posts

Tuesday, June 9, 2015

A Simple Swift iOS App from Start to Finish - Creating the Data Model's Wrapper Class

Introduction

This is part of a series of articles describing the creation of a simple iOS app. A complete list of the articles is included in the first part A Simple Swift iOS App from Start to Finish - Introduction.

I have set up a web site for the finished app at http://DaysWithoutThings.com and you can download it free directly from the app store:




In this article I am going to create the wrapper class for my Thing entity and implement the code for a calculated property called currentDayCount.

Friday, November 28, 2014

Extending NSDate to add a Start of Day Method

New NSDate objects are created by default with the current time and date. This is useful for most things. However sometimes you may only want the date. One way to achieve this is to modify the NSDate object's time elements using  the NSCalendar and NSDateComponent classes to set the time to the first second of the day. This article will describe how to do this by creating a Swift extension to the NSDate class that will add a 'start of day' method.