mirror of https://github.com/SnapKit/SnapKit
Merge branch 'develop' of github.com:SnapKit/SnapKit into develop
# Conflicts: # Source/ConstraintAttributes.swift
This commit is contained in:
commit
de954c0c12
|
@ -138,25 +138,25 @@ internal class ConcreteConstraint: Constraint {
|
|||
}
|
||||
|
||||
internal override func activate() -> Void {
|
||||
if NSLayoutConstraint.respondsToSelector("activateConstraints:") && self.installInfo != nil {
|
||||
guard #available(iOS 8.0, OSX 10.10, *), self.installInfo != nil else {
|
||||
self.install()
|
||||
return
|
||||
}
|
||||
let layoutConstraints = self.installInfo!.layoutConstraints.allObjects as! [LayoutConstraint]
|
||||
if layoutConstraints.count > 0 {
|
||||
NSLayoutConstraint.activateConstraints(layoutConstraints)
|
||||
}
|
||||
} else {
|
||||
self.install()
|
||||
}
|
||||
}
|
||||
|
||||
internal override func deactivate() -> Void {
|
||||
if NSLayoutConstraint.respondsToSelector("deactivateConstraints:") && self.installInfo != nil {
|
||||
guard #available(iOS 8.0, OSX 10.10, *), self.installInfo != nil else {
|
||||
self.install()
|
||||
return
|
||||
}
|
||||
let layoutConstraints = self.installInfo!.layoutConstraints.allObjects as! [LayoutConstraint]
|
||||
if layoutConstraints.count > 0 {
|
||||
NSLayoutConstraint.deactivateConstraints(layoutConstraints)
|
||||
}
|
||||
} else {
|
||||
self.uninstall()
|
||||
}
|
||||
}
|
||||
|
||||
private let fromItem: ConstraintItem
|
||||
|
|
Loading…
Reference in New Issue