Join Todd Perkins for an in-depth discussion in this video Creating a note class, part of Building a Note-Taking App for iOS 8.
- Now let's create our data model…which is going to be a note class.…To create a new class, you can go to File, New,…File or press Command + N on your keyboard.…Under iOS Source I'm going to choose…"Cocoa Touch Class" and click next.…So here I can choose the name of the…class which is going to be "Note."…We'll have it be a Subclass of NSObject,…which is the root class for Objective C…and we don't need to subclass anything for Swift…however we're going to use some methods that we…want to inherit from NSObject.…
So I'm going to have that as my subclass,…choose Swift for the Language and then click Next.…I'll save it into my project folder and click Create…and here I have my Note class.…Our Note class is going to have two properties.…It's going to have a date which is going to be…a time stamp that will serve as a unique ID for each note…and then it will have a property called "note,"…which will actually contain the data of the note.…In other words, all the text inside of the note.…
They're both going to be Strings.…
Each of these courses helps you build a complete mobile app from scratch; this installment uses the iOS SDK and Xcode to get the job done. Author Todd Perkins shows you how to create an Xcode project, lay out apps visually, connect UI elements to code, and save data to persistent storage. Start here with iOS 8, and compare your results with the Android and Windows Phone courses to learn about the differences and similarities of these mobile platforms.
- Previewing the note-taking app's features
- Creating the Xcode project
- Using local data storage
- Creating a data class
- Saving data to a file or user defaults
- Understanding screens and storyboards
- Controlling transitions between views
- Connecting the controller to the data
- Creating, editing, and deleting notes