45 Commits

Author SHA1 Message Date
Oskar a4e1d06b19 Public inits 2018-08-08 21:41:57 +02:00
Oskar 79209bca05 Merge branch 'master' of https://github.com/OskarGroth/OGSwitch 2018-08-08 21:32:10 +02:00
Oskar 2004091f18 Improve border and add size classes 2018-08-08 21:32:00 +02:00
Oskar Groth be0bd0211b Update README.md 2018-08-05 11:59:30 +02:00
Oskar 3f6129964e Extend NSControl 2018-08-05 11:56:14 +02:00
Oskar Groth 352f7c8ad2 Update README.md 2018-07-14 19:23:56 +02:00
Oskar Groth 52781c2335 Update README.md 2018-07-14 19:23:47 +02:00
Oskar 6adaab83d6 Title 2018-07-14 19:22:38 +02:00
Oskar 5d549ab629 IBInspectable fixes 2018-07-14 19:19:54 +02:00
Oskar c54689bccc Merge branch 'master' of https://github.com/OskarGroth/OGSwitch 2018-07-14 19:15:14 +02:00
Oskar 5ddc45e132 Remove podspec 2018-07-14 19:15:03 +02:00
Oskar Groth 9bc2acc5f4 Update README.md 2018-07-14 19:13:09 +02:00
Oskar Groth d103720de4 Update 2018-07-14 19:08:46 +02:00
Oskar 09cd2cd79c IBDesignable 2018-07-14 19:06:11 +02:00
Oskar 4c2a062a71 Swift header 2018-07-14 18:54:12 +02:00
Oskar c70ed728d3 Gitignore 2018-07-14 18:24:49 +02:00
Oskar 12a6cb6afe Improve project structure (workspace) 2018-07-14 18:24:00 +02:00
Oskar 0a73d77643 Merge branch 'master' of https://github.com/OskarGroth/OGSwitch 2018-07-10 17:40:33 +02:00
Oskar de2f2f2f29 Add swift header 2018-07-10 17:40:31 +02:00
Oskar Groth 54df55d873 Typo 2018-07-10 17:23:27 +02:00
Oskar Groth 5ea6de9f9c Carthage 2018-07-10 17:22:19 +02:00
Oskar 8333545660 Swift 4.1, carthage support 2018-07-10 17:19:15 +02:00
Oskar Groth 4be5d991d6 Merge pull request #2 from briankeane/fixInitialValues
add awakeFromNib to make sure ibdesignable elements are refreshed wit…
2018-02-26 16:55:12 +01:00
OskarGroth d0e5cfa4d6 Swift 4 2017-11-04 18:14:18 +01:00
briankeane f9159b1121 add awakeFromNib to make sure ibdesignable elements are refreshed with newly set values 2017-10-19 10:02:30 -05:00
OskarGroth 2641ba660d 10.13 fix 2017-06-15 10:38:04 +02:00
OskarGroth 2cebd10d55 Remove print, deployment 2017-05-29 11:07:22 +02:00
Oskar Groth 5de3413003 Update README.md 2017-05-21 16:34:31 +02:00
Oskar Groth 1b189433da Update README.md 2017-05-21 16:34:21 +02:00
Oskar Groth 64efed6619 Credit 2017-05-21 16:33:08 +02:00
OskarGroth 127d4cd6ab New demo/screenshot 2017-05-21 16:28:28 +02:00
OskarGroth b575f97bde Screenshot 2017-05-21 14:09:14 +02:00
OskarGroth 315867ebb2 Fix for 10.9 2017-05-21 13:58:10 +02:00
Oskar Groth cf4468cb36 Create README.md 2017-05-21 13:51:41 +02:00
Oskar Groth 9536f15b16 Disabled styling 2017-04-18 10:49:35 +02:00
Oskar Groth 7538b3f2f4 Disabled opacity lower 2017-04-18 10:45:24 +02:00
Oskar Groth 19026b39f2 Pod bump 2017-04-11 11:20:54 +02:00
Oskar Groth 1e0dabd686 isEnabled animation 2017-04-11 11:20:06 +02:00
Oskar Groth 32f6a6d397 Pod 2017-04-10 09:57:24 +02:00
Oskar Groth 0523e2578c SetOn 2017-04-10 09:56:21 +02:00
Oskar Groth 2e199eed4d Initial coloring, IBVar reloads 2017-04-08 14:22:18 +02:00
Oskar Groth 4b50636ab8 Podspec 2017-04-08 14:17:09 +02:00
Oskar Groth 4cef47a199 Action correct status fix 2017-04-08 14:13:16 +02:00
Oskar Groth 3707a7070d Prints, states 2017-02-26 22:00:28 +11:00
Oskar Groth f9659ddd83 Podfile 2017-02-26 20:29:18 +11:00
27 changed files with 839 additions and 302 deletions
+71
View File
@@ -0,0 +1,71 @@
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## Build generated
build/
DerivedData/
## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/
## Other
*.moved-aside
*.xccheckout
*.xcscmblueprint
## Obj-C/Swift specific
*.hmap
*.ipa
*.dSYM.zip
*.dSYM
## Playgrounds
timeline.xctimeline
playground.xcworkspace
# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
# Package.resolved
.build/
# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# Pods/
#
# Add this line if you want to avoid checking in source code from the Xcode workspace
# *.xcworkspace
# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts
Carthage/Build
# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/**/*.png
fastlane/test_output
+9
View File
@@ -0,0 +1,9 @@
The MIT License (MIT)
Copyright (c) 2016 Oskar Groth
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.
@@ -7,38 +7,42 @@
objects = {
/* 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 */; };
75256FE220FA5ABC00ED6782 /* OGSwitch.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 75256FE120FA5ABC00ED6782 /* OGSwitch.framework */; };
75256FE320FA5AC300ED6782 /* OGSwitch.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 75256FE120FA5ABC00ED6782 /* OGSwitch.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
7553A35A20F5045900EEA571 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
75256FE320FA5AC300ED6782 /* OGSwitch.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase 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 = "<group>"; };
750F2E3D1E5D2CD000C20E79 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
750F2E441E5D2CE100C20E79 /* OGSwitch.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OGSwitch.swift; sourceTree = "<group>"; };
750F2E4A1E5D2D7100C20E79 /* OGSwitchDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OGSwitchDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
750F2E4A1E5D2D7100C20E79 /* OGSwitch-DemoDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "OGSwitch-DemoDemo.app"; sourceTree = BUILT_PRODUCTS_DIR; };
750F2E4C1E5D2D7100C20E79 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
750F2E4E1E5D2D7100C20E79 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
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; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
750F2E351E5D2CD000C20E79 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
750F2E471E5D2D7100C20E79 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
75256FE220FA5ABC00ED6782 /* OGSwitch.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -48,31 +52,20 @@
750F2E2F1E5D2CD000C20E79 = {
isa = PBXGroup;
children = (
750F2E3B1E5D2CD000C20E79 /* OGSwitch */,
750F2E4B1E5D2D7100C20E79 /* OGSwitchDemo */,
750F2E3A1E5D2CD000C20E79 /* Products */,
75256FE020FA5ABC00ED6782 /* Frameworks */,
);
sourceTree = "<group>";
};
750F2E3A1E5D2CD000C20E79 /* Products */ = {
isa = PBXGroup;
children = (
750F2E391E5D2CD000C20E79 /* OGSwitch.framework */,
750F2E4A1E5D2D7100C20E79 /* OGSwitchDemo.app */,
750F2E4A1E5D2D7100C20E79 /* OGSwitch-DemoDemo.app */,
);
name = Products;
sourceTree = "<group>";
};
750F2E3B1E5D2CD000C20E79 /* OGSwitch */ = {
isa = PBXGroup;
children = (
750F2E3C1E5D2CD000C20E79 /* OGSwitch.h */,
750F2E441E5D2CE100C20E79 /* OGSwitch.swift */,
750F2E3D1E5D2CD000C20E79 /* Info.plist */,
);
path = OGSwitch;
sourceTree = "<group>";
};
750F2E4B1E5D2D7100C20E79 /* OGSwitchDemo */ = {
isa = PBXGroup;
children = (
@@ -84,53 +77,33 @@
path = OGSwitchDemo;
sourceTree = "<group>";
};
75256FE020FA5ABC00ED6782 /* Frameworks */ = {
isa = PBXGroup;
children = (
75256FE120FA5ABC00ED6782 /* OGSwitch.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
750F2E361E5D2CD000C20E79 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
750F2E3E1E5D2CD000C20E79 /* OGSwitch.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
750F2E381E5D2CD000C20E79 /* OGSwitch */ = {
750F2E491E5D2D7100C20E79 /* OGSwitch-DemoDemo */ = {
isa = PBXNativeTarget;
buildConfigurationList = 750F2E411E5D2CD000C20E79 /* Build configuration list for PBXNativeTarget "OGSwitch" */;
buildPhases = (
750F2E341E5D2CD000C20E79 /* Sources */,
750F2E351E5D2CD000C20E79 /* Frameworks */,
750F2E361E5D2CD000C20E79 /* Headers */,
750F2E371E5D2CD000C20E79 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = OGSwitch;
productName = OGSwitch;
productReference = 750F2E391E5D2CD000C20E79 /* OGSwitch.framework */;
productType = "com.apple.product-type.framework";
};
750F2E491E5D2D7100C20E79 /* OGSwitchDemo */ = {
isa = PBXNativeTarget;
buildConfigurationList = 750F2E541E5D2D7200C20E79 /* Build configuration list for PBXNativeTarget "OGSwitchDemo" */;
buildConfigurationList = 750F2E541E5D2D7200C20E79 /* Build configuration list for PBXNativeTarget "OGSwitch-DemoDemo" */;
buildPhases = (
750F2E461E5D2D7100C20E79 /* Sources */,
750F2E471E5D2D7100C20E79 /* Frameworks */,
750F2E481E5D2D7100C20E79 /* Resources */,
7553A35A20F5045900EEA571 /* Embed Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = OGSwitchDemo;
name = "OGSwitch-DemoDemo";
productName = OGSwitchDemo;
productReference = 750F2E4A1E5D2D7100C20E79 /* OGSwitchDemo.app */;
productReference = 750F2E4A1E5D2D7100C20E79 /* OGSwitch-DemoDemo.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
@@ -140,23 +113,18 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0820;
LastUpgradeCheck = 0820;
LastUpgradeCheck = 1000;
ORGANIZATIONNAME = "Oskar Groth";
TargetAttributes = {
750F2E381E5D2CD000C20E79 = {
CreatedOnToolsVersion = 8.2.1;
DevelopmentTeam = ZQK6SX26CE;
LastSwiftMigration = 0820;
ProvisioningStyle = Automatic;
};
750F2E491E5D2D7100C20E79 = {
CreatedOnToolsVersion = 8.2.1;
DevelopmentTeam = ZQK6SX26CE;
LastSwiftMigration = 0910;
ProvisioningStyle = Automatic;
};
};
};
buildConfigurationList = 750F2E331E5D2CD000C20E79 /* Build configuration list for PBXProject "OGSwitch" */;
buildConfigurationList = 750F2E331E5D2CD000C20E79 /* Build configuration list for PBXProject "OGSwitch-Demo" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
@@ -169,20 +137,12 @@
projectDirPath = "";
projectRoot = "";
targets = (
750F2E381E5D2CD000C20E79 /* OGSwitch */,
750F2E491E5D2D7100C20E79 /* OGSwitchDemo */,
750F2E491E5D2D7100C20E79 /* OGSwitch-DemoDemo */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
750F2E371E5D2CD000C20E79 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
750F2E481E5D2D7100C20E79 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
@@ -195,20 +155,11 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
750F2E341E5D2CD000C20E79 /* Sources */ = {
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;
};
@@ -235,15 +186,23 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -267,12 +226,14 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.12;
MACOSX_DEPLOYMENT_TARGET = 10.9;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
@@ -287,15 +248,23 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -313,92 +282,55 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.12;
MACOSX_DEPLOYMENT_TARGET = 10.9;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Release;
};
750F2E421E5D2CD000C20E79 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = ZQK6SX26CE;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_VERSION = A;
INFOPLIST_FILE = OGSwitch/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = org.cindori.OGSwitch;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
750F2E431E5D2CD000C20E79 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = ZQK6SX26CE;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_VERSION = A;
INFOPLIST_FILE = OGSwitch/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = org.cindori.OGSwitch;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
};
name = Release;
};
750F2E551E5D2D7200C20E79 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
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";
MACOSX_DEPLOYMENT_TARGET = 10.10;
PRODUCT_BUNDLE_IDENTIFIER = org.cindori.OGSwitchDemo;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
750F2E561E5D2D7200C20E79 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
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";
MACOSX_DEPLOYMENT_TARGET = 10.10;
PRODUCT_BUNDLE_IDENTIFIER = org.cindori.OGSwitchDemo;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
750F2E331E5D2CD000C20E79 /* Build configuration list for PBXProject "OGSwitch" */ = {
750F2E331E5D2CD000C20E79 /* Build configuration list for PBXProject "OGSwitch-Demo" */ = {
isa = XCConfigurationList;
buildConfigurations = (
750F2E3F1E5D2CD000C20E79 /* Debug */,
@@ -407,21 +339,14 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
750F2E411E5D2CD000C20E79 /* Build configuration list for PBXNativeTarget "OGSwitch" */ = {
isa = XCConfigurationList;
buildConfigurations = (
750F2E421E5D2CD000C20E79 /* Debug */,
750F2E431E5D2CD000C20E79 /* Release */,
);
defaultConfigurationIsVisible = 0;
};
750F2E541E5D2D7200C20E79 /* Build configuration list for PBXNativeTarget "OGSwitchDemo" */ = {
750F2E541E5D2D7200C20E79 /* Build configuration list for PBXNativeTarget "OGSwitch-DemoDemo" */ = {
isa = XCConfigurationList;
buildConfigurations = (
750F2E551E5D2D7200C20E79 /* Debug */,
750F2E561E5D2D7200C20E79 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "1"
version = "2.0">
</Bucket>
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0820"
LastUpgradeVersion = "1000"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -15,9 +15,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "750F2E491E5D2D7100C20E79"
BuildableName = "OGSwitchDemo.app"
BlueprintName = "OGSwitchDemo"
ReferencedContainer = "container:OGSwitch.xcodeproj">
BuildableName = "OGSwitch-DemoDemo.app"
BlueprintName = "OGSwitch-DemoDemo"
ReferencedContainer = "container:OGSwitch-Demo.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
@@ -33,9 +33,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "750F2E491E5D2D7100C20E79"
BuildableName = "OGSwitchDemo.app"
BlueprintName = "OGSwitchDemo"
ReferencedContainer = "container:OGSwitch.xcodeproj">
BuildableName = "OGSwitch-DemoDemo.app"
BlueprintName = "OGSwitch-DemoDemo"
ReferencedContainer = "container:OGSwitch-Demo.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
@@ -56,9 +56,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "750F2E491E5D2D7100C20E79"
BuildableName = "OGSwitchDemo.app"
BlueprintName = "OGSwitchDemo"
ReferencedContainer = "container:OGSwitch.xcodeproj">
BuildableName = "OGSwitch-DemoDemo.app"
BlueprintName = "OGSwitch-DemoDemo"
ReferencedContainer = "container:OGSwitch-Demo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
@@ -75,9 +75,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "750F2E491E5D2D7100C20E79"
BuildableName = "OGSwitchDemo.app"
BlueprintName = "OGSwitchDemo"
ReferencedContainer = "container:OGSwitch.xcodeproj">
BuildableName = "OGSwitch-DemoDemo.app"
BlueprintName = "OGSwitch-DemoDemo"
ReferencedContainer = "container:OGSwitch-Demo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
@@ -4,15 +4,10 @@
<dict>
<key>SchemeUserState</key>
<dict>
<key>OGSwitch.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
<key>OGSwitchDemo.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
@@ -1,55 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "1"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "OGSwitch/OGSwitch.swift"
timestampString = "509792812.217359"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "69"
endingLineNumber = "69"
landmarkName = "setupIcon()"
landmarkType = "7">
<Locations>
<Location
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "OGSwitchDemo.OGSwitch.setupIcon () -&gt; ()"
moduleName = "OGSwitchDemo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/oskar/OGSwitch/OGSwitch/OGSwitch.swift"
timestampString = "509430041.079686"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "69"
endingLineNumber = "69"
offsetFromSymbolStart = "59">
</Location>
<Location
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "OGSwitchDemo.OGSwitch.setupIcon () -&gt; ()"
moduleName = "OGSwitchDemo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/oskar/OGSwitch/OGSwitch/OGSwitch.swift"
timestampString = "509430041.081101"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "69"
endingLineNumber = "69"
offsetFromSymbolStart = "124">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
+10
View File
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:/Users/oskar/Dev/OGSwitch/OGSwitch-Demo.xcodeproj">
</FileRef>
<FileRef
location = "group:OGSwitch/OGSwitch.xcodeproj">
</FileRef>
</Workspace>
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
+346
View File
@@ -0,0 +1,346 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objects = {
/* Begin PBXBuildFile section */
75256FDF20FA5A3E00ED6782 /* OGSwitch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75256FDE20FA5A3E00ED6782 /* OGSwitch.swift */; };
753FF1A520FA64B500DFA33E /* OGSwitch.swift in Headers */ = {isa = PBXBuildFile; fileRef = 75256FDE20FA5A3E00ED6782 /* OGSwitch.swift */; settings = {ATTRIBUTES = (Public, ); }; };
753FF1A620FA64D200DFA33E /* OGSwitch.h in Headers */ = {isa = PBXBuildFile; fileRef = 75256FD620FA5A0E00ED6782 /* OGSwitch.h */; settings = {ATTRIBUTES = (Public, ); }; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
75256FD320FA5A0E00ED6782 /* OGSwitch.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = OGSwitch.framework; sourceTree = BUILT_PRODUCTS_DIR; };
75256FD620FA5A0E00ED6782 /* OGSwitch.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OGSwitch.h; sourceTree = "<group>"; };
75256FD720FA5A0E00ED6782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
75256FDE20FA5A3E00ED6782 /* OGSwitch.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OGSwitch.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
75256FD020FA5A0E00ED6782 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
75256FC920FA5A0E00ED6782 = {
isa = PBXGroup;
children = (
75256FD520FA5A0E00ED6782 /* OGSwitch */,
75256FD420FA5A0E00ED6782 /* Products */,
);
sourceTree = "<group>";
};
75256FD420FA5A0E00ED6782 /* Products */ = {
isa = PBXGroup;
children = (
75256FD320FA5A0E00ED6782 /* OGSwitch.framework */,
);
name = Products;
sourceTree = "<group>";
};
75256FD520FA5A0E00ED6782 /* OGSwitch */ = {
isa = PBXGroup;
children = (
75256FDE20FA5A3E00ED6782 /* OGSwitch.swift */,
75256FD620FA5A0E00ED6782 /* OGSwitch.h */,
75256FD720FA5A0E00ED6782 /* Info.plist */,
);
path = OGSwitch;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
75256FCE20FA5A0E00ED6782 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
753FF1A620FA64D200DFA33E /* OGSwitch.h in Headers */,
753FF1A520FA64B500DFA33E /* OGSwitch.swift in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
75256FD220FA5A0E00ED6782 /* OGSwitch */ = {
isa = PBXNativeTarget;
buildConfigurationList = 75256FDB20FA5A0E00ED6782 /* Build configuration list for PBXNativeTarget "OGSwitch" */;
buildPhases = (
75256FCE20FA5A0E00ED6782 /* Headers */,
75256FCF20FA5A0E00ED6782 /* Sources */,
75256FD020FA5A0E00ED6782 /* Frameworks */,
75256FD120FA5A0E00ED6782 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = OGSwitch;
productName = OGSwitch;
productReference = 75256FD320FA5A0E00ED6782 /* OGSwitch.framework */;
productType = "com.apple.product-type.framework";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
75256FCA20FA5A0E00ED6782 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1000;
ORGANIZATIONNAME = "Oskar Groth";
TargetAttributes = {
75256FD220FA5A0E00ED6782 = {
CreatedOnToolsVersion = 10.0;
LastSwiftMigration = 1000;
};
};
};
buildConfigurationList = 75256FCD20FA5A0E00ED6782 /* Build configuration list for PBXProject "OGSwitch" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 75256FC920FA5A0E00ED6782;
productRefGroup = 75256FD420FA5A0E00ED6782 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
75256FD220FA5A0E00ED6782 /* OGSwitch */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
75256FD120FA5A0E00ED6782 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
75256FCF20FA5A0E00ED6782 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
75256FDF20FA5A3E00ED6782 /* OGSwitch.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
75256FD920FA5A0E00ED6782 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "Mac Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Debug;
};
75256FDA20FA5A0E00ED6782 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "Mac Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Release;
};
75256FDC20FA5A0E00ED6782 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = ZQK6SX26CE;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_VERSION = A;
INFOPLIST_FILE = OGSwitch/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.9;
PRODUCT_BUNDLE_IDENTIFIER = org.cindori.OGSwitch;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.2;
};
name = Debug;
};
75256FDD20FA5A0E00ED6782 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = ZQK6SX26CE;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_VERSION = A;
INFOPLIST_FILE = OGSwitch/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.9;
PRODUCT_BUNDLE_IDENTIFIER = org.cindori.OGSwitch;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.2;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
75256FCD20FA5A0E00ED6782 /* Build configuration list for PBXProject "OGSwitch" */ = {
isa = XCConfigurationList;
buildConfigurations = (
75256FD920FA5A0E00ED6782 /* Debug */,
75256FDA20FA5A0E00ED6782 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
75256FDB20FA5A0E00ED6782 /* Build configuration list for PBXNativeTarget "OGSwitch" */ = {
isa = XCConfigurationList;
buildConfigurations = (
75256FDC20FA5A0E00ED6782 /* Debug */,
75256FDD20FA5A0E00ED6782 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 75256FCA20FA5A0E00ED6782 /* Project object */;
}
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0820"
LastUpgradeVersion = "1000"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -14,7 +14,7 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "750F2E381E5D2CD000C20E79"
BlueprintIdentifier = "75256FD220FA5A0E00ED6782"
BuildableName = "OGSwitch.framework"
BlueprintName = "OGSwitch"
ReferencedContainer = "container:OGSwitch.xcodeproj">
@@ -45,7 +45,7 @@
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "750F2E381E5D2CD000C20E79"
BlueprintIdentifier = "75256FD220FA5A0E00ED6782"
BuildableName = "OGSwitch.framework"
BlueprintName = "OGSwitch"
ReferencedContainer = "container:OGSwitch.xcodeproj">
@@ -63,7 +63,7 @@
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "750F2E381E5D2CD000C20E79"
BlueprintIdentifier = "75256FD220FA5A0E00ED6782"
BuildableName = "OGSwitch.framework"
BlueprintName = "OGSwitch"
ReferencedContainer = "container:OGSwitch.xcodeproj">
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>OGSwitch.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>2</integer>
</dict>
</dict>
</dict>
</plist>
@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
@@ -19,8 +19,6 @@
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2017 Oskar Groth. All rights reserved.</string>
<key>NSPrincipalClass</key>
<string></string>
<string>Copyright © 2018 Oskar Groth. All rights reserved.</string>
</dict>
</plist>
@@ -2,8 +2,8 @@
// OGSwitch.h
// OGSwitch
//
// Created by Oskar Groth on 2017-02-22.
// Copyright © 2017 Oskar Groth. All rights reserved.
// Created by Oskar Groth on 2018-07-14.
// Copyright © 2018 Oskar Groth. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@@ -13,7 +13,3 @@ FOUNDATION_EXPORT double OGSwitchVersionNumber;
//! Project version string for OGSwitch.
FOUNDATION_EXPORT const unsigned char OGSwitchVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <OGSwitch/PublicHeader.h>
@@ -9,24 +9,84 @@
import Cocoa
import QuartzCore
public class OGSwitch : NSControl {
//Can not be NSControl due to 10.9 issues: https://github.com/iluuu1994/ITSwitch/issues/21
@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
@IBInspectable public var inactiveIcon: NSImage?
@IBInspectable public var activeIcon: NSImage?
@IBInspectable public var ignoreRatio: Bool = false
@IBDesignable public class OGSwitch: NSControl {
public enum Size {
case small
case medium
case large
public var size: CGSize {
switch self {
case .small:
return CGSize(width: 46, height: 28)
case .medium:
return CGSize(width: 56, height: 34)
case .large:
return CGSize(width: 69, height: 41)
}
}
}
@IBInspectable public var tintColor: NSColor = NSColor(calibratedRed:0.27, green: 0.86, blue: 0.36, alpha: 1.0) {
didSet {
reloadLayer()
}
}
@IBInspectable public var knobBackgroundColor: NSColor = NSColor(calibratedWhite:1.0, alpha: 1.0) {
didSet {
reloadLayer()
}
}
@IBInspectable public var disabledBorderColor: NSColor = NSColor(calibratedWhite: 0.0, alpha: 0.2) {
didSet {
reloadLayer()
}
}
@IBInspectable public var disabledBackgroundColor: NSColor = NSColor.clear {
didSet {
reloadLayer()
}
}
@IBInspectable public var inactiveBackgroundColor: NSColor = NSColor(calibratedWhite: 0.0, alpha:0.3) {
didSet {
reloadLayer()
}
}
@IBInspectable public var animationDuration: TimeInterval = 0.4
@IBInspectable public var inactiveIcon: NSImage? {
didSet {
reloadLayer()
}
}
@IBInspectable public var activeIcon: NSImage? {
didSet {
reloadLayer()
}
}
@IBInspectable public var ignoreRatio: Bool = false {
didSet {
reloadLayer()
}
}
override public var isEnabled: Bool {
didSet {
reloadLayerAnimated(animated: true)
}
}
lazy var kBorderLineWidth: CGFloat = bounds.height*(2/31)
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
var dragEvents = 0
public var isOn:Bool = false
public var isActive:Bool = false
public var hasDragged:Bool = false
public var isDraggingTowardsOn:Bool = false
@@ -35,6 +95,7 @@ public class OGSwitch : NSControl {
public var knobLayer: CALayer?
public var knobInsideLayer: CALayer?
public var iconLayer = CALayer()
public var lockInteraction: Bool = false
override public var acceptsFirstResponder: Bool {
get {
@@ -44,25 +105,35 @@ public class OGSwitch : NSControl {
required public init?(coder:NSCoder) {
super.init(coder: coder)
setup()
}
override init(frame:NSRect) {
convenience public init(size: CGSize) {
self.init(frame: NSRect(origin: .zero, size: size))
}
override public init(frame:NSRect) {
super.init(frame: frame);
setup()
}
override public func awakeFromNib() {
super.awakeFromNib()
reloadLayerSize()
reloadLayer()
setupIcon()
}
internal func setup() {
isEnabled = true
setupLayers()
}
public override func awakeFromNib() {
super.awakeFromNib()
reloadLayerSize()
setupIcon()
public func setOn(isOn: Bool, animated: Bool) {
if self.isOn != isOn {
self.isOn = isOn
reloadLayerAnimated(animated: animated)
}
}
internal func setupIcon() {
@@ -80,7 +151,7 @@ public class OGSwitch : NSControl {
animation.fromValue = iconLayer.contents
animation.duration = 0.5
animation.isRemovedOnCompletion = false
animation.fillMode = kCAFillModeForwards
animation.fillMode = .forwards
iconLayer.add(animation, forKey: "contents")
iconLayer.setValue(animation.toValue, forKey: "contents")
}
@@ -88,14 +159,14 @@ public class OGSwitch : NSControl {
internal func setupLayers() {
rootLayer = CALayer()
layer = rootLayer
wantsLayer = true
layer?.masksToBounds = false
backgroundLayer = CALayer()
backgroundLayer!.autoresizingMask = [.layerWidthSizable, .layerHeightSizable]
backgroundLayer!.bounds = rootLayer!.bounds
backgroundLayer!.anchorPoint = CGPoint(x: 0.0, y: 0.0)
backgroundLayer!.borderWidth = kBorderLineWidth
backgroundLayer?.masksToBounds = false
rootLayer!.addSublayer(backgroundLayer!)
@@ -104,10 +175,10 @@ public class OGSwitch : NSControl {
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
knobLayer!.shadowOffset = CGSize(width:0.0, height:-6.5)
knobLayer!.shadowRadius = 2.5
knobLayer!.shadowOpacity = 0.15
knobLayer?.masksToBounds = false
rootLayer!.addSublayer(knobLayer!)
knobInsideLayer = CALayer()
@@ -124,7 +195,6 @@ public class OGSwitch : NSControl {
knobInsideLayer!.shadowOpacity = 0.35
knobLayer!.addSublayer(knobInsideLayer!)
reloadLayerSize()
reloadLayer()
}
@@ -132,36 +202,32 @@ public class OGSwitch : NSControl {
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) {
guard let backgroundLayer = backgroundLayer else {
return
}
CATransaction.begin()
CATransaction.setAnimationDuration(animated ? animationDuration : 0)
if (hasDragged && isDraggingTowardsOn) || (!hasDragged && isOn) {
backgroundLayer!.borderColor = tintColor.cgColor
backgroundLayer!.backgroundColor = tintColor.cgColor
backgroundLayer.borderColor = tintColor.cgColor
backgroundLayer.backgroundColor = tintColor.cgColor
}
else {
backgroundLayer!.borderColor = disabledBorderColor.cgColor
backgroundLayer!.backgroundColor = disabledBackgroundColor.cgColor
backgroundLayer.borderColor = disabledBorderColor.cgColor
backgroundLayer.backgroundColor = disabledBackgroundColor.cgColor
}
if isEnabled {
rootLayer!.opacity = kEnabledOpacity
}
else {
rootLayer!.opacity = kDisabledOpacity
}
knobLayer?.shadowColor = isEnabled ? NSColor.black.cgColor : NSColor.clear.cgColor
rootLayer!.opacity = isEnabled ? kEnabledOpacity : kDisabledOpacity
if hasDragged {
let function = CAMediaTimingFunction(controlPoints: 0.25, 1.5, 0.5, 1)
@@ -198,7 +264,6 @@ public class OGSwitch : NSControl {
width = Double((bounds.width - 2.0 * kBorderLineWidth) / kDecreasedGoldenRatio)
}
}
var x:CGFloat = 0
if (!hasDragged && !isOn) || (hasDragged && !isDraggingTowardsOn) {
@@ -223,7 +288,7 @@ public class OGSwitch : NSControl {
override public func mouseDown(with theEvent: NSEvent) {
if !isEnabled {
if !isEnabled || lockInteraction {
return
}
isActive = true
@@ -231,10 +296,14 @@ public class OGSwitch : NSControl {
}
override public func mouseDragged(with theEvent: NSEvent) {
if !isEnabled {
dragEvents += 1
guard dragEvents > 3 else {
return
}
dragEvents = 0
if !isEnabled || lockInteraction {
return
}
hasDragged = true
let draggingPoint = convert(theEvent.locationInWindow, from: nil)
@@ -243,7 +312,8 @@ public class OGSwitch : NSControl {
}
override public func mouseUp(with theEvent: NSEvent) {
if !isEnabled {
dragEvents = 0
if !isEnabled || lockInteraction {
return
}
@@ -257,14 +327,14 @@ public class OGSwitch : NSControl {
}
if isOn != on {
Swift.print("Now: \(on)")
isOn = on
if action != nil {
NSApp.sendAction(action!, to: target, from: self)
}
} else {
isOn = on
}
isOn = on
hasDragged = false
isDraggingTowardsOn = false
@@ -272,3 +342,4 @@ public class OGSwitch : NSControl {
}
}
+11 -1
View File
@@ -7,12 +7,13 @@
//
import Cocoa
import OGSwitch
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
@IBOutlet weak var window: NSWindow!
@IBOutlet weak var switchButton: OGSwitch!
func applicationDidFinishLaunching(_ aNotification: Notification) {
// Insert code here to initialize your application
@@ -22,6 +23,15 @@ class AppDelegate: NSObject, NSApplicationDelegate {
// Insert code here to tear down your application
}
@IBAction func switchPress(_ sender: Any) {
NSLog("Switch is now: \((sender as! OGSwitch).isOn)")
// perform(#selector(timer), with: nil, afterDelay: 3)
}
@objc func timer() {
NSLog("Switch is after timer trigger now: \(switchButton.isOn)")
// switchButton.setOn(isOn: !switchButton.isOn, animated: false)
}
}
@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "checkmark.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "checkmark@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

+60 -19
View File
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11762" systemVersion="16D32" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14269.12" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11762"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14269.12"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@@ -13,19 +13,20 @@
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModule="OGSwitchDemo" customModuleProvider="target">
<customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModule="OGSwitch_DemoDemo" customModuleProvider="target">
<connections>
<outlet property="switchButton" destination="M7z-uc-a7v" id="s1F-OI-IzO"/>
<outlet property="window" destination="QvC-M9-y7g" id="gIp-Ho-8D9"/>
</connections>
</customObject>
<customObject id="YLy-65-1bz" customClass="NSFontManager"/>
<menu title="Main Menu" systemMenu="main" id="AYu-sK-qS6">
<items>
<menuItem title="OGSwitchDemo" id="1Xt-HY-uBw">
<menuItem title="OGSwitch-DemoDemo" id="1Xt-HY-uBw">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="OGSwitchDemo" systemMenu="apple" id="uQy-DD-JDr">
<menu key="submenu" title="OGSwitch-DemoDemo" systemMenu="apple" id="uQy-DD-JDr">
<items>
<menuItem title="About OGSwitchDemo" id="5kV-Vb-QxS">
<menuItem title="About OGSwitch-DemoDemo" id="5kV-Vb-QxS">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="orderFrontStandardAboutPanel:" target="-1" id="Exp-CZ-Vem"/>
@@ -39,7 +40,7 @@
<menu key="submenu" title="Services" systemMenu="services" id="hz9-B4-Xy5"/>
</menuItem>
<menuItem isSeparatorItem="YES" id="4je-JR-u6R"/>
<menuItem title="Hide OGSwitchDemo" keyEquivalent="h" id="Olw-nP-bQN">
<menuItem title="Hide OGSwitch-DemoDemo" keyEquivalent="h" id="Olw-nP-bQN">
<connections>
<action selector="hide:" target="-1" id="PnN-Uc-m68"/>
</connections>
@@ -57,7 +58,7 @@
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="kCx-OE-vgT"/>
<menuItem title="Quit OGSwitchDemo" keyEquivalent="q" id="4sb-4s-VLi">
<menuItem title="Quit OGSwitch-DemoDemo" keyEquivalent="q" id="4sb-4s-VLi">
<connections>
<action selector="terminate:" target="-1" id="Te7-pn-YzF"/>
</connections>
@@ -670,7 +671,7 @@
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Help" systemMenu="help" id="F2S-fz-NVQ">
<items>
<menuItem title="OGSwitchDemo Help" keyEquivalent="?" id="FKE-Sm-Kum">
<menuItem title="OGSwitch-DemoDemo Help" keyEquivalent="?" id="FKE-Sm-Kum">
<connections>
<action selector="showHelp:" target="-1" id="y7X-2Q-9no"/>
</connections>
@@ -680,30 +681,70 @@
</menuItem>
</items>
</menu>
<window title="OGSwitchDemo" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g">
<window title="OGSwitch-Demo" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="335" y="390" width="480" height="360"/>
<rect key="screenRect" x="0.0" y="0.0" width="1680" height="1028"/>
<rect key="screenRect" x="0.0" y="0.0" width="1680" height="1027"/>
<view key="contentView" wantsLayer="YES" id="EiT-Mj-1SZ">
<rect key="frame" x="0.0" y="0.0" width="480" height="360"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="M7z-uc-a7v" customClass="OGSwitch" customModule="OGSwitchDemo" customModuleProvider="target">
<rect key="frame" x="129" y="161" width="163" height="96"/>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="M7z-uc-a7v" customClass="OGSwitch" customModule="OGSwitch">
<rect key="frame" x="159" y="201" width="163" height="96"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="image" keyPath="inactiveIcon" value="NSEnterFullScreenTemplate"/>
<userDefinedRuntimeAttribute type="image" keyPath="activeIcon" value="NSBookmarksTemplate"/>
<userDefinedRuntimeAttribute type="boolean" keyPath="ignoreRatio" value="YES"/>
<userDefinedRuntimeAttribute type="color" keyPath="disabledBackgroundColor">
<color key="value" name="systemGreenColor" catalog="System" colorSpace="catalog"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="switchPress:" target="Voe-Tx-rLC" id="Mqi-G6-fmv"/>
</connections>
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Brb-kf-Oxi" customClass="OGSwitch" customModule="OGSwitch">
<rect key="frame" x="140" y="60" width="46" height="28"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="ignoreRatio" value="YES"/>
<userDefinedRuntimeAttribute type="color" keyPath="disabledBackgroundColor">
<color key="value" red="1" green="0.40000000600000002" blue="0.40000000600000002" alpha="1" colorSpace="calibratedRGB"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="switchPress:" target="Voe-Tx-rLC" id="tTg-hX-q3I"/>
</connections>
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="dPq-0j-nKi" customClass="OGSwitch" customModule="OGSwitch">
<rect key="frame" x="272" y="53" width="69" height="41"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="ignoreRatio" value="YES"/>
<userDefinedRuntimeAttribute type="color" keyPath="disabledBackgroundColor">
<color key="value" red="1" green="0.40000000600000002" blue="0.40000000600000002" alpha="1" colorSpace="calibratedRGB"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="switchPress:" target="Voe-Tx-rLC" id="buu-wq-UpG"/>
</connections>
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="1VD-pu-2Ej" customClass="OGSwitch" customModule="OGSwitch">
<rect key="frame" x="200" y="57" width="56" height="34"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="ignoreRatio" value="YES"/>
<userDefinedRuntimeAttribute type="color" keyPath="disabledBackgroundColor">
<color key="value" red="1" green="0.40000000600000002" blue="0.40000000600000002" alpha="1" colorSpace="calibratedRGB"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="switchPress:" target="Voe-Tx-rLC" id="wRK-Gm-efR"/>
</connections>
</customView>
</subviews>
</view>
<point key="canvasLocation" x="198" y="-127"/>
</window>
</objects>
<resources>
<image name="NSBookmarksTemplate" width="17" height="18"/>
<image name="NSEnterFullScreenTemplate" width="15" height="15"/>
</resources>
</document>
+57
View File
@@ -0,0 +1,57 @@
OGSwitch
==================
Layer based Switch Control for macOS, with Interface Builder styling options. Written in Swift.
Supports animation, custom aspect ratios, and knob images.
This is a `NSView` subclass that lets you create beautiful iOS-inspired switches easily.
![OGSwitch for macOS](https://s3.amazonaws.com/cindori/images/ogswitch.png "OGSwitch for macOS")
`OGSwitch` now also supports `IBDesignable` and renders directly in Interface Builder:
![IBDesignable](https://i.imgur.com/BKUyWGg.png "IBDesignable")
## Installation (Carthage)
Configure your Cartfile to use `OGSwitch`:
```github "OskarGroth/OGSwitch" ~> 2.0```
`OGSwitch` requires Swift 4.2.
## Usage
Create a custom `NSView` in Interface Builder and set it's class to `OGSwitch`.
You can now style your switch from the inspector:
![OGSwitch for macOS](https://s3.amazonaws.com/cindori/images/inspector-ogswitch.png "OGSwitch for macOS")
The same values can be accessed from your code.
## Credits
Inspired by ITSwitch by Ilija Tovilo.
## License
The MIT License (MIT)
Copyright (c) 2018 Oskar Groth
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.
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB