diff --git a/OGSwitch.xcodeproj/project.pbxproj b/OGSwitch.xcodeproj/project.pbxproj index 8edce10..7040a4a 100644 --- a/OGSwitch.xcodeproj/project.pbxproj +++ b/OGSwitch.xcodeproj/project.pbxproj @@ -8,12 +8,23 @@ /* Begin PBXBuildFile section */ 750F2E3E1E5D2CD000C20E79 /* OGSwitch.h in Headers */ = {isa = PBXBuildFile; fileRef = 750F2E3C1E5D2CD000C20E79 /* OGSwitch.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 750F2E451E5D2CE100C20E79 /* OGSwitch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 750F2E441E5D2CE100C20E79 /* OGSwitch.swift */; }; + 750F2E4D1E5D2D7100C20E79 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 750F2E4C1E5D2D7100C20E79 /* AppDelegate.swift */; }; + 750F2E4F1E5D2D7100C20E79 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 750F2E4E1E5D2D7100C20E79 /* Assets.xcassets */; }; + 750F2E521E5D2D7200C20E79 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 750F2E501E5D2D7200C20E79 /* MainMenu.xib */; }; + 750F2E581E5D2F6300C20E79 /* OGSwitch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 750F2E441E5D2CE100C20E79 /* OGSwitch.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ 750F2E391E5D2CD000C20E79 /* OGSwitch.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = OGSwitch.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 750F2E3C1E5D2CD000C20E79 /* OGSwitch.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OGSwitch.h; sourceTree = ""; }; 750F2E3D1E5D2CD000C20E79 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 750F2E441E5D2CE100C20E79 /* OGSwitch.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OGSwitch.swift; sourceTree = ""; }; + 750F2E4A1E5D2D7100C20E79 /* OGSwitchDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OGSwitchDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 750F2E4C1E5D2D7100C20E79 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 750F2E4E1E5D2D7100C20E79 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 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 = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -24,6 +35,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 750F2E471E5D2D7100C20E79 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -31,6 +49,7 @@ isa = PBXGroup; children = ( 750F2E3B1E5D2CD000C20E79 /* OGSwitch */, + 750F2E4B1E5D2D7100C20E79 /* OGSwitchDemo */, 750F2E3A1E5D2CD000C20E79 /* Products */, ); sourceTree = ""; @@ -39,6 +58,7 @@ isa = PBXGroup; children = ( 750F2E391E5D2CD000C20E79 /* OGSwitch.framework */, + 750F2E4A1E5D2D7100C20E79 /* OGSwitchDemo.app */, ); name = Products; sourceTree = ""; @@ -47,11 +67,23 @@ isa = PBXGroup; children = ( 750F2E3C1E5D2CD000C20E79 /* OGSwitch.h */, + 750F2E441E5D2CE100C20E79 /* OGSwitch.swift */, 750F2E3D1E5D2CD000C20E79 /* Info.plist */, ); path = OGSwitch; sourceTree = ""; }; + 750F2E4B1E5D2D7100C20E79 /* OGSwitchDemo */ = { + isa = PBXGroup; + children = ( + 750F2E4C1E5D2D7100C20E79 /* AppDelegate.swift */, + 750F2E4E1E5D2D7100C20E79 /* Assets.xcassets */, + 750F2E501E5D2D7200C20E79 /* MainMenu.xib */, + 750F2E531E5D2D7200C20E79 /* Info.plist */, + ); + path = OGSwitchDemo; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -84,16 +116,40 @@ productReference = 750F2E391E5D2CD000C20E79 /* OGSwitch.framework */; productType = "com.apple.product-type.framework"; }; + 750F2E491E5D2D7100C20E79 /* OGSwitchDemo */ = { + isa = PBXNativeTarget; + buildConfigurationList = 750F2E541E5D2D7200C20E79 /* Build configuration list for PBXNativeTarget "OGSwitchDemo" */; + buildPhases = ( + 750F2E461E5D2D7100C20E79 /* Sources */, + 750F2E471E5D2D7100C20E79 /* Frameworks */, + 750F2E481E5D2D7100C20E79 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = OGSwitchDemo; + productName = OGSwitchDemo; + productReference = 750F2E4A1E5D2D7100C20E79 /* OGSwitchDemo.app */; + productType = "com.apple.product-type.application"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 750F2E301E5D2CD000C20E79 /* Project object */ = { isa = PBXProject; attributes = { + LastSwiftUpdateCheck = 0820; LastUpgradeCheck = 0820; ORGANIZATIONNAME = "Oskar Groth"; TargetAttributes = { 750F2E381E5D2CD000C20E79 = { + CreatedOnToolsVersion = 8.2.1; + DevelopmentTeam = ZQK6SX26CE; + LastSwiftMigration = 0820; + ProvisioningStyle = Automatic; + }; + 750F2E491E5D2D7100C20E79 = { CreatedOnToolsVersion = 8.2.1; DevelopmentTeam = ZQK6SX26CE; ProvisioningStyle = Automatic; @@ -106,6 +162,7 @@ hasScannedForEncodings = 0; knownRegions = ( en, + Base, ); mainGroup = 750F2E2F1E5D2CD000C20E79; productRefGroup = 750F2E3A1E5D2CD000C20E79 /* Products */; @@ -113,6 +170,7 @@ projectRoot = ""; targets = ( 750F2E381E5D2CD000C20E79 /* OGSwitch */, + 750F2E491E5D2D7100C20E79 /* OGSwitchDemo */, ); }; /* End PBXProject section */ @@ -125,6 +183,15 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 750F2E481E5D2D7100C20E79 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 750F2E4F1E5D2D7100C20E79 /* Assets.xcassets in Resources */, + 750F2E521E5D2D7200C20E79 /* MainMenu.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -132,11 +199,32 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 750F2E451E5D2CE100C20E79 /* OGSwitch.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 750F2E461E5D2D7100C20E79 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 750F2E4D1E5D2D7100C20E79 /* AppDelegate.swift in Sources */, + 750F2E581E5D2F6300C20E79 /* OGSwitch.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXVariantGroup section */ + 750F2E501E5D2D7200C20E79 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 750F2E511E5D2D7200C20E79 /* Base */, + ); + name = MainMenu.xib; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + /* Begin XCBuildConfiguration section */ 750F2E3F1E5D2CD000C20E79 /* Debug */ = { isa = XCBuildConfiguration; @@ -237,6 +325,7 @@ 750F2E421E5D2CD000C20E79 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = ""; COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; @@ -251,6 +340,7 @@ PRODUCT_BUNDLE_IDENTIFIER = org.cindori.OGSwitch; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 3.0; }; name = Debug; @@ -258,6 +348,7 @@ 750F2E431E5D2CD000C20E79 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = ""; COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; @@ -276,6 +367,34 @@ }; name = Release; }; + 750F2E551E5D2D7200C20E79 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = ZQK6SX26CE; + INFOPLIST_FILE = OGSwitchDemo/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = org.cindori.OGSwitchDemo; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; + }; + name = Debug; + }; + 750F2E561E5D2D7200C20E79 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = ZQK6SX26CE; + INFOPLIST_FILE = OGSwitchDemo/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = org.cindori.OGSwitchDemo; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -296,6 +415,14 @@ ); defaultConfigurationIsVisible = 0; }; + 750F2E541E5D2D7200C20E79 /* Build configuration list for PBXNativeTarget "OGSwitchDemo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 750F2E551E5D2D7200C20E79 /* Debug */, + 750F2E561E5D2D7200C20E79 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; /* End XCConfigurationList section */ }; rootObject = 750F2E301E5D2CD000C20E79 /* Project object */; diff --git a/OGSwitch.xcodeproj/xcuserdata/oskar.xcuserdatad/xcschemes/OGSwitch.xcscheme b/OGSwitch.xcodeproj/xcshareddata/xcschemes/OGSwitch.xcscheme similarity index 52% rename from OGSwitch.xcodeproj/xcuserdata/oskar.xcuserdatad/xcschemes/OGSwitch.xcscheme rename to OGSwitch.xcodeproj/xcshareddata/xcschemes/OGSwitch.xcscheme index b422b1d..43847ee 100644 --- a/OGSwitch.xcodeproj/xcuserdata/oskar.xcuserdatad/xcschemes/OGSwitch.xcscheme +++ b/OGSwitch.xcodeproj/xcshareddata/xcschemes/OGSwitch.xcscheme @@ -5,6 +5,22 @@ + + + + + + + + + + @@ -35,6 +60,15 @@ savedToolIdentifier = "" useCustomWorkingDirectory = "NO" debugDocumentVersioning = "YES"> + + + + diff --git a/OGSwitch.xcodeproj/xcuserdata/oskar.xcuserdatad/xcschemes/OGSwitchDemo.xcscheme b/OGSwitch.xcodeproj/xcuserdata/oskar.xcuserdatad/xcschemes/OGSwitchDemo.xcscheme new file mode 100644 index 0000000..6152409 --- /dev/null +++ b/OGSwitch.xcodeproj/xcuserdata/oskar.xcuserdatad/xcschemes/OGSwitchDemo.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OGSwitch.xcodeproj/xcuserdata/oskar.xcuserdatad/xcschemes/xcschememanagement.plist b/OGSwitch.xcodeproj/xcuserdata/oskar.xcuserdatad/xcschemes/xcschememanagement.plist index 49663eb..647c48e 100644 --- a/OGSwitch.xcodeproj/xcuserdata/oskar.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/OGSwitch.xcodeproj/xcuserdata/oskar.xcuserdatad/xcschemes/xcschememanagement.plist @@ -4,11 +4,16 @@ SchemeUserState - OGSwitch.xcscheme + OGSwitch.xcscheme_^#shared#^_ orderHint 0 + OGSwitchDemo.xcscheme + + orderHint + 1 + SuppressBuildableAutocreation @@ -17,6 +22,11 @@ primary + 750F2E491E5D2D7100C20E79 + + primary + + diff --git a/OGSwitch/OGSwitch.swift b/OGSwitch/OGSwitch.swift new file mode 100644 index 0000000..5ef18c7 --- /dev/null +++ b/OGSwitch/OGSwitch.swift @@ -0,0 +1,234 @@ +// +// OGSwitch.swift +// OGSwitch +// +// Created by Oskar Groth on 2017-02-22. +// Copyright © 2017 Oskar Groth. All rights reserved. +// + +import Cocoa +import QuartzCore + +public class OGSwitch : NSControl { + + @IBInspectable public var tintColor: NSColor = NSColor(calibratedRed:0.27, green: 0.86, blue: 0.36, alpha: 1.0) + @IBInspectable public var knobBackgroundColor: NSColor = NSColor(calibratedWhite:1.0, alpha: 1.0) + @IBInspectable public var disabledBorderColor: NSColor = NSColor(calibratedWhite: 0.0, alpha: 0.2) + @IBInspectable public var disabledBackgroundColor: NSColor = NSColor.clear + @IBInspectable public var inactiveBackgroundColor: NSColor = NSColor(calibratedWhite: 0.0, alpha:0.3) + @IBInspectable public var animationDuration: TimeInterval = 0.4 + + let kBorderLineWidth:CGFloat = 1.0 + let kGoldenRatio:CGFloat = 1.6180339875 + let kDecreasedGoldenRatio:CGFloat = 1.38 + let kEnabledOpacity:Float = 1.0 + let kDisabledOpacity:Float = 0.5 + public var isOn:Bool = true + public var isActive:Bool = false + public var hasDragged:Bool = false + public var isDraggingTowardsOn:Bool = false + public var rootLayer:CALayer? + public var backgroundLayer:CALayer? + public var knobLayer: CALayer? + public var knobInsideLayer: CALayer? + + override public var acceptsFirstResponder: Bool { + get { + return true + } + } + + required public init?(coder:NSCoder) { + super.init(coder: coder) + + setup() + } + + override init(frame:NSRect) { + super.init(frame: frame); + + setup() + } + + internal func setup() { + isEnabled = true + setupLayers() + } + + internal func setupLayers() { + rootLayer = CALayer() + layer = rootLayer + + wantsLayer = true + + backgroundLayer = CALayer() + backgroundLayer!.autoresizingMask = [.layerWidthSizable, .layerHeightSizable] + backgroundLayer!.bounds = rootLayer!.bounds + backgroundLayer!.anchorPoint = CGPoint(x: 0.0, y: 0.0) + backgroundLayer!.borderWidth = kBorderLineWidth + + rootLayer!.addSublayer(backgroundLayer!) + + knobLayer = CALayer() + knobLayer!.frame = rectForKnob() + knobLayer!.autoresizingMask = CAAutoresizingMask.layerHeightSizable + knobLayer!.backgroundColor = knobBackgroundColor.cgColor + knobLayer!.shadowColor = NSColor.black.cgColor + knobLayer!.shadowOffset = CGSize(width:0.0, height:-2.0) + knobLayer!.shadowRadius = 1.0 + knobLayer!.shadowOpacity = 0.3 + rootLayer!.addSublayer(knobLayer!) + + knobInsideLayer = CALayer() + knobInsideLayer!.frame = knobLayer!.bounds + knobInsideLayer!.autoresizingMask = [.layerHeightSizable, .layerWidthSizable] + + knobInsideLayer!.shadowColor = NSColor.black.cgColor + knobInsideLayer!.shadowOffset = CGSize(width:0.0, height:0.0) + knobInsideLayer!.backgroundColor = NSColor.white.cgColor + knobInsideLayer!.shadowRadius = 1.0 + knobInsideLayer!.shadowOpacity = 0.35 + knobLayer!.addSublayer(knobInsideLayer!) + + reloadLayerSize() + reloadLayer() + } + + internal func reloadLayerSize() { + CATransaction.begin() + CATransaction.setDisableActions(true) + + knobLayer!.frame = rectForKnob() + knobInsideLayer!.frame = knobLayer!.bounds + + backgroundLayer!.cornerRadius = backgroundLayer!.bounds.size.height / 2.0 + knobLayer!.cornerRadius = knobLayer!.bounds.size.height / 2.0 + knobInsideLayer!.cornerRadius = knobLayer!.bounds.size.height / 2.0 + + CATransaction.commit() + } + + public func reloadLayerAnimated(animated: Bool) { + CATransaction.begin() + CATransaction.setAnimationDuration(animated ? animationDuration : 0) + + if (hasDragged && isDraggingTowardsOn) || (!hasDragged && isOn) { + backgroundLayer!.borderColor = tintColor.cgColor + backgroundLayer!.backgroundColor = tintColor.cgColor + } + else { + backgroundLayer!.borderColor = disabledBorderColor.cgColor + backgroundLayer!.backgroundColor = disabledBackgroundColor.cgColor + } + + if isEnabled { + rootLayer!.opacity = kEnabledOpacity + } + else { + rootLayer!.opacity = kDisabledOpacity + } + + if hasDragged { + let function = CAMediaTimingFunction(controlPoints: 0.25, 1.5, 0.5, 1) + CATransaction.setAnimationTimingFunction(function) + } + + knobLayer!.frame = rectForKnob() + knobInsideLayer!.frame = knobLayer!.bounds + + CATransaction.commit() + } + + public func reloadLayer() { + reloadLayerAnimated(animated: true) + } + + internal func knobHeightForSize(_ size:NSSize) -> CGFloat { + return size.height - kBorderLineWidth * 2.0; + } + + internal func rectForKnob()->CGRect { + let height = knobHeightForSize(backgroundLayer!.bounds.size) + var width = 0.0 + + let bounds: CGRect = backgroundLayer!.bounds + + if isActive { + width = Double((bounds.width - 2.0 * kBorderLineWidth) / kGoldenRatio) + } + else { + width = Double((bounds.width - 2.0 * kBorderLineWidth) / kDecreasedGoldenRatio) + } + + var x:CGFloat = 0 + if (!hasDragged && !isOn) || (hasDragged && !isDraggingTowardsOn) { + x = kBorderLineWidth + } + else { + x = bounds.width - CGFloat(width) - kBorderLineWidth + } + + return CGRect(x: x, y: kBorderLineWidth, width: CGFloat(width), height: height) + } + + override public func setFrameSize(_ newSize: NSSize) { + super.setFrameSize(newSize) + + reloadLayerSize() + } + + override public func acceptsFirstMouse(for theEvent: NSEvent!) -> Bool { + return true + } + + + override public func mouseDown(with theEvent: NSEvent) { + if !isEnabled { + return + } + isActive = true + reloadLayer() + } + + override public func mouseDragged(with theEvent: NSEvent) { + if !isEnabled { + return + } + + hasDragged = true + + let draggingPoint = convert(theEvent.locationInWindow, from: nil) + isDraggingTowardsOn = draggingPoint.x > bounds.width / 2.0 + reloadLayer() + } + + override public func mouseUp(with theEvent: NSEvent) { + if !isEnabled { + return + } + + var on = isOn + isActive = false + if hasDragged { + on = isDraggingTowardsOn + } + else { + on = !isOn + } + + if isOn != on { + Swift.print("Now: \(on)") + if action != nil { + NSApp.sendAction(action!, to: target, from: self) + } + } + + isOn = on + + hasDragged = false + isDraggingTowardsOn = false + + reloadLayer() + } + +} diff --git a/OGSwitchDemo/AppDelegate.swift b/OGSwitchDemo/AppDelegate.swift new file mode 100644 index 0000000..cd715c3 --- /dev/null +++ b/OGSwitchDemo/AppDelegate.swift @@ -0,0 +1,27 @@ +// +// AppDelegate.swift +// OGSwitchDemo +// +// Created by Oskar Groth on 2017-02-22. +// Copyright © 2017 Oskar Groth. All rights reserved. +// + +import Cocoa + +@NSApplicationMain +class AppDelegate: NSObject, NSApplicationDelegate { + + @IBOutlet weak var window: NSWindow! + + + func applicationDidFinishLaunching(_ aNotification: Notification) { + // Insert code here to initialize your application + } + + func applicationWillTerminate(_ aNotification: Notification) { + // Insert code here to tear down your application + } + + +} + diff --git a/OGSwitchDemo/Assets.xcassets/AppIcon.appiconset/Contents.json b/OGSwitchDemo/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..2db2b1c --- /dev/null +++ b/OGSwitchDemo/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,58 @@ +{ + "images" : [ + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/OGSwitchDemo/Base.lproj/MainMenu.xib b/OGSwitchDemo/Base.lproj/MainMenu.xib new file mode 100644 index 0000000..06aafef --- /dev/null +++ b/OGSwitchDemo/Base.lproj/MainMenu.xib @@ -0,0 +1,700 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OGSwitchDemo/Info.plist b/OGSwitchDemo/Info.plist new file mode 100644 index 0000000..df21679 --- /dev/null +++ b/OGSwitchDemo/Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + Copyright © 2017 Oskar Groth. All rights reserved. + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + +