I hereby claim:
- I am danurna on github.
- I am danurna (https://keybase.io/danurna) on keybase.
- I have a public key whose fingerprint is D8A2 86C8 271B C4B8 FBF2 E708 2B00 DB00 119C 94CB
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
import Foundation | |
import Realm | |
import RealmSwift | |
public extension Realm { | |
func cascadeDelete(_ entity: RLMObjectBase) { | |
guard let entity = entity as? Object else { return } | |
entity.objectSchema.properties.forEach { property in |
// Based on https://gist.github.com/joerick/a0b87607e69071fa6a3c | |
class AttachingObserver: NSObject { | |
typealias ChangeHandler = (NSObject, [NSKeyValueChangeKey: Any]?) -> Void | |
weak var observedObject: NSObject? | |
let keyPath: String | |
let changeHandler: ChangeHandler | |
init(observe object: NSObject, keyPath: String, changeHandler: @escaping ChangeHandler) { | |
self.observedObject = object | |
self.keyPath = keyPath |
class CatsUIView: UIView { | |
private var catsView: CatsView? | |
private var hostingViewController: UIViewController? | |
... | |
override func didMoveToSuperview() { | |
super.didMoveToSuperview() | |
guard hostingViewController == nil else { return } | |
class CatViewController: UIViewController { | |
lazy var stackView: UIStackView = { | |
let stackView = UIStackView(arrangedSubviews: [ | |
titleLabel, | |
catsView | |
]) | |
stackView.axis = .vertical | |
stackView.distribution = .fill | |
return stackView | |
}() |