13 Commits

Author SHA1 Message Date
cocoatoucher 33fe90797d Modernising the package and the example project. 2022-01-28 17:33:13 +01:00
cocoatoucher 2c5fd8496c Update podspec 2019-08-06 00:16:54 +02:00
cocoatoucher e20edfac58 Update README.md 2019-08-06 00:09:37 +02:00
cocoatoucher 60d91db468 Adding SPM support 2019-08-05 23:55:25 +02:00
cocoatoucher dd9a7b0d66 Initial work on Swift 5 2019-04-08 15:44:47 +02:00
cocoatoucher 6684aa06f9 Merge pull request #18 from Maryom/innerColor_branch
Inner color branch
2019-03-22 14:33:58 +01:00
Maryom 1b76ee765a Use fillColor instead of backgroundColor 2019-03-18 20:13:25 +03:00
Maryom dc7bcba221 Added inner color 2019-03-17 21:44:30 +03:00
Maryom 5a00091cf0 Added inner circle color 2019-03-12 20:49:42 +03:00
cocoatoucher 832e86ddcc Update README.md 2018-11-12 15:51:44 +01:00
cocoatoucher 3e65c688e7 Adding readme for animation observer callbacks 2018-11-12 15:51:27 +01:00
cocoatoucher bea1457103 Adding animation start and stop callbacks 2018-11-12 15:48:32 +01:00
cocoatoucher fe3e74b222 Removing test property 2018-11-12 15:28:23 +01:00
40 changed files with 571 additions and 2155 deletions
+44 -5
View File
@@ -1,6 +1,12 @@
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## Build generated
build/
DerivedData/
## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
@@ -9,19 +15,38 @@ build/
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
xcuserdata/
## Other
*.moved-aside
DerivedData
*.xccheckout
*.xcscmblueprint
## Obj-C/Swift specific
*.hmap
*.ipa
*.xcuserstate
*.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.
*.xcworkspacedata
xcshareddata/
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:
# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# Pods/
@@ -31,3 +56,17 @@ DerivedData
# 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
.DS_Store
-1
View File
@@ -1 +0,0 @@
4.2
-11
View File
@@ -1,11 +0,0 @@
Pod::Spec.new do |s|
s.name = 'AIFlatSwitch'
s.version = '1.0.4'
s.license = 'MIT'
s.summary = 'Nicely animated flat design switch alternative to UISwitch'
s.homepage = 'https://github.com/cocoatoucher/AIFlatSwitch'
s.authors = { 'cocoatoucher' => 'cocoatoucher@aol.com' }
s.source = { :git => 'https://github.com/cocoatoucher/AIFlatSwitch.git', :tag => s.version }
s.ios.deployment_target = '8.0'
s.source_files = 'Source/*.swift'
end
-436
View File
@@ -1,436 +0,0 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
4ED8F5451D8DEB1700B97B8D /* AIFlatSwitch.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4ED8F53B1D8DEB1700B97B8D /* AIFlatSwitch.framework */; };
4ED8F54A1D8DEB1700B97B8D /* AIFlatSwitchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4ED8F5491D8DEB1700B97B8D /* AIFlatSwitchTests.swift */; };
4ED8F54C1D8DEB1700B97B8D /* AIFlatSwitch.h in Headers */ = {isa = PBXBuildFile; fileRef = 4ED8F53E1D8DEB1700B97B8D /* AIFlatSwitch.h */; settings = {ATTRIBUTES = (Public, ); }; };
4ED8F5571D8DEB3600B97B8D /* AIFlatSwitch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4ED8F5561D8DEB3600B97B8D /* AIFlatSwitch.swift */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
4ED8F5461D8DEB1700B97B8D /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 4ED8F5321D8DEB1700B97B8D /* Project object */;
proxyType = 1;
remoteGlobalIDString = 4ED8F53A1D8DEB1700B97B8D;
remoteInfo = AIFlatSwitch;
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
4ED8F53B1D8DEB1700B97B8D /* AIFlatSwitch.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AIFlatSwitch.framework; sourceTree = BUILT_PRODUCTS_DIR; };
4ED8F53E1D8DEB1700B97B8D /* AIFlatSwitch.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AIFlatSwitch.h; sourceTree = "<group>"; };
4ED8F53F1D8DEB1700B97B8D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
4ED8F5441D8DEB1700B97B8D /* AIFlatSwitchTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AIFlatSwitchTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
4ED8F5491D8DEB1700B97B8D /* AIFlatSwitchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AIFlatSwitchTests.swift; sourceTree = "<group>"; };
4ED8F54B1D8DEB1700B97B8D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
4ED8F5561D8DEB3600B97B8D /* AIFlatSwitch.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AIFlatSwitch.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
4ED8F5371D8DEB1700B97B8D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
4ED8F5411D8DEB1700B97B8D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
4ED8F5451D8DEB1700B97B8D /* AIFlatSwitch.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
4ED8F5311D8DEB1700B97B8D = {
isa = PBXGroup;
children = (
4ED8F5551D8DEB1C00B97B8D /* Source */,
4ED8F53D1D8DEB1700B97B8D /* AIFlatSwitch */,
4ED8F5481D8DEB1700B97B8D /* AIFlatSwitchTests */,
4ED8F53C1D8DEB1700B97B8D /* Products */,
);
sourceTree = "<group>";
};
4ED8F53C1D8DEB1700B97B8D /* Products */ = {
isa = PBXGroup;
children = (
4ED8F53B1D8DEB1700B97B8D /* AIFlatSwitch.framework */,
4ED8F5441D8DEB1700B97B8D /* AIFlatSwitchTests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
4ED8F53D1D8DEB1700B97B8D /* AIFlatSwitch */ = {
isa = PBXGroup;
children = (
4ED8F53E1D8DEB1700B97B8D /* AIFlatSwitch.h */,
4ED8F53F1D8DEB1700B97B8D /* Info.plist */,
);
path = AIFlatSwitch;
sourceTree = "<group>";
};
4ED8F5481D8DEB1700B97B8D /* AIFlatSwitchTests */ = {
isa = PBXGroup;
children = (
4ED8F5491D8DEB1700B97B8D /* AIFlatSwitchTests.swift */,
4ED8F54B1D8DEB1700B97B8D /* Info.plist */,
);
path = AIFlatSwitchTests;
sourceTree = "<group>";
};
4ED8F5551D8DEB1C00B97B8D /* Source */ = {
isa = PBXGroup;
children = (
4ED8F5561D8DEB3600B97B8D /* AIFlatSwitch.swift */,
);
path = Source;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
4ED8F5381D8DEB1700B97B8D /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
4ED8F54C1D8DEB1700B97B8D /* AIFlatSwitch.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
4ED8F53A1D8DEB1700B97B8D /* AIFlatSwitch */ = {
isa = PBXNativeTarget;
buildConfigurationList = 4ED8F54F1D8DEB1700B97B8D /* Build configuration list for PBXNativeTarget "AIFlatSwitch" */;
buildPhases = (
4ED8F5361D8DEB1700B97B8D /* Sources */,
4ED8F5371D8DEB1700B97B8D /* Frameworks */,
4ED8F5381D8DEB1700B97B8D /* Headers */,
4ED8F5391D8DEB1700B97B8D /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = AIFlatSwitch;
productName = AIFlatSwitch;
productReference = 4ED8F53B1D8DEB1700B97B8D /* AIFlatSwitch.framework */;
productType = "com.apple.product-type.framework";
};
4ED8F5431D8DEB1700B97B8D /* AIFlatSwitchTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 4ED8F5521D8DEB1700B97B8D /* Build configuration list for PBXNativeTarget "AIFlatSwitchTests" */;
buildPhases = (
4ED8F5401D8DEB1700B97B8D /* Sources */,
4ED8F5411D8DEB1700B97B8D /* Frameworks */,
4ED8F5421D8DEB1700B97B8D /* Resources */,
);
buildRules = (
);
dependencies = (
4ED8F5471D8DEB1700B97B8D /* PBXTargetDependency */,
);
name = AIFlatSwitchTests;
productName = AIFlatSwitchTests;
productReference = 4ED8F5441D8DEB1700B97B8D /* AIFlatSwitchTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
4ED8F5321D8DEB1700B97B8D /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0800;
LastUpgradeCheck = 0830;
ORGANIZATIONNAME = cocoatoucher;
TargetAttributes = {
4ED8F53A1D8DEB1700B97B8D = {
CreatedOnToolsVersion = 8.0;
LastSwiftMigration = 1000;
ProvisioningStyle = Automatic;
};
4ED8F5431D8DEB1700B97B8D = {
CreatedOnToolsVersion = 8.0;
LastSwiftMigration = 1000;
ProvisioningStyle = Automatic;
};
};
};
buildConfigurationList = 4ED8F5351D8DEB1700B97B8D /* Build configuration list for PBXProject "AIFlatSwitch" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 4ED8F5311D8DEB1700B97B8D;
productRefGroup = 4ED8F53C1D8DEB1700B97B8D /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
4ED8F53A1D8DEB1700B97B8D /* AIFlatSwitch */,
4ED8F5431D8DEB1700B97B8D /* AIFlatSwitchTests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
4ED8F5391D8DEB1700B97B8D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
4ED8F5421D8DEB1700B97B8D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
4ED8F5361D8DEB1700B97B8D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
4ED8F5571D8DEB3600B97B8D /* AIFlatSwitch.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
4ED8F5401D8DEB1700B97B8D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
4ED8F54A1D8DEB1700B97B8D /* AIFlatSwitchTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
4ED8F5471D8DEB1700B97B8D /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 4ED8F53A1D8DEB1700B97B8D /* AIFlatSwitch */;
targetProxy = 4ED8F5461D8DEB1700B97B8D /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */
4ED8F54D1D8DEB1700B97B8D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = 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_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_SUSPICIOUS_MOVES = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone 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 = gnu99;
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;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Debug;
};
4ED8F54E1D8DEB1700B97B8D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = 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_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_SUSPICIOUS_MOVES = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone 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 = gnu99;
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;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Release;
};
4ED8F5501D8DEB1700B97B8D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = AIFlatSwitch/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.cocoatoucher.AIFlatSwitch;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
4ED8F5511D8DEB1700B97B8D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = AIFlatSwitch/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.cocoatoucher.AIFlatSwitch;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
};
name = Release;
};
4ED8F5531D8DEB1700B97B8D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
INFOPLIST_FILE = AIFlatSwitchTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.cocoatoucher.AIFlatSwitchTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
4ED8F5541D8DEB1700B97B8D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
INFOPLIST_FILE = AIFlatSwitchTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.cocoatoucher.AIFlatSwitchTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.2;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
4ED8F5351D8DEB1700B97B8D /* Build configuration list for PBXProject "AIFlatSwitch" */ = {
isa = XCConfigurationList;
buildConfigurations = (
4ED8F54D1D8DEB1700B97B8D /* Debug */,
4ED8F54E1D8DEB1700B97B8D /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
4ED8F54F1D8DEB1700B97B8D /* Build configuration list for PBXNativeTarget "AIFlatSwitch" */ = {
isa = XCConfigurationList;
buildConfigurations = (
4ED8F5501D8DEB1700B97B8D /* Debug */,
4ED8F5511D8DEB1700B97B8D /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
4ED8F5521D8DEB1700B97B8D /* Build configuration list for PBXNativeTarget "AIFlatSwitchTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
4ED8F5531D8DEB1700B97B8D /* Debug */,
4ED8F5541D8DEB1700B97B8D /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 4ED8F5321D8DEB1700B97B8D /* Project object */;
}
@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:AIFlatSwitch.xcodeproj">
</FileRef>
</Workspace>
@@ -1,8 +0,0 @@
<?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>
-24
View File
@@ -1,24 +0,0 @@
<?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>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
+57 -75
View File
@@ -3,16 +3,16 @@
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objectVersion = 52;
objects = {
/* Begin PBXBuildFile section */
4E0A87D022F8DA450007472B /* AIFlatSwitch in Frameworks */ = {isa = PBXBuildFile; productRef = 4E0A87CF22F8DA450007472B /* AIFlatSwitch */; };
4ED8F5651D8DED0500B97B8D /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4ED8F5641D8DED0500B97B8D /* AppDelegate.swift */; };
4ED8F5671D8DED0500B97B8D /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4ED8F5661D8DED0500B97B8D /* ViewController.swift */; };
4ED8F56A1D8DED0500B97B8D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4ED8F5681D8DED0500B97B8D /* Main.storyboard */; };
4ED8F56C1D8DED0500B97B8D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4ED8F56B1D8DED0500B97B8D /* Assets.xcassets */; };
4ED8F56F1D8DED0500B97B8D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4ED8F56D1D8DED0500B97B8D /* LaunchScreen.storyboard */; };
EDF147D2648D8C8222D06468 /* Pods_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2CA7270C0DD23A276FC3DC86 /* Pods_Example.framework */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -33,8 +33,7 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
2CA7270C0DD23A276FC3DC86 /* Pods_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
3A279D158D832DA7580EFCEE /* Pods-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig"; sourceTree = "<group>"; };
4E0A87CD22F8DA340007472B /* AIFlatSwitch */ = {isa = PBXFileReference; lastKnownFileType = folder; name = AIFlatSwitch; path = ..; sourceTree = "<group>"; };
4ED8F5611D8DED0500B97B8D /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
4ED8F5641D8DED0500B97B8D /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
4ED8F5661D8DED0500B97B8D /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
@@ -46,7 +45,6 @@
4ED8F57B1D8DED0500B97B8D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
4ED8F5801D8DED0500B97B8D /* ExampleUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ExampleUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
4ED8F5861D8DED0500B97B8D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
6C83B92B368921317E457145 /* Pods-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-Example/Pods-Example.release.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -54,7 +52,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
EDF147D2648D8C8222D06468 /* Pods_Example.framework in Frameworks */,
4E0A87D022F8DA450007472B /* AIFlatSwitch in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -75,10 +73,9 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
30442987A7C9A5912FCE2E2F /* Frameworks */ = {
4E0A87CE22F8DA450007472B /* Frameworks */ = {
isa = PBXGroup;
children = (
2CA7270C0DD23A276FC3DC86 /* Pods_Example.framework */,
);
name = Frameworks;
sourceTree = "<group>";
@@ -86,12 +83,12 @@
4ED8F5581D8DED0500B97B8D = {
isa = PBXGroup;
children = (
4E0A87CD22F8DA340007472B /* AIFlatSwitch */,
4ED8F5631D8DED0500B97B8D /* Example */,
4ED8F5781D8DED0500B97B8D /* ExampleTests */,
4ED8F5831D8DED0500B97B8D /* ExampleUITests */,
4ED8F5621D8DED0500B97B8D /* Products */,
69ECB8C615CBD552A9D8DB81 /* Pods */,
30442987A7C9A5912FCE2E2F /* Frameworks */,
4E0A87CE22F8DA450007472B /* Frameworks */,
);
sourceTree = "<group>";
};
@@ -134,15 +131,6 @@
path = ExampleUITests;
sourceTree = "<group>";
};
69ECB8C615CBD552A9D8DB81 /* Pods */ = {
isa = PBXGroup;
children = (
3A279D158D832DA7580EFCEE /* Pods-Example.debug.xcconfig */,
6C83B92B368921317E457145 /* Pods-Example.release.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -150,17 +138,18 @@
isa = PBXNativeTarget;
buildConfigurationList = 4ED8F5891D8DED0500B97B8D /* Build configuration list for PBXNativeTarget "Example" */;
buildPhases = (
38AAA4F48450F502A05086C7 /* [CP] Check Pods Manifest.lock */,
4ED8F55D1D8DED0500B97B8D /* Sources */,
4ED8F55E1D8DED0500B97B8D /* Frameworks */,
4ED8F55F1D8DED0500B97B8D /* Resources */,
A68BDF1EEF5484A68C283400 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = Example;
packageProductDependencies = (
4E0A87CF22F8DA450007472B /* AIFlatSwitch */,
);
productName = Example;
productReference = 4ED8F5611D8DED0500B97B8D /* Example.app */;
productType = "com.apple.product-type.application";
@@ -208,7 +197,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0800;
LastUpgradeCheck = 1000;
LastUpgradeCheck = 1320;
ORGANIZATIONNAME = cocoatoucher;
TargetAttributes = {
4ED8F5601D8DED0500B97B8D = {
@@ -232,7 +221,7 @@
};
buildConfigurationList = 4ED8F55C1D8DED0500B97B8D /* Build configuration list for PBXProject "Example" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
@@ -277,45 +266,6 @@
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
38AAA4F48450F502A05086C7 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Example-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
A68BDF1EEF5484A68C283400 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-Example/Pods-Example-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/AIFlatSwitch/AIFlatSwitch.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AIFlatSwitch.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Example/Pods-Example-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
4ED8F55D1D8DED0500B97B8D /* Sources */ = {
isa = PBXSourcesBuildPhase;
@@ -379,6 +329,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
@@ -399,6 +350,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -424,7 +376,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
@@ -437,6 +389,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
@@ -457,6 +410,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -476,41 +430,46 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
4ED8F58A1D8DED0500B97B8D /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 3A279D158D832DA7580EFCEE /* Pods-Example.debug.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = Example/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.cocoatoucher.Example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
4ED8F58B1D8DED0500B97B8D /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 6C83B92B368921317E457145 /* Pods-Example.release.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = Example/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.cocoatoucher.Example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Release;
};
@@ -520,7 +479,11 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
INFOPLIST_FILE = ExampleTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.cocoatoucher.ExampleTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
@@ -534,7 +497,11 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
INFOPLIST_FILE = ExampleTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.cocoatoucher.ExampleTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
@@ -547,7 +514,11 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
INFOPLIST_FILE = ExampleUITests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.cocoatoucher.ExampleUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
@@ -560,7 +531,11 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
INFOPLIST_FILE = ExampleUITests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.cocoatoucher.ExampleUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
@@ -608,6 +583,13 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
/* Begin XCSwiftPackageProductDependency section */
4E0A87CF22F8DA450007472B /* AIFlatSwitch */ = {
isa = XCSwiftPackageProductDependency;
productName = AIFlatSwitch;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 4ED8F5591D8DED0500B97B8D /* Project object */;
}
-10
View File
@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:Example.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>
@@ -1,8 +0,0 @@
<?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>
+11 -3
View File
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14313.18" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="wTD-Tt-MES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="wTD-Tt-MES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.14"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
@@ -38,7 +38,9 @@
<userDefinedRuntimeAttribute type="color" keyPath="trailStrokeColor">
<color key="value" red="0.94509803921568625" green="0.63529411764705879" blue="0.15294117647058825" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="boolean" keyPath="isAbc" value="YES"/>
<userDefinedRuntimeAttribute type="color" keyPath="backgroundLayerColor">
<color key="value" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="onSwitchValueChange:" destination="wTD-Tt-MES" eventType="valueChanged" id="BGh-BF-7kd"/>
@@ -60,6 +62,9 @@
<userDefinedRuntimeAttribute type="color" keyPath="trailStrokeColor">
<color key="value" red="0.80000000000000004" green="0.80000000000000004" blue="0.80000000000000004" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="backgroundLayerColor">
<color key="value" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="onSwitchValueChange:" destination="wTD-Tt-MES" eventType="valueChanged" id="K0c-Du-86O"/>
@@ -83,6 +88,9 @@
<color key="value" red="0.18431372549019609" green="0.77254901960784317" blue="0.67843137254901964" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="boolean" keyPath="animatesOnTouch" value="NO"/>
<userDefinedRuntimeAttribute type="color" keyPath="backgroundLayerColor">
<color key="value" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="onSwitchValueChange:" destination="wTD-Tt-MES" eventType="valueChanged" id="YMi-Ut-6Tq"/>
+1
View File
@@ -24,6 +24,7 @@ class ViewController: UIViewController {
self.programmaticSwitch = AIFlatSwitch(frame: CGRect(x: 0, y: 0, width: programmaticSwitchContainer.frame.width, height: programmaticSwitchContainer.frame.height))
self.programmaticSwitch.lineWidth = 2.0
self.programmaticSwitch.strokeColor = UIColor.blue
self.programmaticSwitch.backgroundLayerColor = UIColor.white
self.programmaticSwitch.trailStrokeColor = UIColor.red.withAlphaComponent(0.2)
self.programmaticSwitch.autoresizingMask = [.flexibleWidth, .flexibleHeight]
programmaticSwitchContainer.addSubview(programmaticSwitch)
-8
View File
@@ -1,8 +0,0 @@
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
target 'Example' do
pod 'AIFlatSwitch', :path => '..'
end
-16
View File
@@ -1,16 +0,0 @@
PODS:
- AIFlatSwitch (1.0.4)
DEPENDENCIES:
- AIFlatSwitch (from `..`)
EXTERNAL SOURCES:
AIFlatSwitch:
:path: ".."
SPEC CHECKSUMS:
AIFlatSwitch: 94d2b9bb144b7cc5b5d05a84e31c513c690a4eb5
PODFILE CHECKSUM: ba5655ab2719e6ec0ccf84c53f42a35033524fab
COCOAPODS: 1.5.0
-18
View File
@@ -1,18 +0,0 @@
{
"name": "AIFlatSwitch",
"version": "1.0.4",
"license": "MIT",
"summary": "Nicely animated flat design switch alternative to UISwitch",
"homepage": "https://github.com/cocoatoucher/AIFlatSwitch",
"authors": {
"cocoatoucher": "cocoatoucher@aol.com"
},
"source": {
"git": "https://github.com/cocoatoucher/AIFlatSwitch.git",
"tag": "1.0.4"
},
"platforms": {
"ios": "8.0"
},
"source_files": "Source/*.swift"
}
-16
View File
@@ -1,16 +0,0 @@
PODS:
- AIFlatSwitch (1.0.4)
DEPENDENCIES:
- AIFlatSwitch (from `..`)
EXTERNAL SOURCES:
AIFlatSwitch:
:path: ".."
SPEC CHECKSUMS:
AIFlatSwitch: 94d2b9bb144b7cc5b5d05a84e31c513c690a4eb5
PODFILE CHECKSUM: ba5655ab2719e6ec0ccf84c53f42a35033524fab
COCOAPODS: 1.5.0
-584
View File
@@ -1,584 +0,0 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
09235D56B35B8FD54391D8E351B6AA7E /* Pods-Example-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 15D3FE98E9F2D34863BD3F3597A0485A /* Pods-Example-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; };
0D6BB9F8779A09C0FCA4A8C873ABCAB3 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6604A7D69453B4569E4E4827FB9155A9 /* Foundation.framework */; };
635F3200087C71604AF833622830498C /* AIFlatSwitch-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 131954D2CBBEEAE7CE2F4BEC32AC43CF /* AIFlatSwitch-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; };
8683635BA314464025919455A6A26808 /* AIFlatSwitch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 680523FB1A4D7479D7414E3C03B90A70 /* AIFlatSwitch.swift */; };
B4DEE1D802A25A6CFDAC3A47D5E39AF1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6604A7D69453B4569E4E4827FB9155A9 /* Foundation.framework */; };
BEDD3FE3494D40B4104DDB087A849C35 /* Pods-Example-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 1AD65E35A3233FBE6F2EFDEB3D43D114 /* Pods-Example-dummy.m */; };
EB9067508B4A8C1C648D8ACB51902B9E /* AIFlatSwitch-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 42BA606BC0D3BE1A507FDADE494F2B57 /* AIFlatSwitch-dummy.m */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
8F69B95EB194B907E988714BB3520E15 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */;
proxyType = 1;
remoteGlobalIDString = 3649FDDC9A8AA0D20265834988BD6CDE;
remoteInfo = AIFlatSwitch;
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
044AA3E23F71470C9B5F50D44720EA0D /* Pods-Example-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-Example-resources.sh"; sourceTree = "<group>"; };
11434BC759D12F57876FBB74A4775E74 /* Pods-Example-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-Example-acknowledgements.plist"; sourceTree = "<group>"; };
131954D2CBBEEAE7CE2F4BEC32AC43CF /* AIFlatSwitch-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "AIFlatSwitch-umbrella.h"; sourceTree = "<group>"; };
15D3FE98E9F2D34863BD3F3597A0485A /* Pods-Example-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-Example-umbrella.h"; sourceTree = "<group>"; };
1AD65E35A3233FBE6F2EFDEB3D43D114 /* Pods-Example-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-Example-dummy.m"; sourceTree = "<group>"; };
25A37D4D536CC5988A439441117C41F4 /* Pods-Example.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-Example.modulemap"; sourceTree = "<group>"; };
3ADE9E5655579DB0F79DC9C80758673C /* Pods-Example-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-Example-acknowledgements.markdown"; sourceTree = "<group>"; };
3F3EFEBDE6702DEFDFFF9D5C6DBC3773 /* Pods-Example-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-Example-frameworks.sh"; sourceTree = "<group>"; };
42BA606BC0D3BE1A507FDADE494F2B57 /* AIFlatSwitch-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "AIFlatSwitch-dummy.m"; sourceTree = "<group>"; };
46D718D1C75E5D366E5649FB6CED44A4 /* AIFlatSwitch.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; path = AIFlatSwitch.podspec; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
4D2763E58CE53FC03AAA40DD5A5CE1B2 /* AIFlatSwitch.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = AIFlatSwitch.modulemap; sourceTree = "<group>"; };
5B81C04F8E84EAE60AE15C8695031A5F /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
6604A7D69453B4569E4E4827FB9155A9 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; };
680523FB1A4D7479D7414E3C03B90A70 /* AIFlatSwitch.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AIFlatSwitch.swift; path = Source/AIFlatSwitch.swift; sourceTree = "<group>"; };
6BF1D95729EB871EFCEEFDDA35D4B3E1 /* AIFlatSwitch.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = AIFlatSwitch.framework; path = AIFlatSwitch.framework; sourceTree = BUILT_PRODUCTS_DIR; };
73BAC0CF8E3FD3522E72F223E3131A40 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; path = LICENSE; sourceTree = "<group>"; };
875A75F056D04F9DA9B2D5DC24E69EAD /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; path = README.md; sourceTree = "<group>"; };
8875F28BC9E56EEF150FDE1421F17816 /* Pods_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_Example.framework; path = "Pods-Example.framework"; sourceTree = BUILT_PRODUCTS_DIR; };
93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
A79AC23D5A157FED70D9C53D844B2319 /* Pods-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-Example.release.xcconfig"; sourceTree = "<group>"; };
C3974D8E535BBAFA8A9C8F21CACA4E91 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
CD3844067799E6305C6EAECEA42FBA87 /* AIFlatSwitch-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "AIFlatSwitch-prefix.pch"; sourceTree = "<group>"; };
D6AE77A817C708202EC03E9E0E44766D /* AIFlatSwitch.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = AIFlatSwitch.xcconfig; sourceTree = "<group>"; };
EFC5B2E05B58CD826FD55659BF1D7E39 /* Pods-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-Example.debug.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
21AACF380078FE0FAF648D5E1A4E8D32 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
0D6BB9F8779A09C0FCA4A8C873ABCAB3 /* Foundation.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
F4FA92295949A0889B20BD3E583AE093 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
B4DEE1D802A25A6CFDAC3A47D5E39AF1 /* Foundation.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
1B5ECB992A56AE0C70DC72D88BB90B05 /* Pods-Example */ = {
isa = PBXGroup;
children = (
5B81C04F8E84EAE60AE15C8695031A5F /* Info.plist */,
25A37D4D536CC5988A439441117C41F4 /* Pods-Example.modulemap */,
3ADE9E5655579DB0F79DC9C80758673C /* Pods-Example-acknowledgements.markdown */,
11434BC759D12F57876FBB74A4775E74 /* Pods-Example-acknowledgements.plist */,
1AD65E35A3233FBE6F2EFDEB3D43D114 /* Pods-Example-dummy.m */,
3F3EFEBDE6702DEFDFFF9D5C6DBC3773 /* Pods-Example-frameworks.sh */,
044AA3E23F71470C9B5F50D44720EA0D /* Pods-Example-resources.sh */,
15D3FE98E9F2D34863BD3F3597A0485A /* Pods-Example-umbrella.h */,
EFC5B2E05B58CD826FD55659BF1D7E39 /* Pods-Example.debug.xcconfig */,
A79AC23D5A157FED70D9C53D844B2319 /* Pods-Example.release.xcconfig */,
);
name = "Pods-Example";
path = "Target Support Files/Pods-Example";
sourceTree = "<group>";
};
2E1681ECA8C40B248335DC2E5D1199C3 /* Pod */ = {
isa = PBXGroup;
children = (
46D718D1C75E5D366E5649FB6CED44A4 /* AIFlatSwitch.podspec */,
73BAC0CF8E3FD3522E72F223E3131A40 /* LICENSE */,
875A75F056D04F9DA9B2D5DC24E69EAD /* README.md */,
);
name = Pod;
sourceTree = "<group>";
};
6916EBCD4FD95FFCCDC563302D97F613 /* Support Files */ = {
isa = PBXGroup;
children = (
4D2763E58CE53FC03AAA40DD5A5CE1B2 /* AIFlatSwitch.modulemap */,
D6AE77A817C708202EC03E9E0E44766D /* AIFlatSwitch.xcconfig */,
42BA606BC0D3BE1A507FDADE494F2B57 /* AIFlatSwitch-dummy.m */,
CD3844067799E6305C6EAECEA42FBA87 /* AIFlatSwitch-prefix.pch */,
131954D2CBBEEAE7CE2F4BEC32AC43CF /* AIFlatSwitch-umbrella.h */,
C3974D8E535BBAFA8A9C8F21CACA4E91 /* Info.plist */,
);
name = "Support Files";
path = "Example/Pods/Target Support Files/AIFlatSwitch";
sourceTree = "<group>";
};
69259A8B5BF5CF69EE407B7FB0364BE2 /* Development Pods */ = {
isa = PBXGroup;
children = (
9E40803F7F548E75A1840C057D410A63 /* AIFlatSwitch */,
);
name = "Development Pods";
sourceTree = "<group>";
};
6A4F6A14E3FB951290E4531728B7A461 /* Targets Support Files */ = {
isa = PBXGroup;
children = (
1B5ECB992A56AE0C70DC72D88BB90B05 /* Pods-Example */,
);
name = "Targets Support Files";
sourceTree = "<group>";
};
7DB346D0F39D3F0E887471402A8071AB = {
isa = PBXGroup;
children = (
93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */,
69259A8B5BF5CF69EE407B7FB0364BE2 /* Development Pods */,
BC3CA7F9E30CC8F7E2DD044DD34432FC /* Frameworks */,
A2472449A898827D9C457FBFFEC98248 /* Products */,
6A4F6A14E3FB951290E4531728B7A461 /* Targets Support Files */,
);
sourceTree = "<group>";
};
9E40803F7F548E75A1840C057D410A63 /* AIFlatSwitch */ = {
isa = PBXGroup;
children = (
680523FB1A4D7479D7414E3C03B90A70 /* AIFlatSwitch.swift */,
2E1681ECA8C40B248335DC2E5D1199C3 /* Pod */,
6916EBCD4FD95FFCCDC563302D97F613 /* Support Files */,
);
name = AIFlatSwitch;
path = ../..;
sourceTree = "<group>";
};
A2472449A898827D9C457FBFFEC98248 /* Products */ = {
isa = PBXGroup;
children = (
6BF1D95729EB871EFCEEFDDA35D4B3E1 /* AIFlatSwitch.framework */,
8875F28BC9E56EEF150FDE1421F17816 /* Pods_Example.framework */,
);
name = Products;
sourceTree = "<group>";
};
BC3CA7F9E30CC8F7E2DD044DD34432FC /* Frameworks */ = {
isa = PBXGroup;
children = (
D35AF013A5F0BAD4F32504907A52519E /* iOS */,
);
name = Frameworks;
sourceTree = "<group>";
};
D35AF013A5F0BAD4F32504907A52519E /* iOS */ = {
isa = PBXGroup;
children = (
6604A7D69453B4569E4E4827FB9155A9 /* Foundation.framework */,
);
name = iOS;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
2FFC451B84482832D9BCF6EC9BE5DD4A /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
09235D56B35B8FD54391D8E351B6AA7E /* Pods-Example-umbrella.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
AEA257700CA155386AD749009BF5A521 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
635F3200087C71604AF833622830498C /* AIFlatSwitch-umbrella.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
3649FDDC9A8AA0D20265834988BD6CDE /* AIFlatSwitch */ = {
isa = PBXNativeTarget;
buildConfigurationList = 508BC5F216F608F88EE9A038E13DAC31 /* Build configuration list for PBXNativeTarget "AIFlatSwitch" */;
buildPhases = (
589277F68B3873BE0A042B6651BAB89D /* Sources */,
F4FA92295949A0889B20BD3E583AE093 /* Frameworks */,
AEA257700CA155386AD749009BF5A521 /* Headers */,
);
buildRules = (
);
dependencies = (
);
name = AIFlatSwitch;
productName = AIFlatSwitch;
productReference = 6BF1D95729EB871EFCEEFDDA35D4B3E1 /* AIFlatSwitch.framework */;
productType = "com.apple.product-type.framework";
};
8B125B19F5B59231C4D4B6AB1DA5963A /* Pods-Example */ = {
isa = PBXNativeTarget;
buildConfigurationList = EF3C7FCAE0FD61873DC8BD1930123BC7 /* Build configuration list for PBXNativeTarget "Pods-Example" */;
buildPhases = (
32C41B7EEA00555C27D33CFEA9C24983 /* Sources */,
21AACF380078FE0FAF648D5E1A4E8D32 /* Frameworks */,
2FFC451B84482832D9BCF6EC9BE5DD4A /* Headers */,
);
buildRules = (
);
dependencies = (
AE67DBCF5F0E953D65CA87F41CDC6518 /* PBXTargetDependency */,
);
name = "Pods-Example";
productName = "Pods-Example";
productReference = 8875F28BC9E56EEF150FDE1421F17816 /* Pods_Example.framework */;
productType = "com.apple.product-type.framework";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
D41D8CD98F00B204E9800998ECF8427E /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0930;
LastUpgradeCheck = 0930;
};
buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 7DB346D0F39D3F0E887471402A8071AB;
productRefGroup = A2472449A898827D9C457FBFFEC98248 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
3649FDDC9A8AA0D20265834988BD6CDE /* AIFlatSwitch */,
8B125B19F5B59231C4D4B6AB1DA5963A /* Pods-Example */,
);
};
/* End PBXProject section */
/* Begin PBXSourcesBuildPhase section */
32C41B7EEA00555C27D33CFEA9C24983 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
BEDD3FE3494D40B4104DDB087A849C35 /* Pods-Example-dummy.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
589277F68B3873BE0A042B6651BAB89D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
EB9067508B4A8C1C648D8ACB51902B9E /* AIFlatSwitch-dummy.m in Sources */,
8683635BA314464025919455A6A26808 /* AIFlatSwitch.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
AE67DBCF5F0E953D65CA87F41CDC6518 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = AIFlatSwitch;
target = 3649FDDC9A8AA0D20265834988BD6CDE /* AIFlatSwitch */;
targetProxy = 8F69B95EB194B907E988714BB3520E15 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */
100D2025B3A4DE70C0CF2158BD2C5583 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = A79AC23D5A157FED70D9C53D844B2319 /* Pods-Example.release.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "Target Support Files/Pods-Example/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MACH_O_TYPE = staticlib;
MODULEMAP_FILE = "Target Support Files/Pods-Example/Pods-Example.modulemap";
OTHER_LDFLAGS = "";
OTHER_LIBTOOLFLAGS = "";
PODS_ROOT = "$(SRCROOT)";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Release;
};
1EE19F5DD95931924296F637BF18BD8F /* 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_SIGNING_ALLOWED = NO;
CODE_SIGNING_REQUIRED = NO;
COPY_PHASE_STRIP = NO;
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 = (
"POD_CONFIGURATION_DEBUG=1",
"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;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
STRIP_INSTALLED_PRODUCT = NO;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SYMROOT = "${SRCROOT}/../build";
};
name = Debug;
};
337B383E8328B143DAFE65DB480C2E0D /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = D6AE77A817C708202EC03E9E0E44766D /* AIFlatSwitch.xcconfig */;
buildSettings = {
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_PREFIX_HEADER = "Target Support Files/AIFlatSwitch/AIFlatSwitch-prefix.pch";
INFOPLIST_FILE = "Target Support Files/AIFlatSwitch/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MODULEMAP_FILE = "Target Support Files/AIFlatSwitch/AIFlatSwitch.modulemap";
PRODUCT_MODULE_NAME = AIFlatSwitch;
PRODUCT_NAME = AIFlatSwitch;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) ";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Release;
};
5BEAD2A4E7960B28CC9616E5DCDED990 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = EFC5B2E05B58CD826FD55659BF1D7E39 /* Pods-Example.debug.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "Target Support Files/Pods-Example/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MACH_O_TYPE = staticlib;
MODULEMAP_FILE = "Target Support Files/Pods-Example/Pods-Example.modulemap";
OTHER_LDFLAGS = "";
OTHER_LIBTOOLFLAGS = "";
PODS_ROOT = "$(SRCROOT)";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Debug;
};
7C471EA8FA271E0F7A90373569436306 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = D6AE77A817C708202EC03E9E0E44766D /* AIFlatSwitch.xcconfig */;
buildSettings = {
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
GCC_PREFIX_HEADER = "Target Support Files/AIFlatSwitch/AIFlatSwitch-prefix.pch";
INFOPLIST_FILE = "Target Support Files/AIFlatSwitch/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MODULEMAP_FILE = "Target Support Files/AIFlatSwitch/AIFlatSwitch.modulemap";
PRODUCT_MODULE_NAME = AIFlatSwitch;
PRODUCT_NAME = AIFlatSwitch;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) ";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Debug;
};
F4568DEE257655D290C2B9CEAB37C934 /* 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_SIGNING_ALLOWED = NO;
CODE_SIGNING_REQUIRED = NO;
COPY_PHASE_STRIP = NO;
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_PREPROCESSOR_DEFINITIONS = (
"POD_CONFIGURATION_RELEASE=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;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_NAME = "$(TARGET_NAME)";
STRIP_INSTALLED_PRODUCT = NO;
SYMROOT = "${SRCROOT}/../build";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1EE19F5DD95931924296F637BF18BD8F /* Debug */,
F4568DEE257655D290C2B9CEAB37C934 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
508BC5F216F608F88EE9A038E13DAC31 /* Build configuration list for PBXNativeTarget "AIFlatSwitch" */ = {
isa = XCConfigurationList;
buildConfigurations = (
7C471EA8FA271E0F7A90373569436306 /* Debug */,
337B383E8328B143DAFE65DB480C2E0D /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
EF3C7FCAE0FD61873DC8BD1930123BC7 /* Build configuration list for PBXNativeTarget "Pods-Example" */ = {
isa = XCConfigurationList;
buildConfigurations = (
5BEAD2A4E7960B28CC9616E5DCDED990 /* Debug */,
100D2025B3A4DE70C0CF2158BD2C5583 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = D41D8CD98F00B204E9800998ECF8427E /* Project object */;
}
@@ -1,5 +0,0 @@
#import <Foundation/Foundation.h>
@interface PodsDummy_AIFlatSwitch : NSObject
@end
@implementation PodsDummy_AIFlatSwitch
@end
@@ -1,12 +0,0 @@
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
@@ -1,16 +0,0 @@
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
FOUNDATION_EXPORT double AIFlatSwitchVersionNumber;
FOUNDATION_EXPORT const unsigned char AIFlatSwitchVersionString[];
@@ -1,6 +0,0 @@
framework module AIFlatSwitch {
umbrella header "AIFlatSwitch-umbrella.h"
export *
module * { export * }
}
@@ -1,9 +0,0 @@
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/AIFlatSwitch
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}
PODS_TARGET_SRCROOT = ${PODS_ROOT}/../..
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
SKIP_INSTALL = YES
@@ -1,26 +0,0 @@
<?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>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${CURRENT_PROJECT_VERSION}</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
@@ -1,26 +0,0 @@
<?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>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${CURRENT_PROJECT_VERSION}</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
@@ -1,29 +0,0 @@
# Acknowledgements
This application makes use of the following third party libraries:
## AIFlatSwitch
The MIT License (MIT)
Copyright (c) 2015 cocoatoucher (http://github.com/cocoatoucher/AIFlatSwitch)
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.
Generated by CocoaPods - https://cocoapods.org
@@ -1,61 +0,0 @@
<?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>PreferenceSpecifiers</key>
<array>
<dict>
<key>FooterText</key>
<string>This application makes use of the following third party libraries:</string>
<key>Title</key>
<string>Acknowledgements</string>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
<dict>
<key>FooterText</key>
<string>The MIT License (MIT)
Copyright (c) 2015 cocoatoucher (http://github.com/cocoatoucher/AIFlatSwitch)
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.
</string>
<key>License</key>
<string>MIT</string>
<key>Title</key>
<string>AIFlatSwitch</string>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
<dict>
<key>FooterText</key>
<string>Generated by CocoaPods - https://cocoapods.org</string>
<key>Title</key>
<string></string>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
</array>
<key>StringsTable</key>
<string>Acknowledgements</string>
<key>Title</key>
<string>Acknowledgements</string>
</dict>
</plist>
@@ -1,5 +0,0 @@
#import <Foundation/Foundation.h>
@interface PodsDummy_Pods_Example : NSObject
@end
@implementation PodsDummy_Pods_Example
@end
@@ -1,153 +0,0 @@
#!/bin/sh
set -e
set -u
set -o pipefail
if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then
# If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy
# frameworks to, so exit 0 (signalling the script phase was successful).
exit 0
fi
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}"
SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
# Used as a return value for each invocation of `strip_invalid_archs` function.
STRIP_BINARY_RETVAL=0
# This protects against multiple targets copying the same framework dependency at the same time. The solution
# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
# Copies and strips a vendored framework
install_framework()
{
if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
local source="${BUILT_PRODUCTS_DIR}/$1"
elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
elif [ -r "$1" ]; then
local source="$1"
fi
local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink "${source}")"
fi
# Use filter instead of exclude so missing patterns don't throw errors.
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
local basename
basename="$(basename -s .framework "$1")"
binary="${destination}/${basename}.framework/${basename}"
if ! [ -r "$binary" ]; then
binary="${destination}/${basename}"
fi
# Strip invalid architectures so "fat" simulator / device frameworks work on device
if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
strip_invalid_archs "$binary"
fi
# Resign the code if required by the build settings to avoid unstable apps
code_sign_if_enabled "${destination}/$(basename "$1")"
# Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
local swift_runtime_libs
swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
for lib in $swift_runtime_libs; do
echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
code_sign_if_enabled "${destination}/${lib}"
done
fi
}
# Copies and strips a vendored dSYM
install_dsym() {
local source="$1"
if [ -r "$source" ]; then
# Copy the dSYM into a the targets temp dir.
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}"
local basename
basename="$(basename -s .framework.dSYM "$source")"
binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}"
# Strip invalid architectures so "fat" simulator / device frameworks work on device
if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then
strip_invalid_archs "$binary"
fi
if [[ $STRIP_BINARY_RETVAL == 1 ]]; then
# Move the stripped file into its final destination.
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}"
else
# The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing.
touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM"
fi
fi
}
# Signs a framework with the provided identity
code_sign_if_enabled() {
if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
# Use the current code_sign_identitiy
echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'"
if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
code_sign_cmd="$code_sign_cmd &"
fi
echo "$code_sign_cmd"
eval "$code_sign_cmd"
fi
}
# Strip invalid architectures
strip_invalid_archs() {
binary="$1"
# Get architectures for current target binary
binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)"
# Intersect them with the architectures we are building for
intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)"
# If there are no archs supported by this binary then warn the user
if [[ -z "$intersected_archs" ]]; then
echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)."
STRIP_BINARY_RETVAL=0
return
fi
stripped=""
for arch in $binary_archs; do
if ! [[ "${ARCHS}" == *"$arch"* ]]; then
# Strip non-valid architectures in-place
lipo -remove "$arch" -output "$binary" "$binary" || exit 1
stripped="$stripped $arch"
fi
done
if [[ "$stripped" ]]; then
echo "Stripped $binary of architectures:$stripped"
fi
STRIP_BINARY_RETVAL=1
}
if [[ "$CONFIGURATION" == "Debug" ]]; then
install_framework "${BUILT_PRODUCTS_DIR}/AIFlatSwitch/AIFlatSwitch.framework"
fi
if [[ "$CONFIGURATION" == "Release" ]]; then
install_framework "${BUILT_PRODUCTS_DIR}/AIFlatSwitch/AIFlatSwitch.framework"
fi
if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
wait
fi
@@ -1,118 +0,0 @@
#!/bin/sh
set -e
set -u
set -o pipefail
if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then
# If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy
# resources to, so exit 0 (signalling the script phase was successful).
exit 0
fi
mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
> "$RESOURCES_TO_COPY"
XCASSET_FILES=()
# This protects against multiple targets copying the same framework dependency at the same time. The solution
# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
case "${TARGETED_DEVICE_FAMILY:-}" in
1,2)
TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
;;
1)
TARGET_DEVICE_ARGS="--target-device iphone"
;;
2)
TARGET_DEVICE_ARGS="--target-device ipad"
;;
3)
TARGET_DEVICE_ARGS="--target-device tv"
;;
4)
TARGET_DEVICE_ARGS="--target-device watch"
;;
*)
TARGET_DEVICE_ARGS="--target-device mac"
;;
esac
install_resource()
{
if [[ "$1" = /* ]] ; then
RESOURCE_PATH="$1"
else
RESOURCE_PATH="${PODS_ROOT}/$1"
fi
if [[ ! -e "$RESOURCE_PATH" ]] ; then
cat << EOM
error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
EOM
exit 1
fi
case $RESOURCE_PATH in
*.storyboard)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
;;
*.xib)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
;;
*.framework)
echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
;;
*.xcdatamodel)
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true
xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
;;
*.xcdatamodeld)
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true
xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
;;
*.xcmappingmodel)
echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true
xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
;;
*.xcassets)
ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH"
XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
;;
*)
echo "$RESOURCE_PATH" || true
echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
;;
esac
}
mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
fi
rm -f "$RESOURCES_TO_COPY"
if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ]
then
# Find all other xcassets (this unfortunately includes those of path pods and other targets).
OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
while read line; do
if [[ $line != "${PODS_ROOT}*" ]]; then
XCASSET_FILES+=("$line")
fi
done <<<"$OTHER_XCASSETS"
if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then
printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
else
printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_BUILD_DIR}/assetcatalog_generated_info.plist"
fi
fi
@@ -1,16 +0,0 @@
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
FOUNDATION_EXPORT double Pods_ExampleVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_ExampleVersionString[];
@@ -1,11 +0,0 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AIFlatSwitch"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/AIFlatSwitch/AIFlatSwitch.framework/Headers"
OTHER_LDFLAGS = $(inherited) -framework "AIFlatSwitch"
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods
@@ -1,6 +0,0 @@
framework module Pods_Example {
umbrella header "Pods-Example-umbrella.h"
export *
module * { export * }
}
@@ -1,11 +0,0 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AIFlatSwitch"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/AIFlatSwitch/AIFlatSwitch.framework/Headers"
OTHER_LDFLAGS = $(inherited) -framework "AIFlatSwitch"
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods
+18
View File
@@ -0,0 +1,18 @@
// swift-tools-version:5.0
import PackageDescription
let package = Package(
name: "AIFlatSwitch",
platforms: [
.iOS(.v9), .tvOS(.v12)
],
products: [
.library(name: "AIFlatSwitch", targets: ["AIFlatSwitch"])
],
dependencies: [],
targets: [
.target(name: "AIFlatSwitch", path: "Sources"),
.testTarget(name: "AIFlatSwitch-Tests", dependencies: ["AIFlatSwitch"], path: "Tests")
],
swiftLanguageVersions: [.v5]
)
+33 -55
View File
@@ -4,59 +4,26 @@ A smooth, nice looking and IBDesignable flat design switch for iOS. Can be used
Inspired by Creativedash's Dribbble post [here](http://dribbble.com/shots/1631598-On-Off)
[![Platform](http://img.shields.io/badge/platform-ios-blue.svg?style=flat
)](https://developer.apple.com/iphone/index.action)
[![Language](http://img.shields.io/badge/language-swift-brightgreen.svg?style=flat
)](https://developer.apple.com/swift)
[![License](http://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat
)](http://mit-license.org)
<p align="center">
<a target="_blank" rel="noopener noreferrer" href="http://dribbble.com/shots/1631598-On-Off">
<img src="https://s3.amazonaws.com/f.cl.ly/items/1p0w3B0E3m2I2k3e0z1Q/onoff.gif" width="200" max-width="80%" alt="Flat switch animation">
</a>
</p>
<p><a href="url"><img src="https://s3.amazonaws.com/f.cl.ly/items/1p0w3B0E3m2I2k3e0z1Q/onoff.gif" align="left" height="150" width="200" ></a></p>
<br><br><br><br><br><br><br>
<p align="center">
<img src="https://img.shields.io/badge/Swift-5.0-orange.svg"/>
<a href="https://cocoapods.org/pods/AIFlatSwitch">
<img src="https://img.shields.io/cocoapods/v/AIFlatSwitch.svg" alt="cocoapods"/>
</a>
</p>
<p align="center">
<img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square"/>
</p>
## Requirements
- iOS 8.0+
- Xcode 8.0+ (Use pod version 0.0.4 for Xcode 7)
- Swift 4.2+ (Use pod version 0.0.4 for Swift 2.3, Use pod version 1.0.3 for Swift 3)
## Installation
> **Embedded frameworks require a minimum deployment target of iOS 8.**
>
> To use with a project targeting iOS 7, you must include the `AIFlatSwitch.swift` source file directly in your project.
>
### CocoaPods
[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects.
CocoaPods 0.36 adds supports for Swift and embedded frameworks. You can install it with the following command:
```bash
$ gem install cocoapods
```
To integrate AIFlatSwitch into your Xcode project using CocoaPods, specify it in your `Podfile`:
```ruby
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'AIFlatSwitch', '~> 1.0.4'
```
Then, run the following command:
```bash
$ pod install
```
### Manually
1. Download and drop ```AIFlatSwitch.swift``` in your project.
2. Congratulations!
---
- iOS 8.0+, tvOS 12.0+
- Xcode 11.0+
- Swift 5
## Usage
@@ -90,17 +57,30 @@ flatSwitch.setSelected(true, animated: true)
```swift
@IBAction func handleSwitchValueChange(sender: AnyObject) {
if let flatSwitch = sender as? AIFlatSwitch {
println(flatSwitch.isSelected)
print(flatSwitch.isSelected)
}
}
```
> Animation observer callbacks:
```swift
flatSwitch.selectionAnimationDidStart = { isSelected in
print("New state: \(isSelected)")
}
flatSwitch.selectionAnimationDidStop = { isSelected in
print("State when animation stopped: \(isSelected)")
}
```
> Styling the switch:
```swift
flatSwitch.lineWidth = 2.0
flatSwitch.strokeColor = UIColor.blueColor()
flatSwitch.trailStrokeColor = UIColor.redColor()
flatSwitch.strokeColor = UIColor.blue
flatSwitch.trailStrokeColor = UIColor.red
flatSwitch.backgroundLayerColor = UIColor.red
flatSwitch.animatesOnTouch = false
```
- [x] IBInspectable
@@ -109,9 +89,7 @@ flatSwitch.animatesOnTouch = false
- Make your changes in your branch
- Bump the pod version in AIFlatSwitch.podspec file (e.g. 1.0.1 to 1.0.2)
- Make a pod install in Example project to update its dependency to new framework version you just created
- Make sure the Example project compiles and works fine in the Simulator
- Find podspec version references in README.md and update them (e.g. Cocoapods section)
- Find references to your source code changes in README.md and update them (e.g. method names, changed features)
- Create a pull request
-360
View File
@@ -1,360 +0,0 @@
//
// AIFlatSwitch.swift
// AIFlatSwitch
//
// Created by cocoatoucher on 11/02/15.
// Copyright (c) 2015 cocoatoucher. All rights reserved.
//
import UIKit
/**
A flat design switch alternative to UISwitch
*/
@IBDesignable open class AIFlatSwitch: UIControl {
/**
Animation duration for the whole selection transition
*/
fileprivate let animationDuration: CFTimeInterval = 0.3
/**
Percentage where the checkmark tail ends
*/
fileprivate let finalStrokeEndForCheckmark: CGFloat = 0.85
/**
Percentage where the checkmark head begins
*/
fileprivate let finalStrokeStartForCheckmark: CGFloat = 0.3
/**
Percentage of the bounce amount of checkmark near animation completion
*/
fileprivate let checkmarkBounceAmount: CGFloat = 0.1
/**
Line width for the circle, trail and checkmark parts of the switch.
*/
@IBInspectable open var lineWidth: CGFloat = 2.0 {
didSet {
self.circle.lineWidth = lineWidth
self.checkmark.lineWidth = lineWidth
self.trailCircle.lineWidth = lineWidth
}
}
/**
Set to false if the selection should not be animated with touch up inside events.
*/
@IBInspectable open var animatesOnTouch: Bool = true
/**
Stroke color for circle and checkmark.
Circle disappears and trail becomes visible when the switch is selected.
*/
@IBInspectable open var strokeColor: UIColor = UIColor.black {
didSet {
self.circle.strokeColor = strokeColor.cgColor
self.checkmark.strokeColor = strokeColor.cgColor
}
}
/**
Stroke color for trail.
Trail disappears and circle becomes visible when the switch is deselected.
*/
@IBInspectable open var trailStrokeColor: UIColor = UIColor.gray {
didSet {
self.trailCircle.strokeColor = trailStrokeColor.cgColor
}
}
@IBInspectable open var isAbc: Bool = false
/**
Overrides isSelected from UIControl using internal state flag.
Default value is false.
*/
@IBInspectable open override var isSelected: Bool {
get {
return isSelectedInternal
}
set {
super.isSelected = newValue
self.setSelected(newValue, animated: false)
}
}
/**
Internal flag to keep track of selected state.
*/
fileprivate var isSelectedInternal: Bool = false
/**
Trail layer. Trail is the circle which appears when the switch is in deselected state.
*/
fileprivate var trailCircle: CAShapeLayer = CAShapeLayer()
/**
Circle layer. Circle appears when the switch is in selected state.
*/
fileprivate var circle: CAShapeLayer = CAShapeLayer()
/**
Checkmark layer. Checkmark appears when the switch is in selected state.
*/
fileprivate var checkmark: CAShapeLayer = CAShapeLayer()
/**
Middle point of the checkmark layer. Calculated each time the sublayers are layout.
*/
fileprivate var checkmarkSplitPoint: CGPoint = CGPoint.zero
public override init(frame: CGRect) {
super.init(frame: frame)
// Configure switch when created with frame
self.configure()
}
public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
// Configure switch when created from xib
self.configure()
}
/**
Configures circle, trail and checkmark layers after initialization.
Setups switch with the default selection state.
Configures target for tocuh up inside event for triggering selection.
*/
fileprivate func configure() {
func configureShapeLayer(_ shapeLayer: CAShapeLayer) {
shapeLayer.lineJoin = CAShapeLayerLineJoin.round
shapeLayer.lineCap = CAShapeLayerLineCap.round
shapeLayer.lineWidth = self.lineWidth
shapeLayer.fillColor = UIColor.clear.cgColor
self.layer.addSublayer(shapeLayer)
}
// Setup layers
configureShapeLayer(trailCircle)
trailCircle.strokeColor = trailStrokeColor.cgColor
configureShapeLayer(circle)
circle.strokeColor = strokeColor.cgColor
configureShapeLayer(checkmark)
checkmark.strokeColor = strokeColor.cgColor
// Setup initial state
self.setSelected(false, animated: false)
// Add target for handling touch up inside event as a default manner
self.addTarget(self, action: #selector(AIFlatSwitch.handleTouchUpInside), for: UIControl.Event.touchUpInside)
}
/**
Switches between selected and deselected state with touch up inside events. Set animatesOnTouch to false to disable animation on touch.
Send valueChanged event as a result.
*/
@objc fileprivate func handleTouchUpInside() {
self.setSelected(!self.isSelected, animated: self.animatesOnTouch)
self.sendActions(for: UIControl.Event.valueChanged)
}
/**
Switches between selected and deselected state. Use this method to programmatically change the valeu of selected state.
- Parameter isSelected: Whether the switch should be selected or not
- Parameter animated: Whether the transition should be animated or not
*/
open func setSelected(_ isSelected: Bool, animated: Bool) {
self.isSelectedInternal = isSelected
// Remove all animations before switching to new state
checkmark.removeAllAnimations()
circle.removeAllAnimations()
trailCircle.removeAllAnimations()
// Reset sublayer values
self.resetLayerValues(self.isSelectedInternal, stateWillBeAnimated: animated)
// Animate to new state
if animated {
self.addAnimations(desiredSelectedState: isSelectedInternal)
self.accessibilityValue = isSelected ? "checked" : "unchecked"
}
}
open override func layoutSublayers(of layer: CALayer) {
super.layoutSublayers(of: layer)
guard layer == self.layer else {
return
}
var offset: CGPoint = CGPoint.zero
let radius = fmin(self.bounds.width, self.bounds.height) / 2 - (lineWidth / 2)
offset.x = (self.bounds.width - radius * 2) / 2.0
offset.y = (self.bounds.height - radius * 2) / 2.0
CATransaction.begin()
CATransaction.setDisableActions(true)
// Calculate frame for circle and trail circle
let circleAndTrailFrame = CGRect(x: offset.x, y: offset.y, width: radius * 2, height: radius * 2)
let circlePath = UIBezierPath(ovalIn: circleAndTrailFrame)
trailCircle.path = circlePath.cgPath
circle.transform = CATransform3DIdentity
circle.frame = self.bounds
circle.path = UIBezierPath(ovalIn: circleAndTrailFrame).cgPath
// Rotating circle by 212 degrees to be able to manipulate stroke end location.
circle.transform = CATransform3DMakeRotation(CGFloat(212 * Double.pi / 180), 0, 0, 1)
let origin = CGPoint(x: offset.x + radius, y: offset.y + radius)
// Calculate checkmark path
let checkmarkPath = UIBezierPath()
var checkmarkStartPoint = CGPoint.zero
// Checkmark will start from circle's stroke end calculated above.
checkmarkStartPoint.x = origin.x + radius * CGFloat(cos(212 * Double.pi / 180))
checkmarkStartPoint.y = origin.y + radius * CGFloat(sin(212 * Double.pi / 180))
checkmarkPath.move(to: checkmarkStartPoint)
self.checkmarkSplitPoint = CGPoint(x: offset.x + radius * 0.9, y: offset.y + radius * 1.4)
checkmarkPath.addLine(to: self.checkmarkSplitPoint)
var checkmarkEndPoint = CGPoint.zero
// Checkmark will end 320 degrees location of the circle layer.
checkmarkEndPoint.x = origin.x + radius * CGFloat(cos(320 * Double.pi / 180))
checkmarkEndPoint.y = origin.y + radius * CGFloat(sin(320 * Double.pi / 180))
checkmarkPath.addLine(to: checkmarkEndPoint)
checkmark.frame = self.bounds
checkmark.path = checkmarkPath.cgPath
CATransaction.commit()
}
/**
Switches layer values to selected or deselected state without any animation.
If the there is going to be an animation(stateWillBeAnimated parameter is true), then the layer values are reset to reverse of the desired state value to provide the transition for animation.
- Parameter desiredSelectedState: Desired selection state for the reset to handle
- Parameter stateWillBeAnimated: If the reset should prepare the layers for animation
*/
fileprivate func resetLayerValues(_ desiredSelectedState: Bool, stateWillBeAnimated: Bool) {
CATransaction.begin()
CATransaction.setDisableActions(true)
if (desiredSelectedState && stateWillBeAnimated) || (desiredSelectedState == false && stateWillBeAnimated == false) {
// Switch to deselected state
checkmark.strokeEnd = 0.0
checkmark.strokeStart = 0.0
trailCircle.opacity = 0.0
circle.strokeStart = 0.0
circle.strokeEnd = 1.0
} else {
// Switch to selected state
checkmark.strokeEnd = finalStrokeEndForCheckmark
checkmark.strokeStart = finalStrokeStartForCheckmark
trailCircle.opacity = 1.0
circle.strokeStart = 0.0
circle.strokeEnd = 0.0
}
CATransaction.commit()
}
/**
Animates the selected state transition.
- Parameter desiredSelectedState: Desired selection state for the animation to handle
*/
fileprivate func addAnimations(desiredSelectedState selected: Bool) {
let circleAnimationDuration = animationDuration * 0.5
let checkmarkEndDuration = animationDuration * 0.8
let checkmarkStartDuration = checkmarkEndDuration - circleAnimationDuration
let checkmarkBounceDuration = animationDuration - checkmarkEndDuration
let checkmarkAnimationGroup = CAAnimationGroup()
checkmarkAnimationGroup.isRemovedOnCompletion = false
checkmarkAnimationGroup.fillMode = CAMediaTimingFillMode.forwards
checkmarkAnimationGroup.duration = animationDuration
checkmarkAnimationGroup.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.linear)
let checkmarkStrokeEndAnimation = CAKeyframeAnimation(keyPath: "strokeEnd")
checkmarkStrokeEndAnimation.duration = checkmarkEndDuration + checkmarkBounceDuration
checkmarkStrokeEndAnimation.isRemovedOnCompletion = false
checkmarkStrokeEndAnimation.fillMode = CAMediaTimingFillMode.forwards
checkmarkStrokeEndAnimation.calculationMode = CAAnimationCalculationMode.paced
if selected {
checkmarkStrokeEndAnimation.values = [NSNumber(value: 0.0 as Float), NSNumber(value: Float(finalStrokeEndForCheckmark + checkmarkBounceAmount) as Float), NSNumber(value: Float(finalStrokeEndForCheckmark) as Float)]
checkmarkStrokeEndAnimation.keyTimes = [NSNumber(value: 0.0 as Double), NSNumber(value: checkmarkEndDuration as Double), NSNumber(value: checkmarkEndDuration + checkmarkBounceDuration as Double)]
} else {
checkmarkStrokeEndAnimation.values = [NSNumber(value: Float(finalStrokeEndForCheckmark) as Float), NSNumber(value: Float(finalStrokeEndForCheckmark + checkmarkBounceAmount) as Float), NSNumber(value: -0.1 as Float)]
checkmarkStrokeEndAnimation.keyTimes = [NSNumber(value: 0.0 as Double), NSNumber(value: checkmarkBounceDuration as Double), NSNumber(value: checkmarkEndDuration + checkmarkBounceDuration as Double)]
}
let checkmarkStrokeStartAnimation = CAKeyframeAnimation(keyPath: "strokeStart")
checkmarkStrokeStartAnimation.duration = checkmarkStartDuration + checkmarkBounceDuration
checkmarkStrokeStartAnimation.isRemovedOnCompletion = false
checkmarkStrokeStartAnimation.fillMode = CAMediaTimingFillMode.forwards
checkmarkStrokeStartAnimation.calculationMode = CAAnimationCalculationMode.paced
if selected {
checkmarkStrokeStartAnimation.values = [NSNumber(value: 0.0 as Float), NSNumber(value: Float(finalStrokeStartForCheckmark + checkmarkBounceAmount) as Float), NSNumber(value: Float(finalStrokeStartForCheckmark) as Float)]
checkmarkStrokeStartAnimation.keyTimes = [NSNumber(value: 0.0 as Double), NSNumber(value: checkmarkStartDuration as Double), NSNumber(value: checkmarkStartDuration + checkmarkBounceDuration as Double)]
} else {
checkmarkStrokeStartAnimation.values = [NSNumber(value: Float(finalStrokeStartForCheckmark) as Float), NSNumber(value: Float(finalStrokeStartForCheckmark + checkmarkBounceAmount) as Float), NSNumber(value: 0.0 as Float)]
checkmarkStrokeStartAnimation.keyTimes = [NSNumber(value: 0.0 as Double), NSNumber(value: checkmarkBounceDuration as Double), NSNumber(value: checkmarkStartDuration + checkmarkBounceDuration as Double)]
}
if selected {
checkmarkStrokeStartAnimation.beginTime = circleAnimationDuration
}
checkmarkAnimationGroup.animations = [checkmarkStrokeEndAnimation, checkmarkStrokeStartAnimation]
checkmark.add(checkmarkAnimationGroup, forKey: "checkmarkAnimation")
let circleAnimationGroup = CAAnimationGroup()
circleAnimationGroup.duration = animationDuration
circleAnimationGroup.isRemovedOnCompletion = false
circleAnimationGroup.fillMode = CAMediaTimingFillMode.forwards
circleAnimationGroup.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.linear)
let circleStrokeEnd = CABasicAnimation(keyPath: "strokeEnd")
circleStrokeEnd.duration = circleAnimationDuration
if selected {
circleStrokeEnd.beginTime = 0.0
circleStrokeEnd.fromValue = NSNumber(value: 1.0 as Float)
circleStrokeEnd.toValue = NSNumber(value: -0.1 as Float)
} else {
circleStrokeEnd.beginTime = animationDuration - circleAnimationDuration
circleStrokeEnd.fromValue = NSNumber(value: 0.0 as Float)
circleStrokeEnd.toValue = NSNumber(value: 1.0 as Float)
}
circleStrokeEnd.isRemovedOnCompletion = false
circleStrokeEnd.fillMode = CAMediaTimingFillMode.forwards
circleAnimationGroup.animations = [circleStrokeEnd]
circle.add(circleAnimationGroup, forKey: "circleStrokeEnd")
let trailCircleColor = CABasicAnimation(keyPath: "opacity")
trailCircleColor.duration = animationDuration
if selected {
trailCircleColor.fromValue = NSNumber(value: 0.0 as Float)
trailCircleColor.toValue = NSNumber(value: 1.0 as Float)
} else {
trailCircleColor.fromValue = NSNumber(value: 1.0 as Float)
trailCircleColor.toValue = NSNumber(value: 0.0 as Float)
}
trailCircleColor.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.linear)
trailCircleColor.fillMode = CAMediaTimingFillMode.forwards
trailCircleColor.isRemovedOnCompletion = false
trailCircle.add(trailCircleColor, forKey: "trailCircleColor")
}
}
+407
View File
@@ -0,0 +1,407 @@
//
// AIFlatSwitch.swift
// AIFlatSwitch
//
// Created by cocoatoucher on 11/02/15.
// Copyright (c) 2015 cocoatoucher. All rights reserved.
//
import UIKit
/**
A flat design switch alternative to UISwitch
*/
@IBDesignable open class AIFlatSwitch: UIControl {
// MARK: - Public
/**
Line width for the circle, trail and checkmark parts of the switch.
*/
@IBInspectable open var lineWidth: CGFloat = 2.0 {
didSet {
self.circle.lineWidth = lineWidth
self.checkmark.lineWidth = lineWidth
self.trailCircle.lineWidth = lineWidth
}
}
/**
Set to false if the selection should not be animated with touch up inside events.
*/
@IBInspectable open var animatesOnTouch: Bool = true
/**
Stroke color for circle and checkmark.
Circle disappears and trail becomes visible when the switch is selected.
*/
@IBInspectable open var strokeColor: UIColor = UIColor.black {
didSet {
self.circle.strokeColor = strokeColor.cgColor
self.checkmark.strokeColor = strokeColor.cgColor
}
}
/**
Stroke color for trail.
Trail disappears and circle becomes visible when the switch is deselected.
*/
@IBInspectable open var trailStrokeColor: UIColor = UIColor.gray {
didSet {
self.trailCircle.strokeColor = trailStrokeColor.cgColor
}
}
/**
Color for the inner circle.
*/
@IBInspectable open var backgroundLayerColor: UIColor = UIColor.clear {
didSet {
self.backgroundLayer.fillColor = backgroundLayerColor.cgColor
}
}
/**
Overrides isSelected from UIControl using internal state flag.
Default value is false.
*/
@IBInspectable open override var isSelected: Bool {
get {
return isSelectedInternal
}
set {
super.isSelected = newValue
self.setSelected(newValue, animated: false)
}
}
/**
Called when selection animation started
Either when selecting or deselecting
*/
public var selectionAnimationDidStart: ((_ isSelected: Bool) -> Void)?
/**
Called when selection animation stopped
Either when selecting or deselecting
*/
public var selectionAnimationDidStop: ((_ isSelected: Bool) -> Void)?
public override init(frame: CGRect) {
super.init(frame: frame)
// Configure switch when created with frame
self.configure()
}
public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
// Configure switch when created from xib
self.configure()
}
/**
Switches between selected and deselected state. Use this method to programmatically change the value of selected state.
- Parameter isSelected: Whether the switch should be selected or not
- Parameter animated: Whether the transition should be animated or not
*/
open func setSelected(_ isSelected: Bool, animated: Bool) {
self.isSelectedInternal = isSelected
// Remove all animations before switching to new state
checkmark.removeAllAnimations()
circle.removeAllAnimations()
trailCircle.removeAllAnimations()
// Reset sublayer values
self.resetLayerValues(self.isSelectedInternal, stateWillBeAnimated: animated)
// Animate to new state
if animated {
self.addAnimations(desiredSelectedState: isSelectedInternal)
self.accessibilityValue = isSelected ? "checked" : "unchecked"
}
}
open override func layoutSublayers(of layer: CALayer) {
super.layoutSublayers(of: layer)
guard layer == self.layer else {
return
}
var offset: CGPoint = CGPoint.zero
let radius = fmin(self.bounds.width, self.bounds.height) / 2 - (lineWidth / 2)
offset.x = (self.bounds.width - radius * 2) / 2.0
offset.y = (self.bounds.height - radius * 2) / 2.0
CATransaction.begin()
CATransaction.setDisableActions(true)
// Calculate frame for circle and trail circle
let circleAndTrailFrame = CGRect(x: offset.x, y: offset.y, width: radius * 2, height: radius * 2)
let circlePath = UIBezierPath(ovalIn: circleAndTrailFrame)
trailCircle.path = circlePath.cgPath
circle.transform = CATransform3DIdentity
circle.frame = self.bounds
circle.path = UIBezierPath(ovalIn: circleAndTrailFrame).cgPath
// Rotating circle by 212 degrees to be able to manipulate stroke end location.
circle.transform = CATransform3DMakeRotation(CGFloat(212 * Double.pi / 180), 0, 0, 1)
let origin = CGPoint(x: offset.x + radius, y: offset.y + radius)
// Calculate checkmark path
let checkmarkPath = UIBezierPath()
var checkmarkStartPoint = CGPoint.zero
// Checkmark will start from circle's stroke end calculated above.
checkmarkStartPoint.x = origin.x + radius * CGFloat(cos(212 * Double.pi / 180))
checkmarkStartPoint.y = origin.y + radius * CGFloat(sin(212 * Double.pi / 180))
checkmarkPath.move(to: checkmarkStartPoint)
self.checkmarkSplitPoint = CGPoint(x: offset.x + radius * 0.9, y: offset.y + radius * 1.4)
checkmarkPath.addLine(to: self.checkmarkSplitPoint)
var checkmarkEndPoint = CGPoint.zero
// Checkmark will end 320 degrees location of the circle layer.
checkmarkEndPoint.x = origin.x + radius * CGFloat(cos(320 * Double.pi / 180))
checkmarkEndPoint.y = origin.y + radius * CGFloat(sin(320 * Double.pi / 180))
checkmarkPath.addLine(to: checkmarkEndPoint)
checkmark.frame = self.bounds
checkmark.path = checkmarkPath.cgPath
let innerCircleRadius = fmin(self.bounds.width, self.bounds.height) / 2.1 - (lineWidth / 2.1)
offset.x = (self.bounds.width - innerCircleRadius * 2) / 2.0
offset.y = (self.bounds.height - innerCircleRadius * 2) / 2.0
backgroundLayer.path = UIBezierPath(ovalIn: CGRect(x: offset.x, y: offset.y, width: innerCircleRadius * 2, height: innerCircleRadius * 2)).cgPath
CATransaction.commit()
}
// MARK: - Private
/**
Animation duration for the whole selection transition
*/
private let animationDuration: CFTimeInterval = 0.3
/**
Percentage where the checkmark tail ends
*/
private let finalStrokeEndForCheckmark: CGFloat = 0.85
/**
Percentage where the checkmark head begins
*/
private let finalStrokeStartForCheckmark: CGFloat = 0.3
/**
Percentage of the bounce amount of checkmark near animation completion
*/
private let checkmarkBounceAmount: CGFloat = 0.1
/**
Internal flag to keep track of selected state.
*/
private var isSelectedInternal: Bool = false
/**
Trail layer. Trail is the circle which appears when the switch is in deselected state.
*/
private var trailCircle: CAShapeLayer = CAShapeLayer()
/**
Circle layer. Circle appears when the switch is in selected state.
*/
private var circle: CAShapeLayer = CAShapeLayer()
/**
Checkmark layer. Checkmark appears when the switch is in selected state.
*/
private var checkmark: CAShapeLayer = CAShapeLayer()
/**
circleLayer, is the layer which appears inside the circle.
*/
private var backgroundLayer: CAShapeLayer = CAShapeLayer()
/**
Middle point of the checkmark layer. Calculated each time the sublayers are layout.
*/
private var checkmarkSplitPoint: CGPoint = CGPoint.zero
/**
Configures circle, trail and checkmark layers after initialization.
Setups switch with the default selection state.
Configures target for tocuh up inside event for triggering selection.
*/
private func configure() {
func configureShapeLayer(_ shapeLayer: CAShapeLayer) {
shapeLayer.lineJoin = CAShapeLayerLineJoin.round
shapeLayer.lineCap = CAShapeLayerLineCap.round
shapeLayer.lineWidth = self.lineWidth
shapeLayer.fillColor = UIColor.clear.cgColor
self.layer.addSublayer(shapeLayer)
}
// Setup layers
self.layer.addSublayer(backgroundLayer)
backgroundLayer.fillColor = backgroundLayerColor.cgColor
configureShapeLayer(trailCircle)
trailCircle.strokeColor = trailStrokeColor.cgColor
configureShapeLayer(circle)
circle.strokeColor = strokeColor.cgColor
configureShapeLayer(checkmark)
checkmark.strokeColor = strokeColor.cgColor
// Setup initial state
self.setSelected(false, animated: false)
// Add target for handling touch up inside event as a default manner
self.addTarget(self, action: #selector(AIFlatSwitch.handleTouchUpInside), for: UIControl.Event.touchUpInside)
}
/**
Switches between selected and deselected state with touch up inside events. Set animatesOnTouch to false to disable animation on touch.
Send valueChanged event as a result.
*/
@objc private func handleTouchUpInside() {
self.setSelected(!self.isSelected, animated: self.animatesOnTouch)
self.sendActions(for: UIControl.Event.valueChanged)
}
/**
Switches layer values to selected or deselected state without any animation.
If the there is going to be an animation(stateWillBeAnimated parameter is true), then the layer values are reset to reverse of the desired state value to provide the transition for animation.
- Parameter desiredSelectedState: Desired selection state for the reset to handle
- Parameter stateWillBeAnimated: If the reset should prepare the layers for animation
*/
private func resetLayerValues(_ desiredSelectedState: Bool, stateWillBeAnimated: Bool) {
CATransaction.begin()
CATransaction.setDisableActions(true)
if (desiredSelectedState && stateWillBeAnimated) || (desiredSelectedState == false && stateWillBeAnimated == false) {
// Switch to deselected state
checkmark.strokeEnd = 0.0
checkmark.strokeStart = 0.0
trailCircle.opacity = 0.0
circle.strokeStart = 0.0
circle.strokeEnd = 1.0
} else {
// Switch to selected state
checkmark.strokeEnd = finalStrokeEndForCheckmark
checkmark.strokeStart = finalStrokeStartForCheckmark
trailCircle.opacity = 1.0
circle.strokeStart = 0.0
circle.strokeEnd = 0.0
}
CATransaction.commit()
}
/**
Animates the selected state transition.
- Parameter desiredSelectedState: Desired selection state for the animation to handle
*/
private func addAnimations(desiredSelectedState selected: Bool) {
let circleAnimationDuration = animationDuration * 0.5
let checkmarkEndDuration = animationDuration * 0.8
let checkmarkStartDuration = checkmarkEndDuration - circleAnimationDuration
let checkmarkBounceDuration = animationDuration - checkmarkEndDuration
let checkmarkAnimationGroup = CAAnimationGroup()
checkmarkAnimationGroup.isRemovedOnCompletion = false
checkmarkAnimationGroup.fillMode = CAMediaTimingFillMode.forwards
checkmarkAnimationGroup.duration = animationDuration
checkmarkAnimationGroup.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.linear)
let checkmarkStrokeEndAnimation = CAKeyframeAnimation(keyPath: "strokeEnd")
checkmarkStrokeEndAnimation.duration = checkmarkEndDuration + checkmarkBounceDuration
checkmarkStrokeEndAnimation.isRemovedOnCompletion = false
checkmarkStrokeEndAnimation.fillMode = CAMediaTimingFillMode.forwards
checkmarkStrokeEndAnimation.calculationMode = CAAnimationCalculationMode.paced
if selected {
checkmarkStrokeEndAnimation.values = [NSNumber(value: 0.0 as Float), NSNumber(value: Float(finalStrokeEndForCheckmark + checkmarkBounceAmount) as Float), NSNumber(value: Float(finalStrokeEndForCheckmark) as Float)]
checkmarkStrokeEndAnimation.keyTimes = [NSNumber(value: 0.0 as Double), NSNumber(value: checkmarkEndDuration as Double), NSNumber(value: checkmarkEndDuration + checkmarkBounceDuration as Double)]
} else {
checkmarkStrokeEndAnimation.values = [NSNumber(value: Float(finalStrokeEndForCheckmark) as Float), NSNumber(value: Float(finalStrokeEndForCheckmark + checkmarkBounceAmount) as Float), NSNumber(value: -0.1 as Float)]
checkmarkStrokeEndAnimation.keyTimes = [NSNumber(value: 0.0 as Double), NSNumber(value: checkmarkBounceDuration as Double), NSNumber(value: checkmarkEndDuration + checkmarkBounceDuration as Double)]
}
let checkmarkStrokeStartAnimation = CAKeyframeAnimation(keyPath: "strokeStart")
checkmarkStrokeStartAnimation.duration = checkmarkStartDuration + checkmarkBounceDuration
checkmarkStrokeStartAnimation.isRemovedOnCompletion = false
checkmarkStrokeStartAnimation.fillMode = CAMediaTimingFillMode.forwards
checkmarkStrokeStartAnimation.calculationMode = CAAnimationCalculationMode.paced
if selected {
checkmarkStrokeStartAnimation.values = [NSNumber(value: 0.0 as Float), NSNumber(value: Float(finalStrokeStartForCheckmark + checkmarkBounceAmount) as Float), NSNumber(value: Float(finalStrokeStartForCheckmark) as Float)]
checkmarkStrokeStartAnimation.keyTimes = [NSNumber(value: 0.0 as Double), NSNumber(value: checkmarkStartDuration as Double), NSNumber(value: checkmarkStartDuration + checkmarkBounceDuration as Double)]
} else {
checkmarkStrokeStartAnimation.values = [NSNumber(value: Float(finalStrokeStartForCheckmark) as Float), NSNumber(value: Float(finalStrokeStartForCheckmark + checkmarkBounceAmount) as Float), NSNumber(value: 0.0 as Float)]
checkmarkStrokeStartAnimation.keyTimes = [NSNumber(value: 0.0 as Double), NSNumber(value: checkmarkBounceDuration as Double), NSNumber(value: checkmarkStartDuration + checkmarkBounceDuration as Double)]
}
if selected {
checkmarkStrokeStartAnimation.beginTime = circleAnimationDuration
}
checkmarkAnimationGroup.animations = [checkmarkStrokeEndAnimation, checkmarkStrokeStartAnimation]
checkmark.add(checkmarkAnimationGroup, forKey: "checkmarkAnimation")
let circleAnimationGroup = CAAnimationGroup()
circleAnimationGroup.duration = animationDuration
circleAnimationGroup.isRemovedOnCompletion = false
circleAnimationGroup.fillMode = CAMediaTimingFillMode.forwards
circleAnimationGroup.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.linear)
let circleStrokeEnd = CABasicAnimation(keyPath: "strokeEnd")
circleStrokeEnd.duration = circleAnimationDuration
if selected {
circleStrokeEnd.beginTime = 0.0
circleStrokeEnd.fromValue = NSNumber(value: 1.0 as Float)
circleStrokeEnd.toValue = NSNumber(value: -0.1 as Float)
} else {
circleStrokeEnd.beginTime = animationDuration - circleAnimationDuration
circleStrokeEnd.fromValue = NSNumber(value: 0.0 as Float)
circleStrokeEnd.toValue = NSNumber(value: 1.0 as Float)
}
circleStrokeEnd.isRemovedOnCompletion = false
circleStrokeEnd.fillMode = CAMediaTimingFillMode.forwards
circleAnimationGroup.animations = [circleStrokeEnd]
circleAnimationGroup.delegate = self
circle.add(circleAnimationGroup, forKey: "circleStrokeEnd")
let trailCircleColor = CABasicAnimation(keyPath: "opacity")
trailCircleColor.duration = animationDuration
if selected {
trailCircleColor.fromValue = NSNumber(value: 0.0 as Float)
trailCircleColor.toValue = NSNumber(value: 1.0 as Float)
} else {
trailCircleColor.fromValue = NSNumber(value: 1.0 as Float)
trailCircleColor.toValue = NSNumber(value: 0.0 as Float)
}
trailCircleColor.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.linear)
trailCircleColor.fillMode = CAMediaTimingFillMode.forwards
trailCircleColor.isRemovedOnCompletion = false
trailCircle.add(trailCircleColor, forKey: "trailCircleColor")
}
}
extension AIFlatSwitch: CAAnimationDelegate {
public func animationDidStart(_ anim: CAAnimation) {
selectionAnimationDidStart?(isSelectedInternal)
}
public func animationDidStop(_ anim: CAAnimation, finished flag: Bool) {
selectionAnimationDidStop?(isSelectedInternal)
}
}