can class is final access and methods within class public access
Generated on 10/30/2024
1 search
In Swift, a class marked as final
cannot be subclassed, meaning no other class can inherit from it. However, the access level of the class and its methods can still be controlled independently. You can have a final
class with public
methods, which means that while the class itself cannot be subclassed, its methods can be accessed from any module if they are marked as public
.
For more details on Swift's access control and class features, you might find the session A Swift Tour: Explore Swift’s features and design helpful, particularly the section on classes.
Explore Swift performance
Discover how Swift balances abstraction and performance. Learn what elements of performance to consider and how the Swift optimizer affects them. Explore the different features of Swift and how they’re implemented to further understand the tradeoffs available that can impact performance.
Consume noncopyable types in Swift
Get started with noncopyable types in Swift. Discover what copying means in Swift, when you might want to use a noncopyable type, and how value ownership lets you state your intentions clearly.
A Swift Tour: Explore Swift’s features and design
Learn the essential features and design philosophy of the Swift programming language. We’ll explore how to model data, handle errors, use protocols, write concurrent code, and more while building up a Swift package that has a library, an HTTP server, and a command line client. Whether you’re just beginning your Swift journey or have been with us from the start, this talk will help you get the most out of the language.