diff --git a/OGSwitch-Demo.xcodeproj/project.pbxproj b/OGSwitch-Demo.xcodeproj/project.pbxproj index 7d366ad..56e58f3 100644 --- a/OGSwitch-Demo.xcodeproj/project.pbxproj +++ b/OGSwitch-Demo.xcodeproj/project.pbxproj @@ -35,8 +35,6 @@ 750F2E511E5D2D7200C20E79 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; 750F2E531E5D2D7200C20E79 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 75256FE120FA5ABC00ED6782 /* OGSwitch.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = OGSwitch.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 7553A35020F5045900EEA571 /* OGSwitch.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OGSwitch.h; sourceTree = ""; }; - 7553A35120F5045900EEA571 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -55,7 +53,6 @@ isa = PBXGroup; children = ( 750F2E4B1E5D2D7100C20E79 /* OGSwitchDemo */, - 7553A34F20F5045900EEA571 /* OGSwitch */, 750F2E3A1E5D2CD000C20E79 /* Products */, 75256FE020FA5ABC00ED6782 /* Frameworks */, ); @@ -88,15 +85,6 @@ name = Frameworks; sourceTree = ""; }; - 7553A34F20F5045900EEA571 /* OGSwitch */ = { - isa = PBXGroup; - children = ( - 7553A35020F5045900EEA571 /* OGSwitch.h */, - 7553A35120F5045900EEA571 /* Info.plist */, - ); - path = OGSwitch; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ diff --git a/OGSwitch.xcworkspace/xcuserdata/oskar.xcuserdatad/UserInterfaceState.xcuserstate b/OGSwitch.xcworkspace/xcuserdata/oskar.xcuserdatad/UserInterfaceState.xcuserstate index f2407e8..7fbfb34 100644 Binary files a/OGSwitch.xcworkspace/xcuserdata/oskar.xcuserdatad/UserInterfaceState.xcuserstate and b/OGSwitch.xcworkspace/xcuserdata/oskar.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/OGSwitch/OGSwitch/OGSwitch.swift b/OGSwitch/OGSwitch/OGSwitch.swift index 83164c8..d0f8c5f 100644 --- a/OGSwitch/OGSwitch/OGSwitch.swift +++ b/OGSwitch/OGSwitch/OGSwitch.swift @@ -49,7 +49,16 @@ import QuartzCore reloadLayer() } } - @IBInspectable public var ignoreRatio: Bool = false + @IBInspectable public var ignoreRatio: Bool = false { + didSet { + reloadLayer() + } + } + @IBInspectable public var isEnabled: Bool = true { + didSet { + reloadLayerAnimated(animated: true) + } + } let kBorderLineWidth:CGFloat = 1.0 let kGoldenRatio:CGFloat = 1.6180339875 @@ -69,11 +78,6 @@ import QuartzCore public var knobInsideLayer: CALayer? public var iconLayer = CALayer() public var lockInteraction: Bool = false - public var isEnabled: Bool = true { - didSet { - reloadLayerAnimated(animated: true) - } - } override public var acceptsFirstResponder: Bool { get { diff --git a/OGSwitchDemo/Base.lproj/MainMenu.xib b/OGSwitchDemo/Base.lproj/MainMenu.xib index c33d970..4da67aa 100644 --- a/OGSwitchDemo/Base.lproj/MainMenu.xib +++ b/OGSwitchDemo/Base.lproj/MainMenu.xib @@ -698,6 +698,7 @@ +