diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aee6145 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.DS_Store +.build/ +build/ +DerivedData/ +xcuserdata/ diff --git a/CGOperators.podspec b/CGOperators.podspec new file mode 100644 index 0000000..8119ca1 --- /dev/null +++ b/CGOperators.podspec @@ -0,0 +1,19 @@ +Pod::Spec.new do |s| + s.name = "CGOperators" + s.version = "1.0" + s.summary = "Easily manipulate CGPoints, CGSizes and CGVectors using math operators" + s.description = <<-DESC + A small Swift framework that enables you to easily manipulate Core Graphic's vector types (CGPoint, CGSize and CGVector) using math operators. + DESC + s.homepage = "https://github.com/JohnSundell/CGOperators" + s.license = { :type => "MIT", :file => "LICENSE" } + s.author = { "John Sundell" => "john@sundell.co" } + s.social_media_url = "" + s.ios.deployment_target = "8.0" + s.osx.deployment_target = "10.9" + s.watchos.deployment_target = "2.0" + s.tvos.deployment_target = "9.0" + s.source = { :git => "https://github.com/JohnSundell/CGOperators.git", :tag => s.version.to_s } + s.source_files = "Sources/**/*" + s.frameworks = "Foundation" +end diff --git a/CGOperators.xcodeproj/project.pbxproj b/CGOperators.xcodeproj/project.pbxproj new file mode 100644 index 0000000..e056e91 --- /dev/null +++ b/CGOperators.xcodeproj/project.pbxproj @@ -0,0 +1,974 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 47; + objects = { + +/* Begin PBXBuildFile section */ + 52D6D9871BEFF229002C0205 /* CGOperators.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52D6D97C1BEFF229002C0205 /* CGOperators.framework */; }; + 8933C7851EB5B820000D00A4 /* CGOperators.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8933C7841EB5B820000D00A4 /* CGOperators.swift */; }; + 8933C7861EB5B820000D00A4 /* CGOperators.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8933C7841EB5B820000D00A4 /* CGOperators.swift */; }; + 8933C7871EB5B820000D00A4 /* CGOperators.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8933C7841EB5B820000D00A4 /* CGOperators.swift */; }; + 8933C7881EB5B820000D00A4 /* CGOperators.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8933C7841EB5B820000D00A4 /* CGOperators.swift */; }; + 8933C78E1EB5B82C000D00A4 /* CGOperatorsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8933C7891EB5B82A000D00A4 /* CGOperatorsTests.swift */; }; + 8933C78F1EB5B82C000D00A4 /* CGOperatorsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8933C7891EB5B82A000D00A4 /* CGOperatorsTests.swift */; }; + 8933C7901EB5B82D000D00A4 /* CGOperatorsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8933C7891EB5B82A000D00A4 /* CGOperatorsTests.swift */; }; + DD7502881C68FEDE006590AF /* CGOperators.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52D6DA0F1BF000BD002C0205 /* CGOperators.framework */; }; + DD7502921C690C7A006590AF /* CGOperators.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52D6D9F01BEFFFBE002C0205 /* CGOperators.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 52D6D9881BEFF229002C0205 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 52D6D9731BEFF229002C0205 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 52D6D97B1BEFF229002C0205; + remoteInfo = CGOperators; + }; + DD7502801C68FCFC006590AF /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 52D6D9731BEFF229002C0205 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 52D6DA0E1BF000BD002C0205; + remoteInfo = "CGOperators-macOS"; + }; + DD7502931C690C7A006590AF /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 52D6D9731BEFF229002C0205 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 52D6D9EF1BEFFFBE002C0205; + remoteInfo = "CGOperators-tvOS"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 52D6D97C1BEFF229002C0205 /* CGOperators.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CGOperators.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 52D6D9861BEFF229002C0205 /* CGOperators-iOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "CGOperators-iOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 52D6D9E21BEFFF6E002C0205 /* CGOperators.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CGOperators.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 52D6D9F01BEFFFBE002C0205 /* CGOperators.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CGOperators.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 52D6DA0F1BF000BD002C0205 /* CGOperators.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CGOperators.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 8933C7841EB5B820000D00A4 /* CGOperators.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CGOperators.swift; sourceTree = ""; }; + 8933C7891EB5B82A000D00A4 /* CGOperatorsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CGOperatorsTests.swift; sourceTree = ""; }; + AD2FAA261CD0B6D800659CF4 /* CGOperators.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = CGOperators.plist; sourceTree = ""; }; + AD2FAA281CD0B6E100659CF4 /* CGOperatorsTests.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = CGOperatorsTests.plist; sourceTree = ""; }; + DD75027A1C68FCFC006590AF /* CGOperators-macOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "CGOperators-macOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + DD75028D1C690C7A006590AF /* CGOperators-tvOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "CGOperators-tvOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 52D6D9781BEFF229002C0205 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 52D6D9831BEFF229002C0205 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 52D6D9871BEFF229002C0205 /* CGOperators.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 52D6D9DE1BEFFF6E002C0205 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 52D6D9EC1BEFFFBE002C0205 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 52D6DA0B1BF000BD002C0205 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + DD7502771C68FCFC006590AF /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + DD7502881C68FEDE006590AF /* CGOperators.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + DD75028A1C690C7A006590AF /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + DD7502921C690C7A006590AF /* CGOperators.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 52D6D9721BEFF229002C0205 = { + isa = PBXGroup; + children = ( + 8933C7811EB5B7E0000D00A4 /* Sources */, + 8933C7831EB5B7EB000D00A4 /* Tests */, + 52D6D99C1BEFF38C002C0205 /* Configs */, + 52D6D97D1BEFF229002C0205 /* Products */, + ); + sourceTree = ""; + }; + 52D6D97D1BEFF229002C0205 /* Products */ = { + isa = PBXGroup; + children = ( + 52D6D97C1BEFF229002C0205 /* CGOperators.framework */, + 52D6D9861BEFF229002C0205 /* CGOperators-iOS Tests.xctest */, + 52D6D9E21BEFFF6E002C0205 /* CGOperators.framework */, + 52D6D9F01BEFFFBE002C0205 /* CGOperators.framework */, + 52D6DA0F1BF000BD002C0205 /* CGOperators.framework */, + DD75027A1C68FCFC006590AF /* CGOperators-macOS Tests.xctest */, + DD75028D1C690C7A006590AF /* CGOperators-tvOS Tests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 52D6D99C1BEFF38C002C0205 /* Configs */ = { + isa = PBXGroup; + children = ( + DD7502721C68FC1B006590AF /* Frameworks */, + DD7502731C68FC20006590AF /* Tests */, + ); + path = Configs; + sourceTree = ""; + }; + 8933C7811EB5B7E0000D00A4 /* Sources */ = { + isa = PBXGroup; + children = ( + 8933C7841EB5B820000D00A4 /* CGOperators.swift */, + ); + path = Sources; + sourceTree = ""; + }; + 8933C7831EB5B7EB000D00A4 /* Tests */ = { + isa = PBXGroup; + children = ( + 8933C7891EB5B82A000D00A4 /* CGOperatorsTests.swift */, + ); + name = Tests; + path = Tests/CGOperatorsTests; + sourceTree = ""; + }; + DD7502721C68FC1B006590AF /* Frameworks */ = { + isa = PBXGroup; + children = ( + AD2FAA261CD0B6D800659CF4 /* CGOperators.plist */, + ); + name = Frameworks; + sourceTree = ""; + }; + DD7502731C68FC20006590AF /* Tests */ = { + isa = PBXGroup; + children = ( + AD2FAA281CD0B6E100659CF4 /* CGOperatorsTests.plist */, + ); + name = Tests; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 52D6D9791BEFF229002C0205 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 52D6D9DF1BEFFF6E002C0205 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 52D6D9ED1BEFFFBE002C0205 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 52D6DA0C1BF000BD002C0205 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 52D6D97B1BEFF229002C0205 /* CGOperators-iOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 52D6D9901BEFF229002C0205 /* Build configuration list for PBXNativeTarget "CGOperators-iOS" */; + buildPhases = ( + 52D6D9771BEFF229002C0205 /* Sources */, + 52D6D9781BEFF229002C0205 /* Frameworks */, + 52D6D9791BEFF229002C0205 /* Headers */, + 52D6D97A1BEFF229002C0205 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "CGOperators-iOS"; + productName = CGOperators; + productReference = 52D6D97C1BEFF229002C0205 /* CGOperators.framework */; + productType = "com.apple.product-type.framework"; + }; + 52D6D9851BEFF229002C0205 /* CGOperators-iOS Tests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 52D6D9931BEFF229002C0205 /* Build configuration list for PBXNativeTarget "CGOperators-iOS Tests" */; + buildPhases = ( + 52D6D9821BEFF229002C0205 /* Sources */, + 52D6D9831BEFF229002C0205 /* Frameworks */, + 52D6D9841BEFF229002C0205 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 52D6D9891BEFF229002C0205 /* PBXTargetDependency */, + ); + name = "CGOperators-iOS Tests"; + productName = CGOperatorsTests; + productReference = 52D6D9861BEFF229002C0205 /* CGOperators-iOS Tests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 52D6D9E11BEFFF6E002C0205 /* CGOperators-watchOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 52D6D9E71BEFFF6E002C0205 /* Build configuration list for PBXNativeTarget "CGOperators-watchOS" */; + buildPhases = ( + 52D6D9DD1BEFFF6E002C0205 /* Sources */, + 52D6D9DE1BEFFF6E002C0205 /* Frameworks */, + 52D6D9DF1BEFFF6E002C0205 /* Headers */, + 52D6D9E01BEFFF6E002C0205 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "CGOperators-watchOS"; + productName = "CGOperators-watchOS"; + productReference = 52D6D9E21BEFFF6E002C0205 /* CGOperators.framework */; + productType = "com.apple.product-type.framework"; + }; + 52D6D9EF1BEFFFBE002C0205 /* CGOperators-tvOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 52D6DA011BEFFFBE002C0205 /* Build configuration list for PBXNativeTarget "CGOperators-tvOS" */; + buildPhases = ( + 52D6D9EB1BEFFFBE002C0205 /* Sources */, + 52D6D9EC1BEFFFBE002C0205 /* Frameworks */, + 52D6D9ED1BEFFFBE002C0205 /* Headers */, + 52D6D9EE1BEFFFBE002C0205 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "CGOperators-tvOS"; + productName = "CGOperators-tvOS"; + productReference = 52D6D9F01BEFFFBE002C0205 /* CGOperators.framework */; + productType = "com.apple.product-type.framework"; + }; + 52D6DA0E1BF000BD002C0205 /* CGOperators-macOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 52D6DA201BF000BD002C0205 /* Build configuration list for PBXNativeTarget "CGOperators-macOS" */; + buildPhases = ( + 52D6DA0A1BF000BD002C0205 /* Sources */, + 52D6DA0B1BF000BD002C0205 /* Frameworks */, + 52D6DA0C1BF000BD002C0205 /* Headers */, + 52D6DA0D1BF000BD002C0205 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "CGOperators-macOS"; + productName = "CGOperators-macOS"; + productReference = 52D6DA0F1BF000BD002C0205 /* CGOperators.framework */; + productType = "com.apple.product-type.framework"; + }; + DD7502791C68FCFC006590AF /* CGOperators-macOS Tests */ = { + isa = PBXNativeTarget; + buildConfigurationList = DD7502821C68FCFC006590AF /* Build configuration list for PBXNativeTarget "CGOperators-macOS Tests" */; + buildPhases = ( + DD7502761C68FCFC006590AF /* Sources */, + DD7502771C68FCFC006590AF /* Frameworks */, + DD7502781C68FCFC006590AF /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + DD7502811C68FCFC006590AF /* PBXTargetDependency */, + ); + name = "CGOperators-macOS Tests"; + productName = "CGOperators-OS Tests"; + productReference = DD75027A1C68FCFC006590AF /* CGOperators-macOS Tests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + DD75028C1C690C7A006590AF /* CGOperators-tvOS Tests */ = { + isa = PBXNativeTarget; + buildConfigurationList = DD7502951C690C7A006590AF /* Build configuration list for PBXNativeTarget "CGOperators-tvOS Tests" */; + buildPhases = ( + DD7502891C690C7A006590AF /* Sources */, + DD75028A1C690C7A006590AF /* Frameworks */, + DD75028B1C690C7A006590AF /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + DD7502941C690C7A006590AF /* PBXTargetDependency */, + ); + name = "CGOperators-tvOS Tests"; + productName = "CGOperators-tvOS Tests"; + productReference = DD75028D1C690C7A006590AF /* CGOperators-tvOS Tests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 52D6D9731BEFF229002C0205 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0720; + LastUpgradeCheck = 0810; + ORGANIZATIONNAME = "CGOperators"; + TargetAttributes = { + 52D6D97B1BEFF229002C0205 = { + CreatedOnToolsVersion = 7.1; + LastSwiftMigration = 0800; + }; + 52D6D9851BEFF229002C0205 = { + CreatedOnToolsVersion = 7.1; + LastSwiftMigration = 0800; + }; + 52D6D9E11BEFFF6E002C0205 = { + CreatedOnToolsVersion = 7.1; + LastSwiftMigration = 0800; + }; + 52D6D9EF1BEFFFBE002C0205 = { + CreatedOnToolsVersion = 7.1; + LastSwiftMigration = 0800; + }; + 52D6DA0E1BF000BD002C0205 = { + CreatedOnToolsVersion = 7.1; + LastSwiftMigration = 0800; + }; + DD7502791C68FCFC006590AF = { + CreatedOnToolsVersion = 7.2.1; + LastSwiftMigration = 0800; + }; + DD75028C1C690C7A006590AF = { + CreatedOnToolsVersion = 7.2.1; + LastSwiftMigration = 0800; + }; + }; + }; + buildConfigurationList = 52D6D9761BEFF229002C0205 /* Build configuration list for PBXProject "CGOperators" */; + compatibilityVersion = "Xcode 6.3"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 52D6D9721BEFF229002C0205; + productRefGroup = 52D6D97D1BEFF229002C0205 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 52D6D97B1BEFF229002C0205 /* CGOperators-iOS */, + 52D6DA0E1BF000BD002C0205 /* CGOperators-macOS */, + 52D6D9E11BEFFF6E002C0205 /* CGOperators-watchOS */, + 52D6D9EF1BEFFFBE002C0205 /* CGOperators-tvOS */, + 52D6D9851BEFF229002C0205 /* CGOperators-iOS Tests */, + DD7502791C68FCFC006590AF /* CGOperators-macOS Tests */, + DD75028C1C690C7A006590AF /* CGOperators-tvOS Tests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 52D6D97A1BEFF229002C0205 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 52D6D9841BEFF229002C0205 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 52D6D9E01BEFFF6E002C0205 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 52D6D9EE1BEFFFBE002C0205 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 52D6DA0D1BF000BD002C0205 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + DD7502781C68FCFC006590AF /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + DD75028B1C690C7A006590AF /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 52D6D9771BEFF229002C0205 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8933C7851EB5B820000D00A4 /* CGOperators.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 52D6D9821BEFF229002C0205 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8933C7901EB5B82D000D00A4 /* CGOperatorsTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 52D6D9DD1BEFFF6E002C0205 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8933C7871EB5B820000D00A4 /* CGOperators.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 52D6D9EB1BEFFFBE002C0205 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8933C7881EB5B820000D00A4 /* CGOperators.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 52D6DA0A1BF000BD002C0205 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8933C7861EB5B820000D00A4 /* CGOperators.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + DD7502761C68FCFC006590AF /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8933C78F1EB5B82C000D00A4 /* CGOperatorsTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + DD7502891C690C7A006590AF /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8933C78E1EB5B82C000D00A4 /* CGOperatorsTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 52D6D9891BEFF229002C0205 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 52D6D97B1BEFF229002C0205 /* CGOperators-iOS */; + targetProxy = 52D6D9881BEFF229002C0205 /* PBXContainerItemProxy */; + }; + DD7502811C68FCFC006590AF /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 52D6DA0E1BF000BD002C0205 /* CGOperators-macOS */; + targetProxy = DD7502801C68FCFC006590AF /* PBXContainerItemProxy */; + }; + DD7502941C690C7A006590AF /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 52D6D9EF1BEFFFBE002C0205 /* CGOperators-tvOS */; + targetProxy = DD7502931C690C7A006590AF /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 52D6D98E1BEFF229002C0205 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + 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_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_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_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 52D6D98F1BEFF229002C0205 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + 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_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_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_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 52D6D9911BEFF229002C0205 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = Configs/CGOperators.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + ONLY_ACTIVE_ARCH = NO; + PRODUCT_BUNDLE_IDENTIFIER = "com.CGOperators.CGOperators-iOS"; + PRODUCT_NAME = CGOperators; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + }; + name = Debug; + }; + 52D6D9921BEFF229002C0205 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_MODULES = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = Configs/CGOperators.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.CGOperators.CGOperators-iOS"; + PRODUCT_NAME = CGOperators; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; + }; + name = Release; + }; + 52D6D9941BEFF229002C0205 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + INFOPLIST_FILE = Configs/CGOperatorsTests.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.CGOperators.CGOperators-iOS-Tests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + }; + name = Debug; + }; + 52D6D9951BEFF229002C0205 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + INFOPLIST_FILE = Configs/CGOperatorsTests.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.CGOperators.CGOperators-iOS-Tests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; + }; + name = Release; + }; + 52D6D9E81BEFFF6E002C0205 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = Configs/CGOperators.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.CGOperators.CGOperators-watchOS"; + PRODUCT_NAME = CGOperators; + SDKROOT = watchos; + SKIP_INSTALL = YES; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = 4; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Debug; + }; + 52D6D9E91BEFFF6E002C0205 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = Configs/CGOperators.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.CGOperators.CGOperators-watchOS"; + PRODUCT_NAME = CGOperators; + SDKROOT = watchos; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = 4; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Release; + }; + 52D6DA021BEFFFBE002C0205 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = Configs/CGOperators.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.CGOperators.CGOperators-tvOS"; + PRODUCT_NAME = CGOperators; + SDKROOT = appletvos; + SKIP_INSTALL = YES; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = 3; + TVOS_DEPLOYMENT_TARGET = 9.0; + }; + name = Debug; + }; + 52D6DA031BEFFFBE002C0205 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = Configs/CGOperators.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.CGOperators.CGOperators-tvOS"; + PRODUCT_NAME = CGOperators; + SDKROOT = appletvos; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = 3; + TVOS_DEPLOYMENT_TARGET = 9.0; + }; + name = Release; + }; + 52D6DA211BF000BD002C0205 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CODE_SIGN_IDENTITY = "-"; + COMBINE_HIDPI_IMAGES = YES; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_VERSION = A; + INFOPLIST_FILE = Configs/CGOperators.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.10; + PRODUCT_BUNDLE_IDENTIFIER = "com.CGOperators.CGOperators-macOS"; + PRODUCT_NAME = CGOperators; + SDKROOT = macosx; + SKIP_INSTALL = YES; + SWIFT_VERSION = 3.0; + }; + name = Debug; + }; + 52D6DA221BF000BD002C0205 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CODE_SIGN_IDENTITY = "-"; + COMBINE_HIDPI_IMAGES = YES; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_VERSION = A; + INFOPLIST_FILE = Configs/CGOperators.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.10; + PRODUCT_BUNDLE_IDENTIFIER = "com.CGOperators.CGOperators-macOS"; + PRODUCT_NAME = CGOperators; + SDKROOT = macosx; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; + }; + name = Release; + }; + DD7502831C68FCFC006590AF /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_IDENTITY = "-"; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Configs/CGOperatorsTests.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.11; + PRODUCT_BUNDLE_IDENTIFIER = "com.CGOperators.CGOperators-macOS-Tests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + SWIFT_VERSION = 3.0; + }; + name = Debug; + }; + DD7502841C68FCFC006590AF /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_IDENTITY = "-"; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Configs/CGOperatorsTests.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.11; + PRODUCT_BUNDLE_IDENTIFIER = "com.CGOperators.CGOperators-macOS-Tests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; + }; + name = Release; + }; + DD7502961C690C7A006590AF /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Configs/CGOperatorsTests.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.CGOperators.CGOperators-tvOS-Tests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = appletvos; + SWIFT_VERSION = 3.0; + TVOS_DEPLOYMENT_TARGET = 9.1; + }; + name = Debug; + }; + DD7502971C690C7A006590AF /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + INFOPLIST_FILE = Configs/CGOperatorsTests.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.CGOperators.CGOperators-tvOS-Tests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = appletvos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; + TVOS_DEPLOYMENT_TARGET = 9.1; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 52D6D9761BEFF229002C0205 /* Build configuration list for PBXProject "CGOperators" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 52D6D98E1BEFF229002C0205 /* Debug */, + 52D6D98F1BEFF229002C0205 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 52D6D9901BEFF229002C0205 /* Build configuration list for PBXNativeTarget "CGOperators-iOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 52D6D9911BEFF229002C0205 /* Debug */, + 52D6D9921BEFF229002C0205 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 52D6D9931BEFF229002C0205 /* Build configuration list for PBXNativeTarget "CGOperators-iOS Tests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 52D6D9941BEFF229002C0205 /* Debug */, + 52D6D9951BEFF229002C0205 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 52D6D9E71BEFFF6E002C0205 /* Build configuration list for PBXNativeTarget "CGOperators-watchOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 52D6D9E81BEFFF6E002C0205 /* Debug */, + 52D6D9E91BEFFF6E002C0205 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 52D6DA011BEFFFBE002C0205 /* Build configuration list for PBXNativeTarget "CGOperators-tvOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 52D6DA021BEFFFBE002C0205 /* Debug */, + 52D6DA031BEFFFBE002C0205 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 52D6DA201BF000BD002C0205 /* Build configuration list for PBXNativeTarget "CGOperators-macOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 52D6DA211BF000BD002C0205 /* Debug */, + 52D6DA221BF000BD002C0205 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + DD7502821C68FCFC006590AF /* Build configuration list for PBXNativeTarget "CGOperators-macOS Tests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + DD7502831C68FCFC006590AF /* Debug */, + DD7502841C68FCFC006590AF /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + DD7502951C690C7A006590AF /* Build configuration list for PBXNativeTarget "CGOperators-tvOS Tests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + DD7502961C690C7A006590AF /* Debug */, + DD7502971C690C7A006590AF /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 52D6D9731BEFF229002C0205 /* Project object */; +} diff --git a/CGOperators.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CGOperators.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/CGOperators.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/CGOperators.xcodeproj/xcshareddata/xcschemes/CGOperators-iOS.xcscheme b/CGOperators.xcodeproj/xcshareddata/xcschemes/CGOperators-iOS.xcscheme new file mode 100644 index 0000000..723fedd --- /dev/null +++ b/CGOperators.xcodeproj/xcshareddata/xcschemes/CGOperators-iOS.xcscheme @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CGOperators.xcodeproj/xcshareddata/xcschemes/CGOperators-macOS.xcscheme b/CGOperators.xcodeproj/xcshareddata/xcschemes/CGOperators-macOS.xcscheme new file mode 100644 index 0000000..f911869 --- /dev/null +++ b/CGOperators.xcodeproj/xcshareddata/xcschemes/CGOperators-macOS.xcscheme @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CGOperators.xcodeproj/xcshareddata/xcschemes/CGOperators-tvOS.xcscheme b/CGOperators.xcodeproj/xcshareddata/xcschemes/CGOperators-tvOS.xcscheme new file mode 100644 index 0000000..98a08be --- /dev/null +++ b/CGOperators.xcodeproj/xcshareddata/xcschemes/CGOperators-tvOS.xcscheme @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CGOperators.xcodeproj/xcshareddata/xcschemes/CGOperators-watchOS.xcscheme b/CGOperators.xcodeproj/xcshareddata/xcschemes/CGOperators-watchOS.xcscheme new file mode 100644 index 0000000..e025590 --- /dev/null +++ b/CGOperators.xcodeproj/xcshareddata/xcschemes/CGOperators-watchOS.xcscheme @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Configs/CGOperators.plist b/Configs/CGOperators.plist new file mode 100644 index 0000000..f72534a --- /dev/null +++ b/Configs/CGOperators.plist @@ -0,0 +1,28 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSHumanReadableCopyright + Copyright © 2017 John Sundell. All rights reserved. + NSPrincipalClass + + + diff --git a/Configs/CGOperatorsTests.plist b/Configs/CGOperatorsTests.plist new file mode 100644 index 0000000..ba72822 --- /dev/null +++ b/Configs/CGOperatorsTests.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..01cb923 --- /dev/null +++ b/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2017 John Sundell + +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. + diff --git a/Logo.png b/Logo.png new file mode 100644 index 0000000..99f5ba9 Binary files /dev/null and b/Logo.png differ diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..e563be9 --- /dev/null +++ b/Package.swift @@ -0,0 +1,5 @@ +import PackageDescription + +let package = Package( + name: "CGOperators" +) diff --git a/README.md b/README.md new file mode 100644 index 0000000..a55f68b --- /dev/null +++ b/README.md @@ -0,0 +1,72 @@ +

+ CGOperators +

+ +

+ + Swift Package Manager + + + Twitter: @johnsundell + +

+ +Welcome to `CGOperators`, a small Swift framework that enables you to easily manipulate Core Graphic's vector types (`CGPoint`, `CGSize` and `CGVector`) using math operators. It can help you write compact, yet highly readable code when dealing with things like image sizes and frame-based layouts. + +## Examples + +**Add two vectors** + +```swift +let point = view.frame.origin + CGPoint(x: 10, y: 20) +let size = image.size + view.frame.size +let vector = physicsWorld.gravity + player.size +``` + +**Subtract two vectors** + +```swift +let point = view.frame.origin - CGPoint(x: 10, y: 20) +let size = image.size - view.frame.size +let vector = physicsWorld.gravity - player.size +``` + +**Multiply a vector with a constant** + +```swift +view.frame.size = image.size * 4 +button.frame.origin = superview.bounds.size * 2 +physicsWorld.gravity = player.position * 10 +``` + +**Divide a vector by a constant** + +```swift +view.frame.size = image.size / 4 +button.frame.origin = superview.bounds.size / 2 +physicsWorld.gravity = player.position / 10 +``` + +## Installation + +**Using CocoaPods** + +Add `pod CGOperators` to your `Podfile` + +**Using Carthage** + +Add `git "JohnSundell/CGOperators"` to your `Cartfile` + +**Using the Swift Package Manager** + +Add `Package(url: "https://github.com/JohnSundell/CGOperators.git, majorVersion: 1)` to your `Package.swift` file. + +**Using [Marathon](https://github.com/JohnSundell/Marathon)** + +Run `marathon add https://github.com/JohnSundell/CGOperators.git` on the command line. + +## Help, feedback or suggestions? + +- [Open an issue](https://github.com/JohnSundell/CGOperators/issues/new) if you need help, if you found a bug, or if you want to discuss a feature request. +- [Open a PR](https://github.com/JohnSundell/CGOperators/pull/new/master) if you want to make some change to CGOperators. +- Contact [@johnsundell on Twitter](https://twitter.com/johnsundell) for discussions, news & announcements about CGOperators and other open source projects. \ No newline at end of file diff --git a/Sources/CGOperators.swift b/Sources/CGOperators.swift new file mode 100644 index 0000000..9618bb6 --- /dev/null +++ b/Sources/CGOperators.swift @@ -0,0 +1,90 @@ +/** + * CGOperators + * Copyright (c) John Sundell 2017 + * Licensed under the MIT license. See LICENSE file. + */ + +import Foundation +import CoreGraphics + +/// Protocol used to describe a type as a Core Graphics 2D vector +/// Default implementations are provided for `CGPoint`, `CGSize` & `CGVector` +public protocol CGVectorProtocol { + /// The X & Y components that make up this vector + var components: (x: CGFloat, y: CGFloat) { get } + + /// Initialize an instance of this type with X & Y components + /// - parameter components: The components to fill in the vector with + init(components: (x: CGFloat, y: CGFloat)) +} + +extension CGPoint: CGVectorProtocol { + public var components: (x: CGFloat, y: CGFloat) { + return (x, y) + } + + public init(components: (x: CGFloat, y: CGFloat)) { + self.init(x: components.x, y: components.y) + } +} + +extension CGSize: CGVectorProtocol { + public var components: (x: CGFloat, y: CGFloat) { + return (width, height) + } + + public init(components: (x: CGFloat, y: CGFloat)) { + self.init(width: components.x, height: components.y) + } +} + +extension CGVector: CGVectorProtocol { + public var components: (x: CGFloat, y: CGFloat) { + return (dx, dy) + } + + public init(components: (x: CGFloat, y: CGFloat)) { + self.init(dx: components.x, dy: components.y) + } +} + +public extension CGVectorProtocol { + /// Add two vectors, returning a new vector with the sum of their X & Y components + /// Example: `CGPoint(x: 10, y: 20) + CGPoint(x: 20, y: 40) = CGPoint(x: 30, y: 60)` + static func +(lhs: Self, rhs: CGVectorProtocol) -> Self { + return lhs.applying(operator: +, with: rhs) + } + + /// Subtract a vector from another, returning a new vector with the result of subtracting + /// the right hand vector's components from the left hand vector's. + /// Example: `CGPoint(x: 20, y: 30) - CGPoint(x: 5, y: 10) = CGPoint(x: 15, y: 20)` + static func -(lhs: Self, rhs: CGVectorProtocol) -> Self { + return lhs.applying(operator: -, with: rhs) + } + + /// Return a new vector by multiplying a vector's components with a constant + /// Example: `CGSize(width: 30, height: 90) * 3 = CGSize(width: 90, height: 270) + static func *(lhs: Self, rhs: CGFloat) -> Self { + return lhs.applying(operator: *, with: rhs) + } + + /// Return a new vector by dividing a vector's components with a constant + /// Example: `CGSize(width: 30, height: 90) / 3 = CGSize(width: 10, height: 30)` + static func /(lhs: Self, rhs: CGFloat) -> Self { + return lhs.applying(operator: /, with: rhs) + } +} + +private extension CGVectorProtocol { + func applying(operator o: (CGFloat, CGFloat) -> CGFloat, with vector: CGVectorProtocol) -> Self { + let lhsComponents = components + let rhsComponents = vector.components + return Self(components: (o(lhsComponents.x, rhsComponents.x), + o(lhsComponents.y, rhsComponents.y))) + } + + func applying(operator o: (CGFloat, CGFloat) -> CGFloat, with constant: CGFloat) -> Self { + let components = self.components + return Self(components: (o(components.x, constant), o(components.y, constant))) + } +} diff --git a/Tests/CGOperatorsTests/CGOperatorsTests.swift b/Tests/CGOperatorsTests/CGOperatorsTests.swift new file mode 100644 index 0000000..b6a9530 --- /dev/null +++ b/Tests/CGOperatorsTests/CGOperatorsTests.swift @@ -0,0 +1,72 @@ +/** + * CGOperators + * Copyright (c) John Sundell 2017 + * Licensed under the MIT license. See LICENSE file. + */ + +import Foundation +import CoreGraphics +import XCTest +import CGOperators + +final class CGOperatorsTests: XCTestCase { + func testAddingPoints() { + XCTAssertEqual(CGPoint(x: 10, y: 20) + CGPoint(x: 50, y: 70), + CGPoint(x: 60, y: 90)) + } + + func testAddingSizeAndPoint() { + XCTAssertEqual(CGSize(width: 30, height: 40) + CGPoint(x: 10, y: 90), + CGSize(width: 40, height: 130)) + } + + func testAddingVectorAndSize() { + XCTAssertEqual(CGVector(dx: 5, dy: 25) + CGSize(width: 15, height: 35), + CGVector(dx: 20, dy: 60)) + } + + func testSubtractingPoints() { + XCTAssertEqual(CGPoint(x: 50, y: 70) - CGPoint(x: 10, y: 20), + CGPoint(x: 40, y: 50)) + } + + func testSubtractingPointFromSize() { + XCTAssertEqual(CGSize(width: 100, height: 90) - CGPoint(x: 10, y: 20), + CGSize(width: 90, height: 70)) + } + + func testSubtractingSizeFromVector() { + XCTAssertEqual(CGVector(dx: 30, dy: 60) - CGSize(width: 10, height: 20), + CGVector(dx: 20, dy: 40)) + } + + func testMultiplyingPoint() { + XCTAssertEqual(CGPoint(x: 150, y: 100) * 3, + CGPoint(x: 450, y: 300)) + } + + func testMultiplyingSize() { + XCTAssertEqual(CGSize(width: 150, height: 100) * 3, + CGSize(width: 450, height: 300)) + } + + func testMultiplyingVector() { + XCTAssertEqual(CGVector(dx: 150, dy: 100) * 3, + CGVector(dx: 450, dy: 300)) + } + + func testDividingPoint() { + XCTAssertEqual(CGPoint(x: 500, y: 1000) / 5, + CGPoint(x: 100, y: 200)) + } + + func testDividingSize() { + XCTAssertEqual(CGSize(width: 500, height: 1000) / 5, + CGSize(width: 100, height: 200)) + } + + func testDividingVector() { + XCTAssertEqual(CGVector(dx: 500, dy: 1000) / 5, + CGVector(dx: 100, dy: 200)) + } +}