Learn how to improve your understanding and utilization of your functions by adding comments to document parameters, return values, warnings, and other callouts.
- [Instructor] In addition to regular…and delimiter comments, you can add quickhelp documentation…to give users of your code quick access…to additional info about your code.…Let's say I want to add a quickhelp comment…to this function, and I'll go over functions later…so don't worry if you're not familiar with this syntax yet.…To add a single line quickhelp comment,…start the comment line immediately above the code…you want to attach it to with three forward slashes.…New in Xcode 8, there's also a menu item,…and keyboard shortcut to do this for you.…Select Editor, Structure, Add Documentation,…or press the keyboard shortcut cmd + opt + /…and add your comment.…
This also works for functions that take parameters…and/or return a value.…This time, I'll use the keyboard shortcut,…and tab through the placeholders, and type in my comments.…There are additional callouts we can use here,…such as to include a warning.…This is just an example, but I'll show you a better way…to handle predictable errors like this…in the functions chapter.…
Learn how to write code, understand Swift's key concepts and best practices, and strengthen your programming problem-solving skills. Instructor Scott Gardner teaches the fundamentals, so you'll be prepared to develop applications for iOS, macOS, and other platforms. Completing this course will enable you to not only write first-class code, but to think like a Swift developer.
- Creating playgrounds
- Defining variables and constants
- Working with characters and strings
- Working with collections and groups
- Using operators and defining custom operators
- Controlling program flow
- Defining functions and closures
- Working with classes, structures, and enumerations
- Adopting protocols
Skill Level Beginner
1. Get Started
2. Variables and Constants
3. Characters and Strings
4. Collections and Tuples
6. Control Flow
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
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.