Skip to content

Commit 2a7ede0

Browse files
authored
Merge pull request #8 from Imperiopolis/swift3
Update for Swift 3.0 support
2 parents 7492fac + cb2b73f commit 2a7ede0

File tree

11 files changed

+596
-535
lines changed

11 files changed

+596
-535
lines changed

Example/Example.xcodeproj/project.pbxproj

Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,41 +8,42 @@
88

99
/* Begin PBXBuildFile section */
1010
2DA9AA831B3A0CD80084835F /* ExampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2DA9AA821B3A0CD80084835F /* ExampleViewController.swift */; };
11-
A8BB7AC0E356907F2B36D13D /* Pods.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BEA3A014976F265BB0DE9865 /* Pods.framework */; };
11+
A9381B7EE2C132722A26D63A /* Pods_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1B38BF979BC6E98E5044D90D /* Pods_Example.framework */; };
1212
D8093AC51AB6551800282415 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8093AC41AB6551800282415 /* AppDelegate.swift */; };
1313
D8093ACC1AB6551800282415 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D8093ACB1AB6551800282415 /* Images.xcassets */; };
1414
D8093ACF1AB6551800282415 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = D8093ACD1AB6551800282415 /* LaunchScreen.xib */; };
1515
/* End PBXBuildFile section */
1616

1717
/* Begin PBXFileReference section */
18-
1C1A2B087E92F8A9C959ED9D /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = "<group>"; };
18+
1B38BF979BC6E98E5044D90D /* Pods_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
1919
2DA9AA821B3A0CD80084835F /* ExampleViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExampleViewController.swift; sourceTree = "<group>"; };
20-
6F4238B79E847D77FE49F21E /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = "<group>"; };
2120
BEA3A014976F265BB0DE9865 /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; };
2221
D8093ABF1AB6551800282415 /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
2322
D8093AC31AB6551800282415 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
2423
D8093AC41AB6551800282415 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
2524
D8093ACB1AB6551800282415 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
2625
D8093ACE1AB6551800282415 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
26+
E0C7E0942F4D02C6AC5F9959 /* Pods-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig"; sourceTree = "<group>"; };
27+
FF2ED946E2EBF558737F0729 /* Pods-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-Example/Pods-Example.release.xcconfig"; sourceTree = "<group>"; };
2728
/* End PBXFileReference section */
2829

2930
/* Begin PBXFrameworksBuildPhase section */
3031
D8093ABC1AB6551800282415 /* Frameworks */ = {
3132
isa = PBXFrameworksBuildPhase;
3233
buildActionMask = 2147483647;
3334
files = (
34-
A8BB7AC0E356907F2B36D13D /* Pods.framework in Frameworks */,
35+
A9381B7EE2C132722A26D63A /* Pods_Example.framework in Frameworks */,
3536
);
3637
runOnlyForDeploymentPostprocessing = 0;
3738
};
3839
/* End PBXFrameworksBuildPhase section */
3940

4041
/* Begin PBXGroup section */
41-
9220C8FB3FD9CCF00672CD24 /* Pods */ = {
42+
58FB0DF7D21BFE8F993E02C4 /* Pods */ = {
4243
isa = PBXGroup;
4344
children = (
44-
6F4238B79E847D77FE49F21E /* Pods.debug.xcconfig */,
45-
1C1A2B087E92F8A9C959ED9D /* Pods.release.xcconfig */,
45+
E0C7E0942F4D02C6AC5F9959 /* Pods-Example.debug.xcconfig */,
46+
FF2ED946E2EBF558737F0729 /* Pods-Example.release.xcconfig */,
4647
);
4748
name = Pods;
4849
sourceTree = "<group>";
@@ -51,6 +52,7 @@
5152
isa = PBXGroup;
5253
children = (
5354
BEA3A014976F265BB0DE9865 /* Pods.framework */,
55+
1B38BF979BC6E98E5044D90D /* Pods_Example.framework */,
5456
);
5557
name = Frameworks;
5658
sourceTree = "<group>";
@@ -60,8 +62,8 @@
6062
children = (
6163
D8093AC11AB6551800282415 /* Example */,
6264
D8093AC01AB6551800282415 /* Products */,
63-
9220C8FB3FD9CCF00672CD24 /* Pods */,
6465
B923C92507DC8B4308CB0E1C /* Frameworks */,
66+
58FB0DF7D21BFE8F993E02C4 /* Pods */,
6567
);
6668
sourceTree = "<group>";
6769
};
@@ -100,12 +102,12 @@
100102
isa = PBXNativeTarget;
101103
buildConfigurationList = D8093AE01AB6551900282415 /* Build configuration list for PBXNativeTarget "Example" */;
102104
buildPhases = (
103-
56CCAAAE99958A1077BD8748 /* Check Pods Manifest.lock */,
105+
3989CC769E780B195AC67ADB /* [CP] Check Pods Manifest.lock */,
104106
D8093ABB1AB6551800282415 /* Sources */,
105107
D8093ABC1AB6551800282415 /* Frameworks */,
106108
D8093ABD1AB6551800282415 /* Resources */,
107-
0B2DC288EA58E7B04C9D5985 /* Copy Pods Resources */,
108-
BC1FF0666BC5171565E7F303 /* Embed Pods Frameworks */,
109+
6F77EE8946431C920EFB9009 /* [CP] Embed Pods Frameworks */,
110+
A9BD68359B1EE8AB2B6A2A0F /* [CP] Copy Pods Resources */,
109111
);
110112
buildRules = (
111113
);
@@ -127,6 +129,8 @@
127129
TargetAttributes = {
128130
D8093ABE1AB6551800282415 = {
129131
CreatedOnToolsVersion = 6.3;
132+
DevelopmentTeam = B2W6572NYZ;
133+
LastSwiftMigration = 0800;
130134
};
131135
};
132136
};
@@ -161,49 +165,49 @@
161165
/* End PBXResourcesBuildPhase section */
162166

163167
/* Begin PBXShellScriptBuildPhase section */
164-
0B2DC288EA58E7B04C9D5985 /* Copy Pods Resources */ = {
168+
3989CC769E780B195AC67ADB /* [CP] Check Pods Manifest.lock */ = {
165169
isa = PBXShellScriptBuildPhase;
166170
buildActionMask = 2147483647;
167171
files = (
168172
);
169173
inputPaths = (
170174
);
171-
name = "Copy Pods Resources";
175+
name = "[CP] Check Pods Manifest.lock";
172176
outputPaths = (
173177
);
174178
runOnlyForDeploymentPostprocessing = 0;
175179
shellPath = /bin/sh;
176-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n";
180+
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
177181
showEnvVarsInLog = 0;
178182
};
179-
56CCAAAE99958A1077BD8748 /* Check Pods Manifest.lock */ = {
183+
6F77EE8946431C920EFB9009 /* [CP] Embed Pods Frameworks */ = {
180184
isa = PBXShellScriptBuildPhase;
181185
buildActionMask = 2147483647;
182186
files = (
183187
);
184188
inputPaths = (
185189
);
186-
name = "Check Pods Manifest.lock";
190+
name = "[CP] Embed Pods Frameworks";
187191
outputPaths = (
188192
);
189193
runOnlyForDeploymentPostprocessing = 0;
190194
shellPath = /bin/sh;
191-
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
195+
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Example/Pods-Example-frameworks.sh\"\n";
192196
showEnvVarsInLog = 0;
193197
};
194-
BC1FF0666BC5171565E7F303 /* Embed Pods Frameworks */ = {
198+
A9BD68359B1EE8AB2B6A2A0F /* [CP] Copy Pods Resources */ = {
195199
isa = PBXShellScriptBuildPhase;
196200
buildActionMask = 2147483647;
197201
files = (
198202
);
199203
inputPaths = (
200204
);
201-
name = "Embed Pods Frameworks";
205+
name = "[CP] Copy Pods Resources";
202206
outputPaths = (
203207
);
204208
runOnlyForDeploymentPostprocessing = 0;
205209
shellPath = /bin/sh;
206-
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-frameworks.sh\"\n";
210+
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Example/Pods-Example-resources.sh\"\n";
207211
showEnvVarsInLog = 0;
208212
};
209213
/* End PBXShellScriptBuildPhase section */
@@ -235,18 +239,20 @@
235239
D8093AB91AB6543A00282415 /* Debug */ = {
236240
isa = XCBuildConfiguration;
237241
buildSettings = {
242+
SWIFT_VERSION = 3.0;
238243
};
239244
name = Debug;
240245
};
241246
D8093ABA1AB6543A00282415 /* Release */ = {
242247
isa = XCBuildConfiguration;
243248
buildSettings = {
249+
SWIFT_VERSION = 3.0;
244250
};
245251
name = Release;
246252
};
247253
D8093ADC1AB6551900282415 /* Debug */ = {
248254
isa = XCBuildConfiguration;
249-
baseConfigurationReference = 6F4238B79E847D77FE49F21E /* Pods.debug.xcconfig */;
255+
baseConfigurationReference = E0C7E0942F4D02C6AC5F9959 /* Pods-Example.debug.xcconfig */;
250256
buildSettings = {
251257
ALWAYS_SEARCH_USER_PATHS = NO;
252258
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
@@ -266,6 +272,7 @@
266272
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
267273
COPY_PHASE_STRIP = NO;
268274
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
275+
DEVELOPMENT_TEAM = B2W6572NYZ;
269276
ENABLE_STRICT_OBJC_MSGSEND = YES;
270277
GCC_C_LANGUAGE_STANDARD = gnu99;
271278
GCC_DYNAMIC_NO_PIC = NO;
@@ -290,13 +297,14 @@
290297
PRODUCT_NAME = "$(TARGET_NAME)";
291298
SDKROOT = iphoneos;
292299
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
300+
SWIFT_VERSION = 3.0;
293301
TARGETED_DEVICE_FAMILY = "1,2";
294302
};
295303
name = Debug;
296304
};
297305
D8093ADD1AB6551900282415 /* Release */ = {
298306
isa = XCBuildConfiguration;
299-
baseConfigurationReference = 1C1A2B087E92F8A9C959ED9D /* Pods.release.xcconfig */;
307+
baseConfigurationReference = FF2ED946E2EBF558737F0729 /* Pods-Example.release.xcconfig */;
300308
buildSettings = {
301309
ALWAYS_SEARCH_USER_PATHS = NO;
302310
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
@@ -316,6 +324,7 @@
316324
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
317325
COPY_PHASE_STRIP = NO;
318326
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
327+
DEVELOPMENT_TEAM = B2W6572NYZ;
319328
ENABLE_NS_ASSERTIONS = NO;
320329
ENABLE_STRICT_OBJC_MSGSEND = YES;
321330
GCC_C_LANGUAGE_STANDARD = gnu99;
@@ -332,6 +341,7 @@
332341
MTL_ENABLE_DEBUG_INFO = NO;
333342
PRODUCT_NAME = "$(TARGET_NAME)";
334343
SDKROOT = iphoneos;
344+
SWIFT_VERSION = 3.0;
335345
TARGETED_DEVICE_FAMILY = "1,2";
336346
VALIDATE_PRODUCT = YES;
337347
};

Example/Example/AppDelegate.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1414
var window: UIWindow?
1515

1616

17-
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
17+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
1818

19-
window = UIWindow(frame: UIScreen.mainScreen().bounds)
19+
window = UIWindow(frame: UIScreen.main.bounds)
2020

2121
window?.rootViewController = ExampleViewController()
2222
window?.makeKeyAndVisible()

Example/Example/ExampleViewController.swift

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,37 +20,36 @@ class ExampleViewController: UIViewController {
2020
// Create three views
2121
let view1 = UIView()
2222
view.addSubview(view1)
23-
view1.backgroundColor = .blueColor()
23+
view1.backgroundColor = .blue
2424
let view2 = UIView()
2525
view.addSubview(view2)
26-
view2.backgroundColor = .whiteColor()
26+
view2.backgroundColor = .white
2727
let view3 = UIView()
2828
view.addSubview(view3)
29-
view3.backgroundColor = .purpleColor()
29+
view3.backgroundColor = .purple
3030

3131
// Create 3 column constraints, disabled for now
32-
threeColumnConstraints += view1.applyLayout(.Vertical(), .Left() + 5, .Width() / 3 - 7.5)
33-
threeColumnConstraints += view2.applyLayout(.Vertical(), .Left() == .Right(view1) + 7.5, .Width() / 3 - 7.5)
34-
threeColumnConstraints += view3.applyLayout(.Vertical(), .Left() == .Right(view2) + 7.5, .Right() - 5)
32+
threeColumnConstraints += view1.applyLayout(.vertical, .left + 5, .width / 3 - 7.5)
33+
threeColumnConstraints += view2.applyLayout(.vertical, .left == .right(view1) + 7.5, .width / 3 - 7.5)
34+
threeColumnConstraints += view3.applyLayout(.vertical, .left == .right(view2) + 7.5, .right - 5)
3535

36-
NSLayoutConstraint.deactivateConstraints(threeColumnConstraints)
36+
NSLayoutConstraint.deactivate(threeColumnConstraints)
3737

3838
// Layout two views in two vertical columns. Save the constraints for future modification.
39-
twoColumnConstraints += view1.applyLayout(.Vertical(), .Left() + 5, .Width() / 2 - 7.5)
40-
twoColumnConstraints += view2.applyLayout(.Vertical(), .Left() == .Right(view1) + 7.5, .Right() - 5)
39+
twoColumnConstraints += view1.applyLayout(.vertical, .left + 5, .width / 2 - 7.5)
40+
twoColumnConstraints += view2.applyLayout(.vertical, .left == .right(view1) + 7.5, .right - 5)
4141

4242
// Third column off the right hand side
43-
twoColumnConstraints += view3.applyLayout(.Vertical(), .Right())
43+
twoColumnConstraints += view3.applyLayout(.vertical, .right)
4444

4545
// Animate in the third column after 2 seconds
46-
let delayTime = dispatch_time(DISPATCH_TIME_NOW,
47-
Int64(2 * Double(NSEC_PER_SEC)))
48-
dispatch_after(delayTime, dispatch_get_main_queue()) { [unowned self] in
49-
UIView.animateWithDuration(0.5) {
50-
NSLayoutConstraint.deactivateConstraints(self.twoColumnConstraints)
51-
NSLayoutConstraint.activateConstraints(self.threeColumnConstraints)
46+
let delayTime = DispatchTime.now() + Double(Int64(2 * Double(NSEC_PER_SEC))) / Double(NSEC_PER_SEC)
47+
DispatchQueue.main.asyncAfter(deadline: delayTime) { [unowned self] in
48+
UIView.animate(withDuration: 0.5, animations: {
49+
NSLayoutConstraint.deactivate(self.twoColumnConstraints)
50+
NSLayoutConstraint.activate(self.threeColumnConstraints)
5251
self.view.layoutIfNeeded()
53-
}
52+
})
5453
}
5554
}
5655
}

Example/Podfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
platform :ios, '8.0'
22
use_frameworks!
33

4-
pod 'Swiftly', :path => '../'
4+
target :Example do
5+
pod 'Swiftly', :path => '../'
6+
end

Example/Podfile.lock

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
PODS:
2-
- Swiftly (0.0.3)
2+
- Swiftly (0.1.0)
33

44
DEPENDENCIES:
55
- Swiftly (from `../`)
66

77
EXTERNAL SOURCES:
88
Swiftly:
9-
:path: ../
9+
:path: "../"
1010

1111
SPEC CHECKSUMS:
12-
Swiftly: fa74061bb4757666a3dbd675d3d76b60b762acb6
12+
Swiftly: 92568c3f59bf031019cf83fb07b17d758f0bb137
1313

14-
COCOAPODS: 0.39.0
14+
PODFILE CHECKSUM: d3728b59ebd101b754e070197a6df02e58c7a8a5
15+
16+
COCOAPODS: 1.1.0.rc.2

README.md

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,62 +4,77 @@
44
[![License](https://img.shields.io/cocoapods/l/Swiftly.svg?style=flat)](http://cocoadocs.org/docsets/Swiftly)
55
[![Platform](https://img.shields.io/cocoapods/p/Swiftly.svg?style=flat)](http://cocoadocs.org/docsets/Swiftly)
66

7-
Swiftly generate autolayout constraints.
7+
Swiftly generate Auto Layout constraints.
88

99
## Usage
1010

1111
To run the example project, simply run `pod try swiftly`. Alternatively, you can clone the repo and run the project in the example directory.
1212

13-
All `UIView`s and `UILayoutGuide`s respond to the `applyLayout` method which takes a variadic list of `Swiftly` objects. Convenience initializers are available which pair with all of Apple's `NSLayoutAttribute` types. Common combinatorial layout types `Flush`, `FlushToMargins`, `Vertical`, `Horizontal`, `Center`, and `Size` are also available.
13+
All `UIView`s and `UILayoutGuide`s respond to the `applyLayout` method which takes a variadic list of `Swiftly` objects. Convenience initializers are available which pair with all of Apple's `NSLayoutAttribute` types. Common combinatorial layout types `flush`, `flushToMargins`, `vertical`, `horizontal`, `center`, and `size` are also available.
1414

1515
```swift
16-
view.applyLayout(.CenterX(), .Vertical(), .Width() * 0.5)
16+
view.applyLayout(.centerX, .vertical, .width * 0.5)
1717
```
1818

1919
## Installation
2020

21-
Swiftly is available through [CocoaPods](http://cocoapods.org). To install
21+
### Cocoapods
22+
23+
Swiftly is available through [CocoaPods](https://cocoapods.org). To install
2224
it, simply add the following line to your Podfile:
2325

2426
```ruby
2527
pod "Swiftly"
2628
```
2729

30+
### Carthage
31+
32+
Swiftly is available through [Carthage](Swiftly/Swiftly.swift). To install
33+
it, simply add the following line to your Cartfile:
34+
35+
```ogdl
36+
github "Imperiopolis/Swiftly" ~> 1.0
37+
```
38+
39+
### Swift Version
40+
41+
Swiftly 0.2.0 and later require Swift 3.0. For older versions of Swift, please use the Swiftly 0.1.0 build.
42+
2843
## Custom Operators
2944

3045
Operators can be used on `Swiftly` objects to produce modified layouts. The `==`, `<=`, `>=`, `+`, `-`, `*`, `~=`, and `/` operators are available.
3146

3247
```swift
33-
view.applyLayout(.CenterX(), .Top() + 20, .Width() * 0.5, .Height() == 200)
48+
view.applyLayout(.centerX, .top + 20, .width * 0.5, .height == 200)
3449
```
3550

3651
## Setting Priority
3752

3853
The priority of `Swiftly` objects may be configured.
3954

4055
```swift
41-
view.applyLayout(.CenterY() ~= UILayoutPriorityRequired)
56+
view.applyLayout(.centerY ~= UILayoutPriorityRequired)
4257
```
4358

4459
## View Relationships
4560

4661
By default, layout types reference the views `superview`. To create a constraint relative to a sibling view pass that view as a paramter.
4762

4863
```swift
49-
view1.applyLayout(.Left() == .Right(view2) + 5, .Size(view2))
64+
view1.applyLayout(.left == .right(view2) + 5, .size(view2))
5065
```
5166

5267
## Constraint Manipulation
5368

54-
The `applyLayout` method returns an array of the generated `NSLayoutConstraint` objects, which can be used to later to easily disable or modify the generated constraints.
69+
The `applyLayout` method returns an array of the generated `LayoutConstraint` objects, which can be used to later to easily disable or modify the generated constraints.
5570

5671
```swift
57-
let constraints = view.applyLayout(.Size() == 5, .Center())
58-
NSLayoutConstraint.deactivateConstraints(constraints)
72+
let constraints = view.applyLayout(.size == 5, .center)
73+
NSLayoutConstraint.deactivate(constraints)
5974

6075
...
6176

62-
NSLayoutConstraint.activateConstraints(constraints)
77+
NSLayoutConstraint.activate(constraints)
6378

6479
```
6580

0 commit comments

Comments
 (0)