27 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
cocoatoucher 2fd25b786d Update .swift-version 2018-11-12 15:08:53 +01:00
cocoatoucher 662bd7b493 Update swift version in Readme 2018-11-12 15:04:43 +01:00
cocoatoucher 0d0369ee44 Update to Swift 4
Adding Contribution guidelines to Readme
2018-11-12 15:02:31 +01:00
cocoatoucher 2425e7a915 Merge pull request #15 from marcuswu/master
Improve accessibility by announcing changed values
2018-09-21 11:30:49 +02:00
Marcus Wu 021827c810 accessibility fix spaces vs tabs 2018-07-20 09:06:09 -04:00
Marcus Wu 1318b88dac bump podspec version 2018-07-18 10:56:21 -04:00
Marcus Wu a4e46759cd Improve accessibility by announcing changed values 2018-06-26 16:44:46 -04:00
cocoatoucher ae2d9ceb22 Merge pull request #13 from bryant1410/master
Fix broken headings in Markdown files
2017-04-19 11:21:54 +02:00
Santiago Castro 16bb26482a Fix broken Markdown headings 2017-04-17 07:11:44 -03:00
cocoatoucher d343a5ee0f Increased pod version 2017-04-08 16:37:15 +02:00
cocoatoucher a68905e181 Merge pull request #12 from Darkkrye/master
Updated for iOS 10.3 and new Xcode 8.3.
2017-04-08 16:33:34 +02:00
Darkkrye d4f9e43ef4 Updated for iOS 10.3 and new Xcode 8.3. 2017-04-05 11:23:26 +02:00
cocoatoucher 6036ea9d11 Version 1.0.1
Added more documentation
Updated title
2016-09-22 19:48:22 +02:00
cocoatoucher d331a5b746 Updated readme for legacy Swift and Xcode 2016-09-18 14:00:42 +02:00
39 changed files with 617 additions and 1981 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 @@
3.0
-11
View File
@@ -1,11 +0,0 @@
Pod::Spec.new do |s|
s.name = 'AIFlatSwitch'
s.version = '1.0.0'
s.license = 'MIT'
s.summary = 'A flat design switch component alternative to iOS 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
-430
View File
@@ -1,430 +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 = 0800;
ORGANIZATIONNAME = cocoatoucher;
TargetAttributes = {
4ED8F53A1D8DEB1700B97B8D = {
CreatedOnToolsVersion = 8.0;
LastSwiftMigration = 0800;
ProvisioningStyle = Automatic;
};
4ED8F5431D8DEB1700B97B8D = {
CreatedOnToolsVersion = 8.0;
LastSwiftMigration = 0800;
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_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_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_VERSION = 3.0;
};
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_VERSION = 3.0;
};
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_VERSION = 3.0;
};
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_VERSION = 3.0;
};
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>
-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>
+76 -86
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,18 +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 */,
7DA72E3EE401E9534713F784 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
dependencies = (
);
name = Example;
packageProductDependencies = (
4E0A87CF22F8DA450007472B /* AIFlatSwitch */,
);
productName = Example;
productReference = 4ED8F5611D8DED0500B97B8D /* Example.app */;
productType = "com.apple.product-type.application";
@@ -209,12 +197,12 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0800;
LastUpgradeCheck = 0800;
LastUpgradeCheck = 1320;
ORGANIZATIONNAME = cocoatoucher;
TargetAttributes = {
4ED8F5601D8DED0500B97B8D = {
CreatedOnToolsVersion = 8.0;
LastSwiftMigration = 0800;
LastSwiftMigration = 1000;
ProvisioningStyle = Automatic;
};
4ED8F5741D8DED0500B97B8D = {
@@ -233,7 +221,7 @@
};
buildConfigurationList = 4ED8F55C1D8DED0500B97B8D /* Build configuration list for PBXProject "Example" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
@@ -278,54 +266,6 @@
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
38AAA4F48450F502A05086C7 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../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";
showEnvVarsInLog = 0;
};
7DA72E3EE401E9534713F784 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Example/Pods-Example-resources.sh\"\n";
showEnvVarsInLog = 0;
};
A68BDF1EEF5484A68C283400 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
);
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;
@@ -389,20 +329,30 @@
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++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_SUSPICIOUS_MOVES = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
@@ -426,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;
@@ -439,20 +389,30 @@
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++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_SUSPICIOUS_MOVES = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
@@ -470,39 +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_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
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_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 5.0;
};
name = Release;
};
@@ -512,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;
@@ -526,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;
@@ -539,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;
@@ -552,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;
@@ -600,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 -1
View File
@@ -14,7 +14,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
+27 -6
View File
@@ -1,8 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11201" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="wTD-Tt-MES">
<?xml version="1.0" encoding="UTF-8"?>
<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="11161"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
@@ -19,6 +22,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="if0-Nq-mSF" customClass="AIFlatSwitch" customModule="AIFlatSwitch">
<rect key="frame" x="16" y="28" width="50" height="50"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="width" constant="50" id="6b0-G7-s2c"/>
@@ -34,13 +38,16 @@
<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="selected" 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="BGh-BF-7kd"/>
</connections>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Wpe-KQ-dfv" customClass="AIFlatSwitch" customModule="AIFlatSwitch">
<rect key="frame" x="16" y="98" width="70" height="70"/>
<constraints>
<constraint firstAttribute="height" constant="70" id="UOB-m6-kHF"/>
<constraint firstAttribute="width" constant="70" id="dgd-3H-0Mf"/>
@@ -55,13 +62,16 @@
<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="boolean" keyPath="selected" 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="K0c-Du-86O"/>
</connections>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Kjq-na-ZAi" customClass="AIFlatSwitch" customModule="AIFlatSwitch">
<rect key="frame" x="16" y="188" width="30" height="30"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="b0S-rp-S0o"/>
@@ -77,29 +87,35 @@
<userDefinedRuntimeAttribute type="color" keyPath="trailStrokeColor">
<color key="value" red="0.18431372549019609" green="0.77254901960784317" blue="0.67843137254901964" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="boolean" keyPath="selected" value="NO"/>
<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"/>
</connections>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="State" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JeA-RR-O87">
<rect key="frame" x="74" y="42.5" width="40.5" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Auto select &amp; animation" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="esR-Sl-3KM">
<rect key="frame" x="94" y="122.5" width="181.5" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Auto select &amp; no animation" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="VzB-Wm-qAV">
<rect key="frame" x="54" y="192.5" width="205" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="djN-Dk-3LS">
<rect key="frame" x="16" y="238" width="50" height="50"/>
<color key="backgroundColor" red="0.82352941180000006" green="0.82352941180000006" blue="0.82352941180000006" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="8Je-M2-Jhc"/>
@@ -107,6 +123,7 @@
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Added from view controller" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wyR-ag-4eg">
<rect key="frame" x="74" y="252.5" width="206.5" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
@@ -116,6 +133,7 @@
<constraints>
<constraint firstItem="Wpe-KQ-dfv" firstAttribute="top" secondItem="if0-Nq-mSF" secondAttribute="bottom" constant="20" id="1iI-gd-Anf"/>
<constraint firstItem="djN-Dk-3LS" firstAttribute="centerY" secondItem="wyR-ag-4eg" secondAttribute="centerY" constant="0.5" id="2R5-lD-Jlh"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="wyR-ag-4eg" secondAttribute="trailing" id="50j-Ba-1a1"/>
<constraint firstItem="Wpe-KQ-dfv" firstAttribute="leading" secondItem="if0-Nq-mSF" secondAttribute="leading" id="ABS-Eo-0Ko"/>
<constraint firstItem="JeA-RR-O87" firstAttribute="centerY" secondItem="if0-Nq-mSF" secondAttribute="centerY" constant="-0.5" id="Am9-UL-Ik8"/>
<constraint firstItem="JeA-RR-O87" firstAttribute="leading" secondItem="if0-Nq-mSF" secondAttribute="trailing" constant="8" id="FYc-eZ-EmE"/>
@@ -126,9 +144,12 @@
<constraint firstItem="esR-Sl-3KM" firstAttribute="leading" secondItem="Wpe-KQ-dfv" secondAttribute="trailing" constant="8" id="VY1-nc-pOA"/>
<constraint firstItem="Kjq-na-ZAi" firstAttribute="leading" secondItem="Wpe-KQ-dfv" secondAttribute="leading" id="Vpm-ui-WCZ"/>
<constraint firstItem="if0-Nq-mSF" firstAttribute="leading" secondItem="5e8-Cf-Z2w" secondAttribute="leading" constant="16" id="dIE-Gy-Eyk"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="esR-Sl-3KM" secondAttribute="trailing" id="eiq-qo-Xi6"/>
<constraint firstItem="VzB-Wm-qAV" firstAttribute="leading" secondItem="Kjq-na-ZAi" secondAttribute="trailing" constant="8" id="h5X-lz-DvC"/>
<constraint firstItem="djN-Dk-3LS" firstAttribute="leading" secondItem="Kjq-na-ZAi" secondAttribute="leading" id="i2t-Ip-mb9"/>
<constraint firstItem="djN-Dk-3LS" firstAttribute="top" secondItem="Kjq-na-ZAi" secondAttribute="bottom" constant="20" id="n0b-Rg-iqw"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="VzB-Wm-qAV" secondAttribute="trailing" id="nNf-sx-77a"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="JeA-RR-O87" secondAttribute="trailing" id="obb-gY-2oC"/>
<constraint firstItem="wyR-ag-4eg" firstAttribute="leading" secondItem="djN-Dk-3LS" secondAttribute="trailing" constant="8" id="pig-et-8am"/>
</constraints>
</view>
+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.0)
DEPENDENCIES:
- AIFlatSwitch (from `..`)
EXTERNAL SOURCES:
AIFlatSwitch:
:path: ..
SPEC CHECKSUMS:
AIFlatSwitch: 096cca03382bed5e937ed517bc0e825d2f345134
PODFILE CHECKSUM: ba5655ab2719e6ec0ccf84c53f42a35033524fab
COCOAPODS: 1.1.0.rc.2
-18
View File
@@ -1,18 +0,0 @@
{
"name": "AIFlatSwitch",
"version": "1.0.0",
"license": "MIT",
"summary": "A flat design switch component alternative to iOS UISwitch",
"homepage": "https://github.com/cocoatoucher/AIFlatSwitch",
"authors": {
"cocoatoucher": "cocoatoucher@aol.com"
},
"source": {
"git": "https://github.com/cocoatoucher/AIFlatSwitch.git",
"tag": "1.0.0"
},
"platforms": {
"ios": "8.0"
},
"source_files": "Source/*.swift"
}
-16
View File
@@ -1,16 +0,0 @@
PODS:
- AIFlatSwitch (1.0.0)
DEPENDENCIES:
- AIFlatSwitch (from `..`)
EXTERNAL SOURCES:
AIFlatSwitch:
:path: ..
SPEC CHECKSUMS:
AIFlatSwitch: 096cca03382bed5e937ed517bc0e825d2f345134
PODFILE CHECKSUM: ba5655ab2719e6ec0ccf84c53f42a35033524fab
COCOAPODS: 1.1.0.rc.2
-542
View File
@@ -1,542 +0,0 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
21C59CC7C4350189FBD922BC25000152 /* AIFlatSwitch-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 806B5726A5955685A4405A1BBEC25767 /* AIFlatSwitch-dummy.m */; };
22DCAB6BF00A404B964A08B9F266396E /* AIFlatSwitch-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = D8C1EBB2D9DF83E295A58C8DAAB12067 /* AIFlatSwitch-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; };
4AE130986E9A887888822B477523CCA3 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CEC22C73C1608DFA5D5D78BDCB218219 /* Foundation.framework */; };
5232681B2734E7FD25C10D0C9FF016C1 /* Pods-Example-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = C9BDE82371C83FA9AE91B05F77ACAA36 /* Pods-Example-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; };
5849F04FC4FAF1FC3D4D294DABEA6348 /* Pods-Example-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 699118D7DDD5F335E4FB8B17DC0F12D2 /* Pods-Example-dummy.m */; };
58A000D861FF2004C0FE6A7F26B9B2DA /* AIFlatSwitch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D1EC0119EDDAC74C699131A40CE0494 /* AIFlatSwitch.swift */; };
7890CA162D477323236FAF876265CE42 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CEC22C73C1608DFA5D5D78BDCB218219 /* Foundation.framework */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
02AE7AE8CBC596508AFD4E71699B8932 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */;
proxyType = 1;
remoteGlobalIDString = BA367D4FAFCCF41E77D7DBAFE08E3578;
remoteInfo = AIFlatSwitch;
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
01E6907CF2644EB1CF8E23F708A3DA0B /* Pods-Example-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-Example-resources.sh"; sourceTree = "<group>"; };
119072C64A19799964E1620D83F514FB /* Pods-Example.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-Example.modulemap"; sourceTree = "<group>"; };
149054C495E8EC590CAB4C524133016F /* Pods-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-Example.debug.xcconfig"; sourceTree = "<group>"; };
26AAF48D5E23E68895707810219A6EFF /* AIFlatSwitch-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "AIFlatSwitch-prefix.pch"; sourceTree = "<group>"; };
552550F3F912264E5D073F8893691F88 /* Pods-Example-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-Example-frameworks.sh"; sourceTree = "<group>"; };
5D1EC0119EDDAC74C699131A40CE0494 /* AIFlatSwitch.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AIFlatSwitch.swift; sourceTree = "<group>"; };
5E40194C4C8E0AEEBBB5F0D22B241206 /* AIFlatSwitch.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = AIFlatSwitch.modulemap; sourceTree = "<group>"; };
607A485DA84CD2A9C68B9E2764F56F02 /* AIFlatSwitch.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = AIFlatSwitch.xcconfig; sourceTree = "<group>"; };
699118D7DDD5F335E4FB8B17DC0F12D2 /* Pods-Example-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-Example-dummy.m"; sourceTree = "<group>"; };
6BF1D95729EB871EFCEEFDDA35D4B3E1 /* AIFlatSwitch.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AIFlatSwitch.framework; sourceTree = BUILT_PRODUCTS_DIR; };
764D33E23CE6C1111110B04F5CBADADB /* Pods-Example-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-Example-acknowledgements.plist"; sourceTree = "<group>"; };
806B5726A5955685A4405A1BBEC25767 /* AIFlatSwitch-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "AIFlatSwitch-dummy.m"; sourceTree = "<group>"; };
8875F28BC9E56EEF150FDE1421F17816 /* Pods_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
8E9A5E3483D98B8AC9D8E1CDFD3B6CAE /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
A661FECCEBFF9D01869EE3B29C4C1EFF /* Pods-Example-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-Example-acknowledgements.markdown"; sourceTree = "<group>"; };
C9BDE82371C83FA9AE91B05F77ACAA36 /* Pods-Example-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-Example-umbrella.h"; sourceTree = "<group>"; };
CEC22C73C1608DFA5D5D78BDCB218219 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; };
D8C1EBB2D9DF83E295A58C8DAAB12067 /* AIFlatSwitch-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "AIFlatSwitch-umbrella.h"; sourceTree = "<group>"; };
E512A5F985F876750237FD237C3AEEDA /* Pods-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-Example.release.xcconfig"; sourceTree = "<group>"; };
EFFB74AAA6B2AE8DABF0E88E61E09178 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
2270D53A0A948138B0231F4D8CD6D728 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
7890CA162D477323236FAF876265CE42 /* Foundation.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
95909E012C491222487FE8AA6B7A2929 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
4AE130986E9A887888822B477523CCA3 /* Foundation.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
11A16EE0023990C078DF8F69096B0D60 /* AIFlatSwitch */ = {
isa = PBXGroup;
children = (
4375572BF8711159C21AB4984EF02E83 /* Source */,
ADFAA37CA7311E0031178DDEC41EF701 /* Support Files */,
);
name = AIFlatSwitch;
path = ../..;
sourceTree = "<group>";
};
39ECEC6164759B2A29798E86568EB8FB /* Development Pods */ = {
isa = PBXGroup;
children = (
11A16EE0023990C078DF8F69096B0D60 /* AIFlatSwitch */,
);
name = "Development Pods";
sourceTree = "<group>";
};
3DCAB2B7CDE207B3958B6CB957FCC758 /* iOS */ = {
isa = PBXGroup;
children = (
CEC22C73C1608DFA5D5D78BDCB218219 /* Foundation.framework */,
);
name = iOS;
sourceTree = "<group>";
};
4375572BF8711159C21AB4984EF02E83 /* Source */ = {
isa = PBXGroup;
children = (
5D1EC0119EDDAC74C699131A40CE0494 /* AIFlatSwitch.swift */,
);
path = Source;
sourceTree = "<group>";
};
6A4F6A14E3FB951290E4531728B7A461 /* Targets Support Files */ = {
isa = PBXGroup;
children = (
FE9811ABEB5931E154211FCA14B78350 /* Pods-Example */,
);
name = "Targets Support Files";
sourceTree = "<group>";
};
7DB346D0F39D3F0E887471402A8071AB = {
isa = PBXGroup;
children = (
93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */,
39ECEC6164759B2A29798E86568EB8FB /* Development Pods */,
BC3CA7F9E30CC8F7E2DD044DD34432FC /* Frameworks */,
A2472449A898827D9C457FBFFEC98248 /* Products */,
6A4F6A14E3FB951290E4531728B7A461 /* Targets Support Files */,
);
sourceTree = "<group>";
};
A2472449A898827D9C457FBFFEC98248 /* Products */ = {
isa = PBXGroup;
children = (
6BF1D95729EB871EFCEEFDDA35D4B3E1 /* AIFlatSwitch.framework */,
8875F28BC9E56EEF150FDE1421F17816 /* Pods_Example.framework */,
);
name = Products;
sourceTree = "<group>";
};
ADFAA37CA7311E0031178DDEC41EF701 /* Support Files */ = {
isa = PBXGroup;
children = (
5E40194C4C8E0AEEBBB5F0D22B241206 /* AIFlatSwitch.modulemap */,
607A485DA84CD2A9C68B9E2764F56F02 /* AIFlatSwitch.xcconfig */,
806B5726A5955685A4405A1BBEC25767 /* AIFlatSwitch-dummy.m */,
26AAF48D5E23E68895707810219A6EFF /* AIFlatSwitch-prefix.pch */,
D8C1EBB2D9DF83E295A58C8DAAB12067 /* AIFlatSwitch-umbrella.h */,
8E9A5E3483D98B8AC9D8E1CDFD3B6CAE /* Info.plist */,
);
name = "Support Files";
path = "Example/Pods/Target Support Files/AIFlatSwitch";
sourceTree = "<group>";
};
BC3CA7F9E30CC8F7E2DD044DD34432FC /* Frameworks */ = {
isa = PBXGroup;
children = (
3DCAB2B7CDE207B3958B6CB957FCC758 /* iOS */,
);
name = Frameworks;
sourceTree = "<group>";
};
FE9811ABEB5931E154211FCA14B78350 /* Pods-Example */ = {
isa = PBXGroup;
children = (
EFFB74AAA6B2AE8DABF0E88E61E09178 /* Info.plist */,
119072C64A19799964E1620D83F514FB /* Pods-Example.modulemap */,
A661FECCEBFF9D01869EE3B29C4C1EFF /* Pods-Example-acknowledgements.markdown */,
764D33E23CE6C1111110B04F5CBADADB /* Pods-Example-acknowledgements.plist */,
699118D7DDD5F335E4FB8B17DC0F12D2 /* Pods-Example-dummy.m */,
552550F3F912264E5D073F8893691F88 /* Pods-Example-frameworks.sh */,
01E6907CF2644EB1CF8E23F708A3DA0B /* Pods-Example-resources.sh */,
C9BDE82371C83FA9AE91B05F77ACAA36 /* Pods-Example-umbrella.h */,
149054C495E8EC590CAB4C524133016F /* Pods-Example.debug.xcconfig */,
E512A5F985F876750237FD237C3AEEDA /* Pods-Example.release.xcconfig */,
);
name = "Pods-Example";
path = "Target Support Files/Pods-Example";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
293684A31E2AC143DC7AD436AC14807F /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
5232681B2734E7FD25C10D0C9FF016C1 /* Pods-Example-umbrella.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
BAD792FEFD7204A67256B90C99B0004C /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
22DCAB6BF00A404B964A08B9F266396E /* AIFlatSwitch-umbrella.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
BA367D4FAFCCF41E77D7DBAFE08E3578 /* AIFlatSwitch */ = {
isa = PBXNativeTarget;
buildConfigurationList = 76561368F460657D45554668A627FC7F /* Build configuration list for PBXNativeTarget "AIFlatSwitch" */;
buildPhases = (
D9112AC9699A3466CB0CDA2DFDA3316C /* Sources */,
2270D53A0A948138B0231F4D8CD6D728 /* Frameworks */,
BAD792FEFD7204A67256B90C99B0004C /* Headers */,
);
buildRules = (
);
dependencies = (
);
name = AIFlatSwitch;
productName = AIFlatSwitch;
productReference = 6BF1D95729EB871EFCEEFDDA35D4B3E1 /* AIFlatSwitch.framework */;
productType = "com.apple.product-type.framework";
};
FEF485DC13CF6D558F4F763B4DE69AF7 /* Pods-Example */ = {
isa = PBXNativeTarget;
buildConfigurationList = BB247EB6FE25875989DDD19D17C8CCAE /* Build configuration list for PBXNativeTarget "Pods-Example" */;
buildPhases = (
972EA452D484D2AA3FF239A5E23BD35A /* Sources */,
95909E012C491222487FE8AA6B7A2929 /* Frameworks */,
293684A31E2AC143DC7AD436AC14807F /* Headers */,
);
buildRules = (
);
dependencies = (
45CF46F25576374E9B1A16CA1C274D52 /* 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 = 0730;
LastUpgradeCheck = 0700;
};
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 = (
BA367D4FAFCCF41E77D7DBAFE08E3578 /* AIFlatSwitch */,
FEF485DC13CF6D558F4F763B4DE69AF7 /* Pods-Example */,
);
};
/* End PBXProject section */
/* Begin PBXSourcesBuildPhase section */
972EA452D484D2AA3FF239A5E23BD35A /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
5849F04FC4FAF1FC3D4D294DABEA6348 /* Pods-Example-dummy.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
D9112AC9699A3466CB0CDA2DFDA3316C /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
21C59CC7C4350189FBD922BC25000152 /* AIFlatSwitch-dummy.m in Sources */,
58A000D861FF2004C0FE6A7F26B9B2DA /* AIFlatSwitch.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
45CF46F25576374E9B1A16CA1C274D52 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = AIFlatSwitch;
target = BA367D4FAFCCF41E77D7DBAFE08E3578 /* AIFlatSwitch */;
targetProxy = 02AE7AE8CBC596508AFD4E71699B8932 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */
015A368F878AC3E2CEAE21DDE8026304 /* 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;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGNING_REQUIRED = NO;
COPY_PHASE_STRIP = NO;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"POD_CONFIGURATION_DEBUG=1",
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
ONLY_ACTIVE_ARCH = YES;
PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/;
STRIP_INSTALLED_PRODUCT = NO;
SYMROOT = "${SRCROOT}/../build";
};
name = Debug;
};
036C81DA43694F0E66DC5919B57B6B7A /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 607A485DA84CD2A9C68B9E2764F56F02 /* AIFlatSwitch.xcconfig */;
buildSettings = {
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = dwarf;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES;
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";
MTL_ENABLE_DEBUG_INFO = YES;
PRODUCT_NAME = AIFlatSwitch;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Debug;
};
2B0AF56169687C2CCB83FE2627C60306 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 607A485DA84CD2A9C68B9E2764F56F02 /* AIFlatSwitch.xcconfig */;
buildSettings = {
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES;
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";
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_NAME = AIFlatSwitch;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Release;
};
3762572FD64E23842B66A32B7321E707 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 149054C495E8EC590CAB4C524133016F /* Pods-Example.debug.xcconfig */;
buildSettings = {
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = dwarf;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES;
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";
MTL_ENABLE_DEBUG_INFO = YES;
OTHER_LDFLAGS = "";
OTHER_LIBTOOLFLAGS = "";
PODS_ROOT = "$(SRCROOT)";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = Pods_Example;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Debug;
};
44CDBB6D11DE06DB64D6268622BDC47E /* 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;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGNING_REQUIRED = NO;
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_PREPROCESSOR_DEFINITIONS = (
"POD_CONFIGURATION_RELEASE=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/;
STRIP_INSTALLED_PRODUCT = NO;
SYMROOT = "${SRCROOT}/../build";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
53811FD099C01A1503E1DEF08A052322 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = E512A5F985F876750237FD237C3AEEDA /* Pods-Example.release.xcconfig */;
buildSettings = {
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES;
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";
MTL_ENABLE_DEBUG_INFO = NO;
OTHER_LDFLAGS = "";
OTHER_LIBTOOLFLAGS = "";
PODS_ROOT = "$(SRCROOT)";
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = Pods_Example;
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = {
isa = XCConfigurationList;
buildConfigurations = (
015A368F878AC3E2CEAE21DDE8026304 /* Debug */,
44CDBB6D11DE06DB64D6268622BDC47E /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
76561368F460657D45554668A627FC7F /* Build configuration list for PBXNativeTarget "AIFlatSwitch" */ = {
isa = XCConfigurationList;
buildConfigurations = (
036C81DA43694F0E66DC5919B57B6B7A /* Debug */,
2B0AF56169687C2CCB83FE2627C60306 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
BB247EB6FE25875989DDD19D17C8CCAE /* Build configuration list for PBXNativeTarget "Pods-Example" */ = {
isa = XCConfigurationList;
buildConfigurations = (
3762572FD64E23842B66A32B7321E707 /* Debug */,
53811FD099C01A1503E1DEF08A052322 /* 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,4 +0,0 @@
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#endif
@@ -1,6 +0,0 @@
#import <UIKit/UIKit.h>
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
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public"
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}
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.0</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,91 +0,0 @@
#!/bin/sh
set -e
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
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 dont' throw errors
echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
rsync -av --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
}
# 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}"
echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\""
/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1"
fi
}
# Strip invalid architectures
strip_invalid_archs() {
binary="$1"
# Get architectures for current file
archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
stripped=""
for arch in $archs; do
if ! [[ "${VALID_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
}
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
@@ -1,102 +0,0 @@
#!/bin/sh
set -e
mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
> "$RESOURCES_TO_COPY"
XCASSET_FILES=()
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"
;;
*)
TARGET_DEVICE_ARGS="--target-device mac"
;;
esac
realpath() {
DIRECTORY="$(cd "${1%/*}" && pwd)"
FILENAME="${1##*/}"
echo "$DIRECTORY/$FILENAME"
}
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}"
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}"
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}"
mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
rsync -av "$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\""
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\""
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\""
xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
;;
*.xcassets)
ABSOLUTE_XCASSET_FILE=$(realpath "$RESOURCE_PATH")
XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
;;
*)
echo "$RESOURCE_PATH"
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 != "`realpath $PODS_ROOT`*" ]]; then
XCASSET_FILES+=("$line")
fi
done <<<"$OTHER_XCASSETS"
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}"
fi
@@ -1,6 +0,0 @@
#import <UIKit/UIKit.h>
FOUNDATION_EXPORT double Pods_ExampleVersionNumber;
FOUNDATION_EXPORT const unsigned char Pods_ExampleVersionString[];
@@ -1,11 +0,0 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
EMBEDDED_CONTENT_CONTAINS_SWIFT = 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_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
EMBEDDED_CONTENT_CONTAINS_SWIFT = 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_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]
)
+43 -54
View File
@@ -4,58 +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 7.0.1
## 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.0'
```
Then, run the following command:
```bash
$ pod install
```
### Manually
1. Download and drop ```AIFlatSwitch.swift``` in your project.
2. Congratulations!
---
## Requirements
- iOS 8.0+, tvOS 12.0+
- Xcode 11.0+
- Swift 5
## Usage
@@ -74,7 +42,7 @@ var flatSwitch = AIFlatSwitch(frame: CGRectMake(0, 0, 50, 50))
> To change its selected state:
```swift
flatSwitch.selected = true
flatSwitch.isSelected = true
```
- [x] IBInspectable
@@ -89,21 +57,42 @@ flatSwitch.setSelected(true, animated: true)
```swift
@IBAction func handleSwitchValueChange(sender: AnyObject) {
if let flatSwitch = sender as? AIFlatSwitch {
println(flatSwitch.selected)
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
## Contribution guidelines
- Make your changes in your branch
- Bump the pod version in AIFlatSwitch.podspec file (e.g. 1.0.1 to 1.0.2)
- Make sure the Example project compiles and works fine in the Simulator
- Find references to your source code changes in README.md and update them (e.g. method names, changed features)
- Create a pull request
## License
AIFlatSwitch is released under the MIT license. See LICENSE for details.
-342
View File
@@ -1,342 +0,0 @@
//
// AIFlatSwitch.swift
// AIFlatSwitch
//
// Created by cocoatoucher on 11/02/15.
// Copyright (c) 2015 cocoatoucher. All rights reserved.
//
import UIKit
@IBDesignable open class AIFlatSwitch: UIControl {
fileprivate let finalStrokeEndForCheckmark: CGFloat = 0.85
fileprivate let finalStrokeStartForCheckmark: CGFloat = 0.3
fileprivate let checkmarkBounceAmount: CGFloat = 0.1
fileprivate let animationDuration: CFTimeInterval = 0.3
/**
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
}
}
/**
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 = kCALineJoinRound
shapeLayer.lineCap = kCALineCapRound
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: UIControlEvents.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: UIControlEvents.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)
}
}
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 * M_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 * M_PI / 180))
checkmarkStartPoint.y = origin.y + radius * CGFloat(sin(212 * M_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 * M_PI / 180))
checkmarkEndPoint.y = origin.y + radius * CGFloat(sin(320 * M_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 = kCAFillModeForwards
checkmarkAnimationGroup.duration = animationDuration
checkmarkAnimationGroup.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionLinear)
let checkmarkStrokeEndAnimation = CAKeyframeAnimation(keyPath: "strokeEnd")
checkmarkStrokeEndAnimation.duration = checkmarkEndDuration + checkmarkBounceDuration
checkmarkStrokeEndAnimation.isRemovedOnCompletion = false
checkmarkStrokeEndAnimation.fillMode = kCAFillModeForwards
checkmarkStrokeEndAnimation.calculationMode = kCAAnimationPaced
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 = kCAFillModeForwards
checkmarkStrokeStartAnimation.calculationMode = kCAAnimationPaced
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 = kCAFillModeForwards
circleAnimationGroup.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionLinear)
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 = kCAFillModeForwards
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: kCAMediaTimingFunctionLinear)
trailCircleColor.fillMode = kCAFillModeForwards
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)
}
}