Top "Swift-protocols" questions

Protocols specific to the Swift language

Nested types inside a protocol

It is possible to have nested types declared inside protocols, like this: protocol Nested { class NameOfClass { var property: String { get …

swift protocols swift-protocols
see why "type does not conform to protocol" in Xcode (swift)

I frequently have relatively complicated protocols with associatedType constraints, are used in generics, are used by CoreData type extensions, etc. …

ios xcode swift swift-protocols
Difference between Swift's hash and hashValue

The Hashable protocol in Swift requires you to implement a property called hashValue: protocol Hashable : Equatable { /// Returns the hash value. …

swift hash swift-protocols
Swift protocol nested in a class

I would like to nest a protocol in my class to implement the delegate pattern like so : class MyViewController : UIViewController { …

swift swift-protocols
Pass a Swift class as parameter, and then call a class method out of it

I want to be able to store a class as a variable, so I can call class methods out of …

ios swift protocols swift-protocols
Swift Public protocols with Internal functions and properties

I am wondering what the best practice is when I want some functions to be public and some to me …

ios swift swift3 access-modifiers swift-protocols
Swift 3 conversion Error/NSError

While trying to migrate to Swift 3 (in a project which contains about half/half swift/objective-c code), I am facing …

ios objective-c swift3 swift-protocols nserror
Swift extension of a class ONLY when it conforms to a specific protocol

Hi there =) I was just faced with a design problem where I need to (essentially) do the following: I want …

ios swift uiviewcontroller swift-protocols swift-extensions