When working in Cocoa, you can use completely built-in user interface objects as they are, or you can extend and customize them to your liking. This video shows how to connect existing user interface objects to a custom class to extend functionality.
- [Narrator] As you get further into Cocoa development,…you're going to start to not want…all of your code in AppDelegate.swift.…Maybe it's for better organization,…maybe it's to better follow MVC, etc.…So let's look at how we can create a custom class…and connect our user-interface objects…to methods or properties in that custom class.…So, first off, we'll create the class…by going to file, new, file.…And of course you can just push Command + N if you want.…
Under macOS, choose Cocoa Class and hit next.…Name of this class is going to CustomController.…Let's just have it be a subclass of NSObject for now.…Language, swift, hit next.…Now I'll hit create to create the file…in the default location, and there's CustomController.swift.…Now if you want to keep your classes organized…so that they're next to each other,…you can actually just drag and drop files…inside of the navigator right here.…So I can simply just drag CustomController.swift…up a little bit, and there it is.…
Now let's go to MainMenu.xib and just drag…
- Installing your development tools
- Working with Xcode and the MVC pattern
- Creating basic interactions
- Creating delegate classes
- Building a user interface
- Laying out the UI
- Working with data and table views
- Binding data objects to the UI
- Debugging your app
- Distributing the app
Skill Level Beginner
1. Get Started
2. Core Cocoa Skills
4. Create User Interfaces
5. Arrange User Interfaces
6. Use Data Controls
7. Debug and Troubleshoot
8. Distribute an Application
9. Finishing Touches
Create full screen apps1m 51s
Next steps1m 21s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.