Skip to content

Commit

Permalink
IBInspectable fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
OskarGroth committed Jul 14, 2018
1 parent c54689b commit 5d549ab
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 18 deletions.
12 changes: 0 additions & 12 deletions OGSwitch-Demo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@
750F2E511E5D2D7200C20E79 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
750F2E531E5D2D7200C20E79 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
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 = "<group>"; };
7553A35120F5045900EEA571 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -55,7 +53,6 @@
isa = PBXGroup;
children = (
750F2E4B1E5D2D7100C20E79 /* OGSwitchDemo */,
7553A34F20F5045900EEA571 /* OGSwitch */,
750F2E3A1E5D2CD000C20E79 /* Products */,
75256FE020FA5ABC00ED6782 /* Frameworks */,
);
Expand Down Expand Up @@ -88,15 +85,6 @@
name = Frameworks;
sourceTree = "<group>";
};
7553A34F20F5045900EEA571 /* OGSwitch */ = {
isa = PBXGroup;
children = (
7553A35020F5045900EEA571 /* OGSwitch.h */,
7553A35120F5045900EEA571 /* Info.plist */,
);
path = OGSwitch;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down
Binary file not shown.
16 changes: 10 additions & 6 deletions OGSwitch/OGSwitch/OGSwitch.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions OGSwitchDemo/Base.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,7 @@
<userDefinedRuntimeAttribute type="color" keyPath="disabledBackgroundColor">
<color key="value" red="1" green="0.40000000600000002" blue="0.40000000600000002" alpha="1" colorSpace="calibratedRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="boolean" keyPath="isEnabled" value="YES"/>
</userDefinedRuntimeAttributes>
<connections>
<action selector="switchPress:" target="Voe-Tx-rLC" id="Mqi-G6-fmv"/>
Expand Down

0 comments on commit 5d549ab

Please sign in to comment.