We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
value
1 parent c2b82f1 commit f221d1eCopy full SHA for f221d1e
1 file changed
Sources/UseAutoLayout/UseAutoLayout.swift
@@ -3,15 +3,19 @@ import UIKit
3
4
@propertyWrapper
5
public struct UseAutoLayout<T: UIView> {
6
- var value: T
7
-
8
public var wrappedValue: T {
9
- get { return value }
10
- set { self.value.translatesAutoresizingMaskIntoConstraints = false }
+ didSet {
+ setAutoLayout()
+ }
11
}
12
13
public init(wrappedValue: T) {
14
- value = wrappedValue
+ self.wrappedValue = wrappedValue
15
16
+
17
+ func setAutoLayout() {
18
+ wrappedValue.translatesAutoresizingMaskIntoConstraints = false
19
20
21
#endif
0 commit comments