Questions tagged [swift-extensions]

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

Apple Pre-release Docs

394 questions
-5
votes
1 answer

How to fix `Implementation of 'Protocol' cannot be automatically synthesized in an extension`?

I'm getting a compiler error while adding new protocol conformance to an extension. struct EquatableStruct { } extension EquatableStruct: Equatable { static func == (lhs: EquatableStruct, rhs: EquatableStruct) -> Bool { return true …
Frankenstein
  • 15,732
  • 4
  • 22
  • 47
-5
votes
1 answer

passing data to already implemented delegate methods inside extensions inside swift

I am trying to pass data to a delegate method implemented inside an extension but i am unable to do it since extensions cannot have stored properties. How to get it done?
-5
votes
1 answer

Extension property not working as instance property

I have created an protocol extension of UIImageView and added a bool property isFlipped to the extension. My problem is that if I set isFlipped true of false for one object is sets the same values for the all the UIImageView objects. Can anyone…
Sishu
  • 1,510
  • 1
  • 21
  • 48
1 2 3
26
27