From 57baa96dc749058af5c097d9447ff0df7801f055 Mon Sep 17 00:00:00 2001 From: Robert Payne Date: Thu, 23 Apr 2015 00:31:40 +1200 Subject: [PATCH] Removed 'final' declaration in attempt to fix odd crashes --- Source/Constraint.swift | 2 +- Source/ConstraintDescription.swift | 2 +- Source/ConstraintItem.swift | 2 +- Source/ConstraintMaker.swift | 2 +- Source/LayoutConstraint.swift | 2 +- Source/View+SnapKit.swift | 62 +++++++++++++++--------------- 6 files changed, 36 insertions(+), 36 deletions(-) diff --git a/Source/Constraint.swift b/Source/Constraint.swift index c470065..859e086 100644 --- a/Source/Constraint.swift +++ b/Source/Constraint.swift @@ -63,7 +63,7 @@ public class Constraint { /** Used internally to implement a ConcreteConstraint */ -final internal class ConcreteConstraint: Constraint { +internal class ConcreteConstraint: Constraint { internal override func updateOffset(amount: Float) -> Void { self.constant = amount diff --git a/Source/ConstraintDescription.swift b/Source/ConstraintDescription.swift index 75b14a5..ebbdb70 100644 --- a/Source/ConstraintDescription.swift +++ b/Source/ConstraintDescription.swift @@ -163,7 +163,7 @@ public protocol ConstraintDescriptionExtendable: ConstraintDescriptionRelatable /** Used to internally manage building constraint */ -final internal class ConstraintDescription: ConstraintDescriptionExtendable, ConstraintDescriptionEditable, ConstraintDescriptionFinalizable { +internal class ConstraintDescription: ConstraintDescriptionExtendable, ConstraintDescriptionEditable, ConstraintDescriptionFinalizable { internal var left: ConstraintDescriptionExtendable { return self.addConstraint(ConstraintAttributes.Left) } internal var top: ConstraintDescriptionExtendable { return self.addConstraint(ConstraintAttributes.Top) } diff --git a/Source/ConstraintItem.swift b/Source/ConstraintItem.swift index 9cab2bf..9dcfe11 100644 --- a/Source/ConstraintItem.swift +++ b/Source/ConstraintItem.swift @@ -30,7 +30,7 @@ import AppKit /** Used to assist in building a constraint */ -final public class ConstraintItem { +public class ConstraintItem { internal init(object: AnyObject?, attributes: ConstraintAttributes) { self.object = object diff --git a/Source/ConstraintMaker.swift b/Source/ConstraintMaker.swift index 8ab1e07..ca2d84c 100644 --- a/Source/ConstraintMaker.swift +++ b/Source/ConstraintMaker.swift @@ -30,7 +30,7 @@ import AppKit /** Used to make constraints */ -final public class ConstraintMaker { +public class ConstraintMaker { /// left edge public var left: ConstraintDescriptionExtendable { return self.makeConstraintDescription(ConstraintAttributes.Left) } diff --git a/Source/LayoutConstraint.swift b/Source/LayoutConstraint.swift index 835fba3..f6e3e20 100644 --- a/Source/LayoutConstraint.swift +++ b/Source/LayoutConstraint.swift @@ -30,7 +30,7 @@ import AppKit /** Used to add extra information to the actual `NSLayoutConstraint`'s that will UIKit/AppKit will utilize */ -final public class LayoutConstraint: NSLayoutConstraint { +public class LayoutConstraint: NSLayoutConstraint { internal var snp_constraint: Constraint? = nil diff --git a/Source/View+SnapKit.swift b/Source/View+SnapKit.swift index a6c297c..5141879 100644 --- a/Source/View+SnapKit.swift +++ b/Source/View+SnapKit.swift @@ -35,85 +35,85 @@ public typealias View = NSView public extension View { /// left edge - final public var snp_left: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.Left) } + public var snp_left: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.Left) } /// top edge - final public var snp_top: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.Top) } + public var snp_top: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.Top) } /// right edge - final public var snp_right: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.Right) } + public var snp_right: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.Right) } /// bottom edge - final public var snp_bottom: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.Bottom) } + public var snp_bottom: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.Bottom) } /// leading edge - final public var snp_leading: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.Leading) } + public var snp_leading: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.Leading) } /// trailing edge - final public var snp_trailing: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.Trailing) } + public var snp_trailing: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.Trailing) } /// width dimension - final public var snp_width: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.Width) } + public var snp_width: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.Width) } /// height dimension - final public var snp_height: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.Height) } + public var snp_height: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.Height) } /// centerX position - final public var snp_centerX: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.CenterX) } + public var snp_centerX: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.CenterX) } /// centerY position - final public var snp_centerY: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.CenterY) } + public var snp_centerY: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.CenterY) } /// baseline position - final public var snp_baseline: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.Baseline) } + public var snp_baseline: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.Baseline) } #if os(iOS) /// first baseline position - final public var snp_firstBaseline: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.FirstBaseline) } + public var snp_firstBaseline: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.FirstBaseline) } /// left margin - final public var snp_leftMargin: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.LeftMargin) } + public var snp_leftMargin: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.LeftMargin) } /// right margin - final public var snp_rightMargin: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.RightMargin) } + public var snp_rightMargin: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.RightMargin) } /// top margin - final public var snp_topMargin: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.TopMargin) } + public var snp_topMargin: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.TopMargin) } /// bottom margin - final public var snp_bottomMargin: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.BottomMargin) } + public var snp_bottomMargin: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.BottomMargin) } /// leading margin - final public var snp_leadingMargin: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.LeadingMargin) } + public var snp_leadingMargin: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.LeadingMargin) } /// trailing margin - final public var snp_trailingMargin: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.TrailingMargin) } + public var snp_trailingMargin: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.TrailingMargin) } /// centerX within margins - final public var snp_centerXWithinMargins: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.CenterXWithinMargins) } + public var snp_centerXWithinMargins: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.CenterXWithinMargins) } /// centerY within margins - final public var snp_centerYWithinMargins: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.CenterYWithinMargins) } + public var snp_centerYWithinMargins: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.CenterYWithinMargins) } #endif // top + left + bottom + right edges - final public var snp_edges: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.Edges) } + public var snp_edges: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.Edges) } // width + height dimensions - final public var snp_size: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.Size) } + public var snp_size: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.Size) } // centerX + centerY positions - final public var snp_center: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.Center) } + public var snp_center: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.Center) } #if os(iOS) // top + left + bottom + right margins - final public var snp_margins: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.Margins) } + public var snp_margins: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.Margins) } // centerX + centerY within margins - final public var snp_centerWithinMargins: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.CenterWithinMargins) } + public var snp_centerWithinMargins: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.CenterWithinMargins) } #endif @@ -124,7 +124,7 @@ public extension View { :returns: the constraints made */ - final public func snp_prepareConstraints(@noescape closure: (make: ConstraintMaker) -> Void) -> [Constraint] { + public func snp_prepareConstraints(@noescape closure: (make: ConstraintMaker) -> Void) -> [Constraint] { return ConstraintMaker.prepareConstraints(self, closure: closure) } @@ -133,7 +133,7 @@ public extension View { :param: closure that will be passed the `ConstraintMaker` to make the constraints with */ - final public func snp_makeConstraints(@noescape closure: (make: ConstraintMaker) -> Void) -> Void { + public func snp_makeConstraints(@noescape closure: (make: ConstraintMaker) -> Void) -> Void { ConstraintMaker.makeConstraints(self, closure: closure) } @@ -144,7 +144,7 @@ public extension View { :param: closure that will be passed the `ConstraintMaker` to update the constraints with */ - final public func snp_updateConstraints(@noescape closure: (make: ConstraintMaker) -> Void) -> Void { + public func snp_updateConstraints(@noescape closure: (make: ConstraintMaker) -> Void) -> Void { ConstraintMaker.updateConstraints(self, closure: closure) } @@ -153,18 +153,18 @@ public extension View { :param: closure that will be passed the `ConstraintMaker` to remake the constraints with */ - final public func snp_remakeConstraints(@noescape closure: (make: ConstraintMaker) -> Void) -> Void { + public func snp_remakeConstraints(@noescape closure: (make: ConstraintMaker) -> Void) -> Void { ConstraintMaker.remakeConstraints(self, closure: closure) } /** Removes all previously made constraints. */ - final public func snp_removeConstraints() { + public func snp_removeConstraints() { ConstraintMaker.removeConstraints(self) } - final internal var snp_installedLayoutConstraints: [LayoutConstraint] { + internal var snp_installedLayoutConstraints: [LayoutConstraint] { get { if let constraints = objc_getAssociatedObject(self, &installedLayoutConstraintsKey) as? [LayoutConstraint] { return constraints