This file contains 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
// Reference and credit: https://dzone.com/articles/simplest-way-to-add-stored-property-to-swift-exten | |
class ExampleClass {} | |
fileprivate var storedProperty_FILEPRIVATE: [ObjectIdentifier:Int] = [:] | |
fileprivate var storedProperty_DEFAULT: Int = 0 | |
extension ExampleClass { | |
var storedProperty: Int { | |
get {return storedProperty_FILEPRIVATE[ObjectIdentifier(self)] ?? storedProperty_DEFAULT} | |
set {storedProperty_FILEPRIVATE[ObjectIdentifier(self)] = newValue} |
This file contains 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
// Remove seperator lines between UITableViewCells in UITableView | |
// Reference: https://stackoverflow.com/questions/26653883/delete-lines-between-uitableviewcells-in-uitableview | |
var tableView = UITableView() | |
tableView.separatorStyle = .none | |
// Add spacing between UITableViewCell | |
// Reference: https://stackoverflow.com/questions/1369831/eliminate-extra-separators-below-uitableview | |
// Inside UITableViewCell subclass | |
override func layoutSubviews() { | |
super.layoutSubviews() |
NewerOlder