mirror of https://github.com/oxen-io/session-ios
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
955 B
Swift
49 lines
955 B
Swift
7 years ago
|
//
|
||
6 years ago
|
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
|
||
7 years ago
|
//
|
||
|
|
||
|
import Foundation
|
||
|
|
||
|
@objc
|
||
7 years ago
|
public class OWSLayerView: UIView {
|
||
6 years ago
|
@objc
|
||
6 years ago
|
public var layoutCallback: ((UIView) -> Void)
|
||
7 years ago
|
|
||
|
@objc
|
||
6 years ago
|
public init() {
|
||
|
self.layoutCallback = { (_) in
|
||
|
}
|
||
|
super.init(frame: .zero)
|
||
|
}
|
||
|
|
||
|
@objc
|
||
|
public init(frame: CGRect, layoutCallback : @escaping (UIView) -> Void) {
|
||
7 years ago
|
self.layoutCallback = layoutCallback
|
||
|
super.init(frame: frame)
|
||
|
}
|
||
|
|
||
7 years ago
|
public required init?(coder aDecoder: NSCoder) {
|
||
7 years ago
|
self.layoutCallback = { _ in
|
||
|
}
|
||
|
super.init(coder: aDecoder)
|
||
|
}
|
||
|
|
||
7 years ago
|
public override var bounds: CGRect {
|
||
7 years ago
|
didSet {
|
||
|
layoutCallback(self)
|
||
|
}
|
||
|
}
|
||
|
|
||
7 years ago
|
public override var frame: CGRect {
|
||
7 years ago
|
didSet {
|
||
|
layoutCallback(self)
|
||
|
}
|
||
|
}
|
||
|
|
||
7 years ago
|
public override var center: CGPoint {
|
||
7 years ago
|
didSet {
|
||
|
layoutCallback(self)
|
||
|
}
|
||
|
}
|
||
|
}
|