Join Scott Gardner for an in-depth discussion in this video Work with access control, part 2, part of Swift 3 Essential Training: Beyond the Basics.
- [Instructor] I'm continuing from where I left off…in the last video in the same project.…I've assigned an access control level of public…to external custom class.…But in order to be able to subclass it,…I need to make it open.…Once I do that, I can subclass it.…Now I'll create an instance of custom class.…But I still cannot access the print title method…because remember all members of a public or open type…are internal by default…in order to prevent unintentionally exposing…the internal workings of a framework.…
If I assigned public to print title…in the external custom class,…I would be able to access that method…in the custom class subclass…but not override it in that subclass.…I am going to override it in a moment…so I'll just go ahead and make it open.…Doing so makes print title available on custom class.…And now, I'll override it in custom class.…
I'm getting another error…because even though the method was made open…and it can access the title property…internally within custom class,…custom class still cannot access it directly…
- Adding source files, resources, links, and literals
- Adding pages to a playground
- Using overflow operators and bitwise operators
- Using ranges with strings
- Creating complex sequences
- Chaining higher-order functions
- Defining lazy properties
- Using failable initializers
- Mutating methods
- Working with singletons
- Nesting function types
- Creating error types and recursive enumerations
- Extending concrete types
- Referencing selectors and key paths
- Working with protocol-oriented programming
- Defining class-only protocols and optional protocols
- Using option sets, type checking, and casting operators
Skill Level Intermediate
Core Data for iOS and macOS Enterprise Developerswith Jon Bott1h 46m Intermediate
Distributing Your iOS App for Testing with TestFlightwith Ron Buencamino35m 10s Intermediate
iOS App Development: Test-Driven Developmentwith Harrison Ferrone2h 14m Intermediate
3. Strings and Characters
4. Sequences and Collections
5. Control Flow
6. Value and Reference Types
9. Access Control
Understand access control3m 47s
Next steps1m 2s
- 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.