This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deinit { | |
// perform your work | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FullscreenButton: UIButton { | |
// Convenience initializer | |
convenience init(_ screen: UIScreen) { | |
// Reusing Designated initializer | |
self.init(frame: screen.bounds) | |
} | |
// Initializer overriding | |
override init(frame: CGRect) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FullscreenButton: UIButton { | |
// Convenience initializer | |
convenience init(_ screen: UIScreen) { | |
// Reusing Designated initializer | |
self.init(frame: screen.bounds) | |
} | |
// Initializer overriding | |
override init(frame: CGRect) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TransportStorage { | |
weak var output: NSObject? | |
let database: Any // <----- Constant | |
var token: String? | |
init(database: Any) { | |
self.database = database | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TransportStorage { | |
weak var output: NSObject? | |
var database: Any | |
var token: String? | |
init(database: Any) { | |
self.database = database | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Class Setting | |
init(with name: String, for action: Action, on state: State = .on) { | |
self.name = name | |
self.action = action | |
self.state = state | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// class Setting | |
init(name: String, action: Action, state: State = .on) { | |
self.name = name | |
self.action = action | |
self.state = state | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Setting: NSObject { | |
enum State { | |
case off, on | |
} | |
enum Action { | |
case setup, open | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Setting: NSObject { | |
enum State { | |
case off, on | |
} | |
enum Action { | |
case setup, open | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AudioPlayer: Player { | |
// Overriding Property Observers | |
override var playing: Bool { | |
didSet { | |
print("\(self) did set playing") | |
} | |
} | |
// Overriding Methods |