Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9bc2acc5f4 | |||
| d103720de4 | |||
| 09cd2cd79c | |||
| 4c2a062a71 | |||
| c70ed728d3 | |||
| 12a6cb6afe | |||
| 0a73d77643 | |||
| de2f2f2f29 | |||
| 54df55d873 | |||
| 5ea6de9f9c | |||
| 8333545660 | |||
| 4be5d991d6 | |||
| d0e5cfa4d6 | |||
| f9159b1121 | |||
| 2641ba660d | |||
| 2cebd10d55 | |||
| 5de3413003 | |||
| 1b189433da | |||
| 64efed6619 | |||
| 127d4cd6ab | |||
| b575f97bde | |||
| 315867ebb2 | |||
| cf4468cb36 | |||
| 9536f15b16 | |||
| 7538b3f2f4 | |||
| 19026b39f2 | |||
| 1e0dabd686 |
+71
@@ -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
|
||||
@@ -7,38 +7,44 @@
|
||||
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; };
|
||||
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 */
|
||||
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 +54,21 @@
|
||||
750F2E2F1E5D2CD000C20E79 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
750F2E3B1E5D2CD000C20E79 /* OGSwitch */,
|
||||
750F2E4B1E5D2D7100C20E79 /* OGSwitchDemo */,
|
||||
7553A34F20F5045900EEA571 /* OGSwitch */,
|
||||
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 +80,42 @@
|
||||
path = OGSwitchDemo;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
75256FE020FA5ABC00ED6782 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
75256FE120FA5ABC00ED6782 /* OGSwitch.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
7553A34F20F5045900EEA571 /* OGSwitch */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7553A35020F5045900EEA571 /* OGSwitch.h */,
|
||||
7553A35120F5045900EEA571 /* Info.plist */,
|
||||
);
|
||||
path = OGSwitch;
|
||||
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 +125,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 +149,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 +167,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 +198,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 +238,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 +260,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 +294,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 +351,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>
|
||||
BIN
Binary file not shown.
+5
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Bucket
|
||||
type = "1"
|
||||
version = "2.0">
|
||||
</Bucket>
|
||||
+13
-13
@@ -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>
|
||||
+1
-6
@@ -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>
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
Pod::Spec.new do |s|
|
||||
|
||||
s.name = 'OGSwitch'
|
||||
s.version = '1.7'
|
||||
s.summary = 'Switch with icon'
|
||||
s.version = '1.0'
|
||||
s.summary = 'Switch Control for macOS'
|
||||
s.homepage = 'https://github.com/OskarGroth/OGSwitch'
|
||||
s.license = {
|
||||
:type => 'MIT',
|
||||
@@ -18,7 +18,7 @@ s.source = {
|
||||
s.platform = :osx, '10.9'
|
||||
s.source_files = 'OGSwitch/OGSwitch.{swift}'
|
||||
s.requires_arc = true
|
||||
s.screenshot = ""
|
||||
s.screenshot = "https://raw.githubusercontent.com/OskarGroth/OGSwitch/master/screenshot.jpg"
|
||||
s.social_media_url = "https://twitter.com/cindoriapps"
|
||||
|
||||
end
|
||||
|
||||
@@ -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 = "513346877.889494"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "77"
|
||||
endingLineNumber = "77"
|
||||
landmarkName = "init(coder:)"
|
||||
landmarkType = "7">
|
||||
<Locations>
|
||||
<Location
|
||||
shouldBeEnabled = "No"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
symbolName = "OGSwitchDemo.OGSwitch.setupIcon () -> ()"
|
||||
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 () -> ()"
|
||||
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
@@ -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>
|
||||
BIN
Binary file not shown.
@@ -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 */;
|
||||
}
|
||||
+4
-4
@@ -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">
|
||||
+14
@@ -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,8 +9,10 @@
|
||||
import Cocoa
|
||||
import QuartzCore
|
||||
|
||||
public class OGSwitch : NSControl {
|
||||
//Can not be NSControl due to 10.9 issues: https://github.com/iluuu1994/ITSwitch/issues/21
|
||||
|
||||
@IBDesignable public class OGSwitch : NSView {
|
||||
|
||||
@IBInspectable public var tintColor: NSColor = NSColor(calibratedRed:0.27, green: 0.86, blue: 0.36, alpha: 1.0) {
|
||||
didSet {
|
||||
reloadLayer()
|
||||
@@ -54,6 +56,9 @@ public class OGSwitch : NSControl {
|
||||
let kDecreasedGoldenRatio:CGFloat = 1.38
|
||||
let kEnabledOpacity:Float = 1.0
|
||||
let kDisabledOpacity:Float = 0.5
|
||||
var dragEvents = 0
|
||||
@objc public var action: Selector?
|
||||
@objc public var target: AnyObject?
|
||||
public var isOn:Bool = false
|
||||
public var isActive:Bool = false
|
||||
public var hasDragged:Bool = false
|
||||
@@ -63,6 +68,12 @@ public class OGSwitch : NSControl {
|
||||
public var knobLayer: CALayer?
|
||||
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 {
|
||||
@@ -72,27 +83,26 @@ public class OGSwitch : NSControl {
|
||||
|
||||
required public init?(coder:NSCoder) {
|
||||
super.init(coder: coder)
|
||||
|
||||
setup()
|
||||
}
|
||||
|
||||
override 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
|
||||
@@ -115,7 +125,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")
|
||||
}
|
||||
@@ -123,14 +133,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!)
|
||||
|
||||
@@ -142,7 +152,7 @@ public class OGSwitch : NSControl {
|
||||
knobLayer!.shadowOffset = CGSize(width:0.0, height:-2.0)
|
||||
knobLayer!.shadowRadius = 1.0
|
||||
knobLayer!.shadowOpacity = 0.3
|
||||
|
||||
knobLayer?.masksToBounds = false
|
||||
rootLayer!.addSublayer(knobLayer!)
|
||||
|
||||
knobInsideLayer = CALayer()
|
||||
@@ -159,7 +169,6 @@ public class OGSwitch : NSControl {
|
||||
knobInsideLayer!.shadowOpacity = 0.35
|
||||
knobLayer!.addSublayer(knobInsideLayer!)
|
||||
|
||||
|
||||
reloadLayerSize()
|
||||
reloadLayer()
|
||||
}
|
||||
@@ -167,36 +176,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)
|
||||
@@ -233,7 +238,6 @@ public class OGSwitch : NSControl {
|
||||
width = Double((bounds.width - 2.0 * kBorderLineWidth) / kDecreasedGoldenRatio)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var x:CGFloat = 0
|
||||
if (!hasDragged && !isOn) || (hasDragged && !isDraggingTowardsOn) {
|
||||
@@ -258,7 +262,7 @@ public class OGSwitch : NSControl {
|
||||
|
||||
|
||||
override public func mouseDown(with theEvent: NSEvent) {
|
||||
if !isEnabled {
|
||||
if !isEnabled || lockInteraction {
|
||||
return
|
||||
}
|
||||
isActive = true
|
||||
@@ -266,10 +270,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)
|
||||
@@ -278,7 +286,8 @@ public class OGSwitch : NSControl {
|
||||
}
|
||||
|
||||
override public func mouseUp(with theEvent: NSEvent) {
|
||||
if !isEnabled {
|
||||
dragEvents = 0
|
||||
if !isEnabled || lockInteraction {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -300,7 +309,6 @@ public class OGSwitch : NSControl {
|
||||
isOn = on
|
||||
}
|
||||
|
||||
|
||||
hasDragged = false
|
||||
isDraggingTowardsOn = false
|
||||
|
||||
@@ -308,3 +316,4 @@ public class OGSwitch : NSControl {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,12 +7,12 @@
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import OGSwitch
|
||||
|
||||
@NSApplicationMain
|
||||
class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
|
||||
@IBOutlet weak var window: NSWindow!
|
||||
|
||||
@IBOutlet weak var switchButton: OGSwitch!
|
||||
|
||||
func applicationDidFinishLaunching(_ aNotification: Notification) {
|
||||
@@ -24,13 +24,13 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
}
|
||||
|
||||
@IBAction func switchPress(_ sender: Any) {
|
||||
print("Trim is now: \(switchButton.isOn)")
|
||||
perform(#selector(timer), with: nil, afterDelay: 3)
|
||||
NSLog("Switch is now: \(switchButton.isOn)")
|
||||
// perform(#selector(timer), with: nil, afterDelay: 3)
|
||||
}
|
||||
|
||||
@objc func timer() {
|
||||
print("Trim is after now: \(switchButton.isOn)")
|
||||
switchButton.setOn(isOn: !switchButton.isOn, animated: false)
|
||||
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 |
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="12118" systemVersion="16E195" 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="12118"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14269.12"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
@@ -13,7 +13,7 @@
|
||||
</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"/>
|
||||
@@ -22,11 +22,11 @@
|
||||
<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"/>
|
||||
@@ -40,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>
|
||||
@@ -58,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>
|
||||
@@ -671,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>
|
||||
@@ -681,21 +681,19 @@
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
<window title="OGSwitchDemo" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g">
|
||||
<window title="OGSwitch-DemoDemo" 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" red="1" green="0.40000000600000002" blue="0.40000000600000002" alpha="1" colorSpace="calibratedRGB"/>
|
||||
@@ -705,12 +703,27 @@
|
||||
<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="159" y="63" width="163" height="96"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="image" keyPath="activeIcon" value="checkmark"/>
|
||||
<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>
|
||||
<userDefinedRuntimeAttribute type="image" keyPath="inactiveIcon" value="checkmark"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
<connections>
|
||||
<action selector="switchPress:" target="Voe-Tx-rLC" id="tTg-hX-q3I"/>
|
||||
</connections>
|
||||
</customView>
|
||||
</subviews>
|
||||
</view>
|
||||
<point key="canvasLocation" x="86" y="-105"/>
|
||||
</window>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="NSBookmarksTemplate" width="17" height="18"/>
|
||||
<image name="NSEnterFullScreenTemplate" width="15" height="15"/>
|
||||
<image name="checkmark" width="35" height="34"/>
|
||||
</resources>
|
||||
</document>
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
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` now also supports `IBDesignable` and renders directly in Interface Builder:
|
||||
|
||||

|
||||
|
||||
|
||||
## Installation (Carthage)
|
||||
Configure your Cartfile to use `OGSwitch`:
|
||||
|
||||
```github "OskarGroth/OGSwitch" ~> 2.0```
|
||||
|
||||
## Usage
|
||||
|
||||
Create a custom `NSView` in Interface Builder and set it's class to `OGSwitch`.
|
||||
You can now style your switch from the inspector:
|
||||
|
||||

|
||||
|
||||
The same values can be accessed from your code.
|
||||
|
||||
## Credits
|
||||
|
||||
Inspired by ITSwitch by Ilija Tovilo.
|
||||
|
||||
## License
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2017 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.
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 105 KiB |
Reference in New Issue
Block a user