2016-01-26 18:49:04 +08:00
|
|
|
//
|
|
|
|
// SnapKit
|
|
|
|
//
|
|
|
|
// Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit
|
|
|
|
//
|
|
|
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
// of this software and associated documentation files (the "Software"), to deal
|
|
|
|
// in the Software without restriction, including without limitation the rights
|
|
|
|
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
// copies of the Software, and to permit persons to whom the Software is
|
|
|
|
// furnished to do so, subject to the following conditions:
|
|
|
|
//
|
|
|
|
// The above copyright notice and this permission notice shall be included in
|
|
|
|
// all copies or substantial portions of the Software.
|
|
|
|
//
|
|
|
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
// THE SOFTWARE.
|
|
|
|
|
|
|
|
#if os(iOS) || os(tvOS)
|
|
|
|
import UIKit
|
|
|
|
#else
|
|
|
|
import AppKit
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
public extension ConstraintView {
|
|
|
|
|
2019-11-27 18:26:43 +08:00
|
|
|
@available(*, deprecated, renamed:"snp.left")
|
2019-04-03 01:25:22 +08:00
|
|
|
var snp_left: ConstraintItem { return self.snp.left }
|
2016-01-26 18:49:04 +08:00
|
|
|
|
2019-11-27 18:26:43 +08:00
|
|
|
@available(*, deprecated, renamed:"snp.top")
|
2019-04-03 01:25:22 +08:00
|
|
|
var snp_top: ConstraintItem { return self.snp.top }
|
2016-01-26 18:49:04 +08:00
|
|
|
|
2019-11-27 18:26:43 +08:00
|
|
|
@available(*, deprecated, renamed:"snp.right")
|
2019-04-03 01:25:22 +08:00
|
|
|
var snp_right: ConstraintItem { return self.snp.right }
|
2016-01-26 18:49:04 +08:00
|
|
|
|
2019-11-27 18:26:43 +08:00
|
|
|
@available(*, deprecated, renamed:"snp.bottom")
|
2019-04-03 01:25:22 +08:00
|
|
|
var snp_bottom: ConstraintItem { return self.snp.bottom }
|
2016-01-26 18:49:04 +08:00
|
|
|
|
2019-11-27 18:26:43 +08:00
|
|
|
@available(*, deprecated, renamed:"snp.leading")
|
2019-04-03 01:25:22 +08:00
|
|
|
var snp_leading: ConstraintItem { return self.snp.leading }
|
2016-01-26 18:49:04 +08:00
|
|
|
|
2019-11-27 18:26:43 +08:00
|
|
|
@available(*, deprecated, renamed:"snp.trailing")
|
2019-04-03 01:25:22 +08:00
|
|
|
var snp_trailing: ConstraintItem { return self.snp.trailing }
|
2016-01-26 18:49:04 +08:00
|
|
|
|
2019-11-27 18:26:43 +08:00
|
|
|
@available(*, deprecated, renamed:"snp.width")
|
2019-04-03 01:25:22 +08:00
|
|
|
var snp_width: ConstraintItem { return self.snp.width }
|
2016-01-26 18:49:04 +08:00
|
|
|
|
2019-11-27 18:26:43 +08:00
|
|
|
@available(*, deprecated, renamed:"snp.height")
|
2019-04-03 01:25:22 +08:00
|
|
|
var snp_height: ConstraintItem { return self.snp.height }
|
2016-01-26 18:49:04 +08:00
|
|
|
|
2019-11-27 18:26:43 +08:00
|
|
|
@available(*, deprecated, renamed:"snp.centerX")
|
2019-04-03 01:25:22 +08:00
|
|
|
var snp_centerX: ConstraintItem { return self.snp.centerX }
|
2016-01-26 18:49:04 +08:00
|
|
|
|
2019-11-27 18:26:43 +08:00
|
|
|
@available(*, deprecated, renamed:"snp.centerY")
|
2019-04-03 01:25:22 +08:00
|
|
|
var snp_centerY: ConstraintItem { return self.snp.centerY }
|
2016-01-26 18:49:04 +08:00
|
|
|
|
2019-11-27 18:26:43 +08:00
|
|
|
@available(*, deprecated, renamed:"snp.baseline")
|
2019-04-03 01:25:22 +08:00
|
|
|
var snp_baseline: ConstraintItem { return self.snp.baseline }
|
2016-01-26 18:49:04 +08:00
|
|
|
|
2019-11-27 18:26:43 +08:00
|
|
|
@available(*, deprecated, renamed:"snp.lastBaseline")
|
2016-08-08 07:08:22 +08:00
|
|
|
@available(iOS 8.0, OSX 10.11, *)
|
2019-04-03 01:25:22 +08:00
|
|
|
var snp_lastBaseline: ConstraintItem { return self.snp.lastBaseline }
|
2016-08-03 10:39:47 +08:00
|
|
|
|
2019-11-27 18:26:43 +08:00
|
|
|
@available(iOS, deprecated, renamed:"snp.firstBaseline")
|
2016-08-03 10:39:47 +08:00
|
|
|
@available(iOS 8.0, OSX 10.11, *)
|
2019-04-03 01:25:22 +08:00
|
|
|
var snp_firstBaseline: ConstraintItem { return self.snp.firstBaseline }
|
2016-01-26 18:49:04 +08:00
|
|
|
|
2019-11-27 18:26:43 +08:00
|
|
|
@available(iOS, deprecated, renamed:"snp.leftMargin")
|
2016-08-06 18:38:02 +08:00
|
|
|
@available(iOS 8.0, *)
|
2019-04-03 01:25:22 +08:00
|
|
|
var snp_leftMargin: ConstraintItem { return self.snp.leftMargin }
|
2016-01-26 18:49:04 +08:00
|
|
|
|
2019-11-27 18:26:43 +08:00
|
|
|
@available(iOS, deprecated, renamed:"snp.topMargin")
|
2016-08-03 10:39:47 +08:00
|
|
|
@available(iOS 8.0, *)
|
2019-04-03 01:25:22 +08:00
|
|
|
var snp_topMargin: ConstraintItem { return self.snp.topMargin }
|
2016-01-26 18:49:04 +08:00
|
|
|
|
2019-11-27 18:26:43 +08:00
|
|
|
@available(iOS, deprecated, renamed:"snp.rightMargin")
|
2016-08-03 10:39:47 +08:00
|
|
|
@available(iOS 8.0, *)
|
2019-04-03 01:25:22 +08:00
|
|
|
var snp_rightMargin: ConstraintItem { return self.snp.rightMargin }
|
2016-01-26 18:49:04 +08:00
|
|
|
|
2019-11-27 18:26:43 +08:00
|
|
|
@available(iOS, deprecated, renamed:"snp.bottomMargin")
|
2016-08-03 10:39:47 +08:00
|
|
|
@available(iOS 8.0, *)
|
2019-04-03 01:25:22 +08:00
|
|
|
var snp_bottomMargin: ConstraintItem { return self.snp.bottomMargin }
|
2016-01-26 18:49:04 +08:00
|
|
|
|
2019-11-27 18:26:43 +08:00
|
|
|
@available(iOS, deprecated, renamed:"snp.leadingMargin")
|
2016-08-03 10:39:47 +08:00
|
|
|
@available(iOS 8.0, *)
|
2019-04-03 01:25:22 +08:00
|
|
|
var snp_leadingMargin: ConstraintItem { return self.snp.leadingMargin }
|
2016-01-26 18:49:04 +08:00
|
|
|
|
2019-11-27 18:26:43 +08:00
|
|
|
@available(iOS, deprecated, renamed:"snp.trailingMargin")
|
2016-08-03 10:39:47 +08:00
|
|
|
@available(iOS 8.0, *)
|
2019-04-03 01:25:22 +08:00
|
|
|
var snp_trailingMargin: ConstraintItem { return self.snp.trailingMargin }
|
2016-01-26 18:49:04 +08:00
|
|
|
|
2019-11-27 18:26:43 +08:00
|
|
|
@available(iOS, deprecated, renamed:"snp.centerXWithinMargins")
|
2016-08-03 10:39:47 +08:00
|
|
|
@available(iOS 8.0, *)
|
2019-04-03 01:25:22 +08:00
|
|
|
var snp_centerXWithinMargins: ConstraintItem { return self.snp.centerXWithinMargins }
|
2016-01-26 18:49:04 +08:00
|
|
|
|
2019-11-27 18:26:43 +08:00
|
|
|
@available(iOS, deprecated, renamed:"snp.centerYWithinMargins")
|
2016-08-03 10:39:47 +08:00
|
|
|
@available(iOS 8.0, *)
|
2019-04-03 01:25:22 +08:00
|
|
|
var snp_centerYWithinMargins: ConstraintItem { return self.snp.centerYWithinMargins }
|
2016-01-26 18:49:04 +08:00
|
|
|
|
2019-11-27 18:26:43 +08:00
|
|
|
@available(*, deprecated, renamed:"snp.edges")
|
2019-04-03 01:25:22 +08:00
|
|
|
var snp_edges: ConstraintItem { return self.snp.edges }
|
2016-01-26 18:49:04 +08:00
|
|
|
|
2019-11-27 18:26:43 +08:00
|
|
|
@available(*, deprecated, renamed:"snp.size")
|
2019-04-03 01:25:22 +08:00
|
|
|
var snp_size: ConstraintItem { return self.snp.size }
|
2016-01-26 18:49:04 +08:00
|
|
|
|
2019-11-27 18:26:43 +08:00
|
|
|
@available(*, deprecated, renamed:"snp.center")
|
2019-04-03 01:25:22 +08:00
|
|
|
var snp_center: ConstraintItem { return self.snp.center }
|
2016-01-26 18:49:04 +08:00
|
|
|
|
2019-11-27 18:26:43 +08:00
|
|
|
@available(iOS, deprecated, renamed:"snp.margins")
|
2016-08-03 10:39:47 +08:00
|
|
|
@available(iOS 8.0, *)
|
2019-04-03 01:25:22 +08:00
|
|
|
var snp_margins: ConstraintItem { return self.snp.margins }
|
2016-01-26 18:49:04 +08:00
|
|
|
|
2019-11-27 18:26:43 +08:00
|
|
|
@available(iOS, deprecated, renamed:"snp.centerWithinMargins")
|
2016-08-03 10:39:47 +08:00
|
|
|
@available(iOS 8.0, *)
|
2019-04-03 01:25:22 +08:00
|
|
|
var snp_centerWithinMargins: ConstraintItem { return self.snp.centerWithinMargins }
|
2016-01-26 18:49:04 +08:00
|
|
|
|
2019-11-27 18:26:43 +08:00
|
|
|
@available(*, deprecated, renamed:"snp.prepareConstraints(_:)")
|
2019-04-03 01:25:22 +08:00
|
|
|
func snp_prepareConstraints(_ closure: (_ make: ConstraintMaker) -> Void) -> [Constraint] {
|
2016-06-28 20:31:43 +08:00
|
|
|
return self.snp.prepareConstraints(closure)
|
2016-01-26 18:49:04 +08:00
|
|
|
}
|
|
|
|
|
2019-11-27 18:26:43 +08:00
|
|
|
@available(*, deprecated, renamed:"snp.makeConstraints(_:)")
|
2019-04-03 01:25:22 +08:00
|
|
|
func snp_makeConstraints(_ closure: (_ make: ConstraintMaker) -> Void) {
|
2016-06-28 20:31:43 +08:00
|
|
|
self.snp.makeConstraints(closure)
|
2016-01-26 18:49:04 +08:00
|
|
|
}
|
|
|
|
|
2019-11-27 18:26:43 +08:00
|
|
|
@available(*, deprecated, renamed:"snp.remakeConstraints(_:)")
|
2019-04-03 01:25:22 +08:00
|
|
|
func snp_remakeConstraints(_ closure: (_ make: ConstraintMaker) -> Void) {
|
2016-06-28 20:31:43 +08:00
|
|
|
self.snp.remakeConstraints(closure)
|
2016-01-26 18:49:04 +08:00
|
|
|
}
|
|
|
|
|
2019-11-27 18:26:43 +08:00
|
|
|
@available(*, deprecated, renamed:"snp.updateConstraints(_:)")
|
2019-04-03 01:25:22 +08:00
|
|
|
func snp_updateConstraints(_ closure: (_ make: ConstraintMaker) -> Void) {
|
2016-06-28 20:31:43 +08:00
|
|
|
self.snp.updateConstraints(closure)
|
2016-01-26 18:49:04 +08:00
|
|
|
}
|
|
|
|
|
2019-11-27 18:26:43 +08:00
|
|
|
@available(*, deprecated, renamed:"snp.removeConstraints()")
|
2019-04-03 01:25:22 +08:00
|
|
|
func snp_removeConstraints() {
|
2016-01-26 18:49:04 +08:00
|
|
|
self.snp.removeConstraints()
|
|
|
|
}
|
|
|
|
|
2019-04-03 01:25:22 +08:00
|
|
|
var snp: ConstraintViewDSL {
|
2016-01-26 18:49:04 +08:00
|
|
|
return ConstraintViewDSL(view: self)
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|