We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e50c8f6 commit f33418bCopy full SHA for f33418b
Sources/Swutil/Util/UsesAutoLayout.swift
@@ -0,0 +1,24 @@
1
+//
2
+// UsesAutoLayout.swift
3
+// Swutil
4
5
+// Created by Lucas Fernandez Nicolau on 25/08/22.
6
7
+// Source: https://www.avanderlee.com/swift/auto-layout-programmatically/
8
9
+
10
+import UIKit
11
12
+@propertyWrapper
13
+public final class UsesAutoLayout<T: UIView> {
14
+ public var wrappedValue: T {
15
+ didSet {
16
+ wrappedValue.translatesAutoresizingMaskIntoConstraints = false
17
+ }
18
19
20
+ public init(wrappedValue: T) {
21
+ self.wrappedValue = wrappedValue
22
23
24
+}
0 commit comments