Top "Swift-extensions" questions

Extensions add new functionality to an existing class, structure, or enumeration type.

Overriding methods in Swift extensions

I tend to only put the necessities (stored properties, initializers) into my class definitions and move everything else into their …

swift swift2 swift-extensions
How to create swift class for category?

I want to create category of my existing swift class, but there is no option in IDE to do so. …

swift swift-extensions
Can objective-c code call swift extension on Class?

I searched some posts, I think I cannot write an extension under swift, and call it from Objective-C code, right ? @…

objective-c swift swift-extensions
Swift "where" Array Extensions

As of Swift 2.0 it seems we can get closer to extensions of generic types applicable to predicated situations. Although we …

swift where-clause swift-extensions
Extend array types using where clause in Swift

I'd like to use the Accelerate framework to extend [Float] and [Double] but each of these requires a different implementation. …

swift generics swift2 swift-extensions
How to define initializers in a protocol extension?

protocol Car { var wheels : Int { get set} init(wheels: Int) } extension Car { init(wheels: Int) { self.wheels = wheels } } on self.…

swift initialization swift2 protocols swift-extensions
what is 'where self' in protocol extension

I saw so many examples with below format extension Protocolname where Self: UIViewController What is where Self in protocol extension. …

swift protocols swift-protocols swift-extensions
Creating an extension to filter nils from an Array in Swift

I'm trying to write an extension to Array which will allow an array of optional T's to be transformed into …

arrays swift generics swift-extensions
Can you override between extensions in Swift or not? (Compiler seems confused!)

I've been working on an iOS application in Swift (much of it being moved from Objective-C). I'm using Core Data …

swift overriding swift-extensions