mirror of https://github.com/SnapKit/SnapKit
Add compiler condition to remove warnings when not using legacy deployment.
This commit is contained in:
parent
2afe4d47ec
commit
e84f9bc1c3
|
@ -315,11 +315,15 @@ internal class ConcreteConstraint: Constraint {
|
||||||
}
|
}
|
||||||
|
|
||||||
// add constraints
|
// add constraints
|
||||||
if #available(iOS 8.0, OSX 10.7, *) {
|
#if SNAPKIT_DEPLOYMENT_LEGACY && !os(OSX)
|
||||||
|
if #available(iOS 8.0, *) {
|
||||||
NSLayoutConstraint.activateConstraints(newLayoutConstraints)
|
NSLayoutConstraint.activateConstraints(newLayoutConstraints)
|
||||||
} else {
|
} else {
|
||||||
installOnView!.addConstraints(newLayoutConstraints)
|
installOnView!.addConstraints(newLayoutConstraints)
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
NSLayoutConstraint.activateConstraints(newLayoutConstraints)
|
||||||
|
#endif
|
||||||
|
|
||||||
// set install info
|
// set install info
|
||||||
self.installInfo = ConcreteConstraintInstallInfo(view: installOnView, layoutConstraints: NSHashTable.weakObjectsHashTable())
|
self.installInfo = ConcreteConstraintInstallInfo(view: installOnView, layoutConstraints: NSHashTable.weakObjectsHashTable())
|
||||||
|
@ -342,11 +346,15 @@ internal class ConcreteConstraint: Constraint {
|
||||||
|
|
||||||
if installedLayoutConstraints.count > 0 {
|
if installedLayoutConstraints.count > 0 {
|
||||||
// remove the constraints from the UIView's storage
|
// remove the constraints from the UIView's storage
|
||||||
if #available(iOS 8, OSX 10.7, *) {
|
#if SNAPKIT_DEPLOYMENT_LEGACY && !os(OSX)
|
||||||
|
if #available(iOS 8.0, *) {
|
||||||
NSLayoutConstraint.deactivateConstraints(installedLayoutConstraints)
|
NSLayoutConstraint.deactivateConstraints(installedLayoutConstraints)
|
||||||
} else if let installedOnView = installInfo.view {
|
} else if let installedOnView = installInfo.view {
|
||||||
installedOnView.removeConstraints(installedLayoutConstraints)
|
installedOnView.removeConstraints(installedLayoutConstraints)
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
NSLayoutConstraint.deactivateConstraints(installedLayoutConstraints)
|
||||||
|
#endif
|
||||||
|
|
||||||
// remove the constraints from the from item view
|
// remove the constraints from the from item view
|
||||||
if let fromView = self.fromItem.view {
|
if let fromView = self.fromItem.view {
|
||||||
|
|
Loading…
Reference in New Issue