Post

Replies

Boosts

Views

Activity

Reply to Can DocC Generate Documentation for Extensions?
The solution is to use inside a package a public protocol with a type constraint and declare the type to conform to the protocol. Now you get the documentation you want. It is a cleaner solution than just using an extension. Example: import Foundation // The extension: public protocol FileManagerExtension: FileManager { } extension FileManager: FileManagerExtension { } // I don't know why this doesn't have to be public! // The new function: public extension FileManagerExtension {     /// My new function.     /// - Returns: 42.     func myNewFuntion() -> Int { return 42 } }
Oct ’21