├── .gitignore ├── CGOperators.podspec ├── CGOperators.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcshareddata │ └── xcschemes │ ├── CGOperators-iOS.xcscheme │ ├── CGOperators-macOS.xcscheme │ ├── CGOperators-tvOS.xcscheme │ └── CGOperators-watchOS.xcscheme ├── CODE_OF_CONDUCT.md ├── Configs ├── CGOperators.plist └── CGOperatorsTests.plist ├── LICENSE ├── Logo.png ├── Package.swift ├── README.md ├── Sources └── CGOperators.swift └── Tests └── CGOperatorsTests └── CGOperatorsTests.swift /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .build/ 3 | build/ 4 | DerivedData/ 5 | xcuserdata/ 6 | -------------------------------------------------------------------------------- /CGOperators.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "CGOperators" 3 | s.version = "1.0.0" 4 | s.summary = "Easily manipulate CGPoints, CGSizes and CGVectors using math operators" 5 | s.description = <<-DESC 6 | A small Swift framework that enables you to easily manipulate Core Graphic's vector types (CGPoint, CGSize and CGVector) using math operators. 7 | DESC 8 | s.homepage = "https://github.com/JohnSundell/CGOperators" 9 | s.license = { :type => "MIT", :file => "LICENSE" } 10 | s.author = { "John Sundell" => "john@sundell.co" } 11 | s.social_media_url = "https://twitter.com/johnsundell" 12 | s.ios.deployment_target = "8.0" 13 | s.osx.deployment_target = "10.9" 14 | s.watchos.deployment_target = "2.0" 15 | s.tvos.deployment_target = "9.0" 16 | s.source = { :git => "https://github.com/JohnSundell/CGOperators.git", :tag => s.version.to_s } 17 | s.source_files = "Sources/**/*" 18 | s.frameworks = "Foundation" 19 | end 20 | -------------------------------------------------------------------------------- /CGOperators.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 47; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 52D6D9871BEFF229002C0205 /* CGOperators.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52D6D97C1BEFF229002C0205 /* CGOperators.framework */; }; 11 | 8933C7851EB5B820000D00A4 /* CGOperators.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8933C7841EB5B820000D00A4 /* CGOperators.swift */; }; 12 | 8933C7861EB5B820000D00A4 /* CGOperators.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8933C7841EB5B820000D00A4 /* CGOperators.swift */; }; 13 | 8933C7871EB5B820000D00A4 /* CGOperators.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8933C7841EB5B820000D00A4 /* CGOperators.swift */; }; 14 | 8933C7881EB5B820000D00A4 /* CGOperators.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8933C7841EB5B820000D00A4 /* CGOperators.swift */; }; 15 | 8933C78E1EB5B82C000D00A4 /* CGOperatorsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8933C7891EB5B82A000D00A4 /* CGOperatorsTests.swift */; }; 16 | 8933C78F1EB5B82C000D00A4 /* CGOperatorsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8933C7891EB5B82A000D00A4 /* CGOperatorsTests.swift */; }; 17 | 8933C7901EB5B82D000D00A4 /* CGOperatorsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8933C7891EB5B82A000D00A4 /* CGOperatorsTests.swift */; }; 18 | DD7502881C68FEDE006590AF /* CGOperators.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52D6DA0F1BF000BD002C0205 /* CGOperators.framework */; }; 19 | DD7502921C690C7A006590AF /* CGOperators.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52D6D9F01BEFFFBE002C0205 /* CGOperators.framework */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXContainerItemProxy section */ 23 | 52D6D9881BEFF229002C0205 /* PBXContainerItemProxy */ = { 24 | isa = PBXContainerItemProxy; 25 | containerPortal = 52D6D9731BEFF229002C0205 /* Project object */; 26 | proxyType = 1; 27 | remoteGlobalIDString = 52D6D97B1BEFF229002C0205; 28 | remoteInfo = CGOperators; 29 | }; 30 | DD7502801C68FCFC006590AF /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = 52D6D9731BEFF229002C0205 /* Project object */; 33 | proxyType = 1; 34 | remoteGlobalIDString = 52D6DA0E1BF000BD002C0205; 35 | remoteInfo = "CGOperators-macOS"; 36 | }; 37 | DD7502931C690C7A006590AF /* PBXContainerItemProxy */ = { 38 | isa = PBXContainerItemProxy; 39 | containerPortal = 52D6D9731BEFF229002C0205 /* Project object */; 40 | proxyType = 1; 41 | remoteGlobalIDString = 52D6D9EF1BEFFFBE002C0205; 42 | remoteInfo = "CGOperators-tvOS"; 43 | }; 44 | /* End PBXContainerItemProxy section */ 45 | 46 | /* Begin PBXFileReference section */ 47 | 52D6D97C1BEFF229002C0205 /* CGOperators.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CGOperators.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 48 | 52D6D9861BEFF229002C0205 /* CGOperators-iOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "CGOperators-iOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | 52D6D9E21BEFFF6E002C0205 /* CGOperators.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CGOperators.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | 52D6D9F01BEFFFBE002C0205 /* CGOperators.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CGOperators.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | 52D6DA0F1BF000BD002C0205 /* CGOperators.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CGOperators.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 52 | 8933C7841EB5B820000D00A4 /* CGOperators.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CGOperators.swift; sourceTree = ""; }; 53 | 8933C7891EB5B82A000D00A4 /* CGOperatorsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CGOperatorsTests.swift; sourceTree = ""; }; 54 | AD2FAA261CD0B6D800659CF4 /* CGOperators.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = CGOperators.plist; sourceTree = ""; }; 55 | AD2FAA281CD0B6E100659CF4 /* CGOperatorsTests.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = CGOperatorsTests.plist; sourceTree = ""; }; 56 | DD75027A1C68FCFC006590AF /* CGOperators-macOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "CGOperators-macOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 57 | DD75028D1C690C7A006590AF /* CGOperators-tvOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "CGOperators-tvOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 58 | /* End PBXFileReference section */ 59 | 60 | /* Begin PBXFrameworksBuildPhase section */ 61 | 52D6D9781BEFF229002C0205 /* Frameworks */ = { 62 | isa = PBXFrameworksBuildPhase; 63 | buildActionMask = 2147483647; 64 | files = ( 65 | ); 66 | runOnlyForDeploymentPostprocessing = 0; 67 | }; 68 | 52D6D9831BEFF229002C0205 /* Frameworks */ = { 69 | isa = PBXFrameworksBuildPhase; 70 | buildActionMask = 2147483647; 71 | files = ( 72 | 52D6D9871BEFF229002C0205 /* CGOperators.framework in Frameworks */, 73 | ); 74 | runOnlyForDeploymentPostprocessing = 0; 75 | }; 76 | 52D6D9DE1BEFFF6E002C0205 /* Frameworks */ = { 77 | isa = PBXFrameworksBuildPhase; 78 | buildActionMask = 2147483647; 79 | files = ( 80 | ); 81 | runOnlyForDeploymentPostprocessing = 0; 82 | }; 83 | 52D6D9EC1BEFFFBE002C0205 /* Frameworks */ = { 84 | isa = PBXFrameworksBuildPhase; 85 | buildActionMask = 2147483647; 86 | files = ( 87 | ); 88 | runOnlyForDeploymentPostprocessing = 0; 89 | }; 90 | 52D6DA0B1BF000BD002C0205 /* Frameworks */ = { 91 | isa = PBXFrameworksBuildPhase; 92 | buildActionMask = 2147483647; 93 | files = ( 94 | ); 95 | runOnlyForDeploymentPostprocessing = 0; 96 | }; 97 | DD7502771C68FCFC006590AF /* Frameworks */ = { 98 | isa = PBXFrameworksBuildPhase; 99 | buildActionMask = 2147483647; 100 | files = ( 101 | DD7502881C68FEDE006590AF /* CGOperators.framework in Frameworks */, 102 | ); 103 | runOnlyForDeploymentPostprocessing = 0; 104 | }; 105 | DD75028A1C690C7A006590AF /* Frameworks */ = { 106 | isa = PBXFrameworksBuildPhase; 107 | buildActionMask = 2147483647; 108 | files = ( 109 | DD7502921C690C7A006590AF /* CGOperators.framework in Frameworks */, 110 | ); 111 | runOnlyForDeploymentPostprocessing = 0; 112 | }; 113 | /* End PBXFrameworksBuildPhase section */ 114 | 115 | /* Begin PBXGroup section */ 116 | 52D6D9721BEFF229002C0205 = { 117 | isa = PBXGroup; 118 | children = ( 119 | 8933C7811EB5B7E0000D00A4 /* Sources */, 120 | 8933C7831EB5B7EB000D00A4 /* Tests */, 121 | 52D6D99C1BEFF38C002C0205 /* Configs */, 122 | 52D6D97D1BEFF229002C0205 /* Products */, 123 | ); 124 | sourceTree = ""; 125 | }; 126 | 52D6D97D1BEFF229002C0205 /* Products */ = { 127 | isa = PBXGroup; 128 | children = ( 129 | 52D6D97C1BEFF229002C0205 /* CGOperators.framework */, 130 | 52D6D9861BEFF229002C0205 /* CGOperators-iOS Tests.xctest */, 131 | 52D6D9E21BEFFF6E002C0205 /* CGOperators.framework */, 132 | 52D6D9F01BEFFFBE002C0205 /* CGOperators.framework */, 133 | 52D6DA0F1BF000BD002C0205 /* CGOperators.framework */, 134 | DD75027A1C68FCFC006590AF /* CGOperators-macOS Tests.xctest */, 135 | DD75028D1C690C7A006590AF /* CGOperators-tvOS Tests.xctest */, 136 | ); 137 | name = Products; 138 | sourceTree = ""; 139 | }; 140 | 52D6D99C1BEFF38C002C0205 /* Configs */ = { 141 | isa = PBXGroup; 142 | children = ( 143 | DD7502721C68FC1B006590AF /* Frameworks */, 144 | DD7502731C68FC20006590AF /* Tests */, 145 | ); 146 | path = Configs; 147 | sourceTree = ""; 148 | }; 149 | 8933C7811EB5B7E0000D00A4 /* Sources */ = { 150 | isa = PBXGroup; 151 | children = ( 152 | 8933C7841EB5B820000D00A4 /* CGOperators.swift */, 153 | ); 154 | path = Sources; 155 | sourceTree = ""; 156 | }; 157 | 8933C7831EB5B7EB000D00A4 /* Tests */ = { 158 | isa = PBXGroup; 159 | children = ( 160 | 8933C7891EB5B82A000D00A4 /* CGOperatorsTests.swift */, 161 | ); 162 | name = Tests; 163 | path = Tests/CGOperatorsTests; 164 | sourceTree = ""; 165 | }; 166 | DD7502721C68FC1B006590AF /* Frameworks */ = { 167 | isa = PBXGroup; 168 | children = ( 169 | AD2FAA261CD0B6D800659CF4 /* CGOperators.plist */, 170 | ); 171 | name = Frameworks; 172 | sourceTree = ""; 173 | }; 174 | DD7502731C68FC20006590AF /* Tests */ = { 175 | isa = PBXGroup; 176 | children = ( 177 | AD2FAA281CD0B6E100659CF4 /* CGOperatorsTests.plist */, 178 | ); 179 | name = Tests; 180 | sourceTree = ""; 181 | }; 182 | /* End PBXGroup section */ 183 | 184 | /* Begin PBXHeadersBuildPhase section */ 185 | 52D6D9791BEFF229002C0205 /* Headers */ = { 186 | isa = PBXHeadersBuildPhase; 187 | buildActionMask = 2147483647; 188 | files = ( 189 | ); 190 | runOnlyForDeploymentPostprocessing = 0; 191 | }; 192 | 52D6D9DF1BEFFF6E002C0205 /* Headers */ = { 193 | isa = PBXHeadersBuildPhase; 194 | buildActionMask = 2147483647; 195 | files = ( 196 | ); 197 | runOnlyForDeploymentPostprocessing = 0; 198 | }; 199 | 52D6D9ED1BEFFFBE002C0205 /* Headers */ = { 200 | isa = PBXHeadersBuildPhase; 201 | buildActionMask = 2147483647; 202 | files = ( 203 | ); 204 | runOnlyForDeploymentPostprocessing = 0; 205 | }; 206 | 52D6DA0C1BF000BD002C0205 /* Headers */ = { 207 | isa = PBXHeadersBuildPhase; 208 | buildActionMask = 2147483647; 209 | files = ( 210 | ); 211 | runOnlyForDeploymentPostprocessing = 0; 212 | }; 213 | /* End PBXHeadersBuildPhase section */ 214 | 215 | /* Begin PBXNativeTarget section */ 216 | 52D6D97B1BEFF229002C0205 /* CGOperators-iOS */ = { 217 | isa = PBXNativeTarget; 218 | buildConfigurationList = 52D6D9901BEFF229002C0205 /* Build configuration list for PBXNativeTarget "CGOperators-iOS" */; 219 | buildPhases = ( 220 | 52D6D9771BEFF229002C0205 /* Sources */, 221 | 52D6D9781BEFF229002C0205 /* Frameworks */, 222 | 52D6D9791BEFF229002C0205 /* Headers */, 223 | 52D6D97A1BEFF229002C0205 /* Resources */, 224 | ); 225 | buildRules = ( 226 | ); 227 | dependencies = ( 228 | ); 229 | name = "CGOperators-iOS"; 230 | productName = CGOperators; 231 | productReference = 52D6D97C1BEFF229002C0205 /* CGOperators.framework */; 232 | productType = "com.apple.product-type.framework"; 233 | }; 234 | 52D6D9851BEFF229002C0205 /* CGOperators-iOS Tests */ = { 235 | isa = PBXNativeTarget; 236 | buildConfigurationList = 52D6D9931BEFF229002C0205 /* Build configuration list for PBXNativeTarget "CGOperators-iOS Tests" */; 237 | buildPhases = ( 238 | 52D6D9821BEFF229002C0205 /* Sources */, 239 | 52D6D9831BEFF229002C0205 /* Frameworks */, 240 | 52D6D9841BEFF229002C0205 /* Resources */, 241 | ); 242 | buildRules = ( 243 | ); 244 | dependencies = ( 245 | 52D6D9891BEFF229002C0205 /* PBXTargetDependency */, 246 | ); 247 | name = "CGOperators-iOS Tests"; 248 | productName = CGOperatorsTests; 249 | productReference = 52D6D9861BEFF229002C0205 /* CGOperators-iOS Tests.xctest */; 250 | productType = "com.apple.product-type.bundle.unit-test"; 251 | }; 252 | 52D6D9E11BEFFF6E002C0205 /* CGOperators-watchOS */ = { 253 | isa = PBXNativeTarget; 254 | buildConfigurationList = 52D6D9E71BEFFF6E002C0205 /* Build configuration list for PBXNativeTarget "CGOperators-watchOS" */; 255 | buildPhases = ( 256 | 52D6D9DD1BEFFF6E002C0205 /* Sources */, 257 | 52D6D9DE1BEFFF6E002C0205 /* Frameworks */, 258 | 52D6D9DF1BEFFF6E002C0205 /* Headers */, 259 | 52D6D9E01BEFFF6E002C0205 /* Resources */, 260 | ); 261 | buildRules = ( 262 | ); 263 | dependencies = ( 264 | ); 265 | name = "CGOperators-watchOS"; 266 | productName = "CGOperators-watchOS"; 267 | productReference = 52D6D9E21BEFFF6E002C0205 /* CGOperators.framework */; 268 | productType = "com.apple.product-type.framework"; 269 | }; 270 | 52D6D9EF1BEFFFBE002C0205 /* CGOperators-tvOS */ = { 271 | isa = PBXNativeTarget; 272 | buildConfigurationList = 52D6DA011BEFFFBE002C0205 /* Build configuration list for PBXNativeTarget "CGOperators-tvOS" */; 273 | buildPhases = ( 274 | 52D6D9EB1BEFFFBE002C0205 /* Sources */, 275 | 52D6D9EC1BEFFFBE002C0205 /* Frameworks */, 276 | 52D6D9ED1BEFFFBE002C0205 /* Headers */, 277 | 52D6D9EE1BEFFFBE002C0205 /* Resources */, 278 | ); 279 | buildRules = ( 280 | ); 281 | dependencies = ( 282 | ); 283 | name = "CGOperators-tvOS"; 284 | productName = "CGOperators-tvOS"; 285 | productReference = 52D6D9F01BEFFFBE002C0205 /* CGOperators.framework */; 286 | productType = "com.apple.product-type.framework"; 287 | }; 288 | 52D6DA0E1BF000BD002C0205 /* CGOperators-macOS */ = { 289 | isa = PBXNativeTarget; 290 | buildConfigurationList = 52D6DA201BF000BD002C0205 /* Build configuration list for PBXNativeTarget "CGOperators-macOS" */; 291 | buildPhases = ( 292 | 52D6DA0A1BF000BD002C0205 /* Sources */, 293 | 52D6DA0B1BF000BD002C0205 /* Frameworks */, 294 | 52D6DA0C1BF000BD002C0205 /* Headers */, 295 | 52D6DA0D1BF000BD002C0205 /* Resources */, 296 | ); 297 | buildRules = ( 298 | ); 299 | dependencies = ( 300 | ); 301 | name = "CGOperators-macOS"; 302 | productName = "CGOperators-macOS"; 303 | productReference = 52D6DA0F1BF000BD002C0205 /* CGOperators.framework */; 304 | productType = "com.apple.product-type.framework"; 305 | }; 306 | DD7502791C68FCFC006590AF /* CGOperators-macOS Tests */ = { 307 | isa = PBXNativeTarget; 308 | buildConfigurationList = DD7502821C68FCFC006590AF /* Build configuration list for PBXNativeTarget "CGOperators-macOS Tests" */; 309 | buildPhases = ( 310 | DD7502761C68FCFC006590AF /* Sources */, 311 | DD7502771C68FCFC006590AF /* Frameworks */, 312 | DD7502781C68FCFC006590AF /* Resources */, 313 | ); 314 | buildRules = ( 315 | ); 316 | dependencies = ( 317 | DD7502811C68FCFC006590AF /* PBXTargetDependency */, 318 | ); 319 | name = "CGOperators-macOS Tests"; 320 | productName = "CGOperators-OS Tests"; 321 | productReference = DD75027A1C68FCFC006590AF /* CGOperators-macOS Tests.xctest */; 322 | productType = "com.apple.product-type.bundle.unit-test"; 323 | }; 324 | DD75028C1C690C7A006590AF /* CGOperators-tvOS Tests */ = { 325 | isa = PBXNativeTarget; 326 | buildConfigurationList = DD7502951C690C7A006590AF /* Build configuration list for PBXNativeTarget "CGOperators-tvOS Tests" */; 327 | buildPhases = ( 328 | DD7502891C690C7A006590AF /* Sources */, 329 | DD75028A1C690C7A006590AF /* Frameworks */, 330 | DD75028B1C690C7A006590AF /* Resources */, 331 | ); 332 | buildRules = ( 333 | ); 334 | dependencies = ( 335 | DD7502941C690C7A006590AF /* PBXTargetDependency */, 336 | ); 337 | name = "CGOperators-tvOS Tests"; 338 | productName = "CGOperators-tvOS Tests"; 339 | productReference = DD75028D1C690C7A006590AF /* CGOperators-tvOS Tests.xctest */; 340 | productType = "com.apple.product-type.bundle.unit-test"; 341 | }; 342 | /* End PBXNativeTarget section */ 343 | 344 | /* Begin PBXProject section */ 345 | 52D6D9731BEFF229002C0205 /* Project object */ = { 346 | isa = PBXProject; 347 | attributes = { 348 | LastSwiftUpdateCheck = 0720; 349 | LastUpgradeCheck = 0810; 350 | ORGANIZATIONNAME = "CGOperators"; 351 | TargetAttributes = { 352 | 52D6D97B1BEFF229002C0205 = { 353 | CreatedOnToolsVersion = 7.1; 354 | LastSwiftMigration = 0800; 355 | }; 356 | 52D6D9851BEFF229002C0205 = { 357 | CreatedOnToolsVersion = 7.1; 358 | LastSwiftMigration = 0800; 359 | }; 360 | 52D6D9E11BEFFF6E002C0205 = { 361 | CreatedOnToolsVersion = 7.1; 362 | LastSwiftMigration = 0800; 363 | }; 364 | 52D6D9EF1BEFFFBE002C0205 = { 365 | CreatedOnToolsVersion = 7.1; 366 | LastSwiftMigration = 0800; 367 | }; 368 | 52D6DA0E1BF000BD002C0205 = { 369 | CreatedOnToolsVersion = 7.1; 370 | LastSwiftMigration = 0800; 371 | }; 372 | DD7502791C68FCFC006590AF = { 373 | CreatedOnToolsVersion = 7.2.1; 374 | LastSwiftMigration = 0800; 375 | }; 376 | DD75028C1C690C7A006590AF = { 377 | CreatedOnToolsVersion = 7.2.1; 378 | LastSwiftMigration = 0800; 379 | }; 380 | }; 381 | }; 382 | buildConfigurationList = 52D6D9761BEFF229002C0205 /* Build configuration list for PBXProject "CGOperators" */; 383 | compatibilityVersion = "Xcode 6.3"; 384 | developmentRegion = English; 385 | hasScannedForEncodings = 0; 386 | knownRegions = ( 387 | en, 388 | ); 389 | mainGroup = 52D6D9721BEFF229002C0205; 390 | productRefGroup = 52D6D97D1BEFF229002C0205 /* Products */; 391 | projectDirPath = ""; 392 | projectRoot = ""; 393 | targets = ( 394 | 52D6D97B1BEFF229002C0205 /* CGOperators-iOS */, 395 | 52D6DA0E1BF000BD002C0205 /* CGOperators-macOS */, 396 | 52D6D9E11BEFFF6E002C0205 /* CGOperators-watchOS */, 397 | 52D6D9EF1BEFFFBE002C0205 /* CGOperators-tvOS */, 398 | 52D6D9851BEFF229002C0205 /* CGOperators-iOS Tests */, 399 | DD7502791C68FCFC006590AF /* CGOperators-macOS Tests */, 400 | DD75028C1C690C7A006590AF /* CGOperators-tvOS Tests */, 401 | ); 402 | }; 403 | /* End PBXProject section */ 404 | 405 | /* Begin PBXResourcesBuildPhase section */ 406 | 52D6D97A1BEFF229002C0205 /* Resources */ = { 407 | isa = PBXResourcesBuildPhase; 408 | buildActionMask = 2147483647; 409 | files = ( 410 | ); 411 | runOnlyForDeploymentPostprocessing = 0; 412 | }; 413 | 52D6D9841BEFF229002C0205 /* Resources */ = { 414 | isa = PBXResourcesBuildPhase; 415 | buildActionMask = 2147483647; 416 | files = ( 417 | ); 418 | runOnlyForDeploymentPostprocessing = 0; 419 | }; 420 | 52D6D9E01BEFFF6E002C0205 /* Resources */ = { 421 | isa = PBXResourcesBuildPhase; 422 | buildActionMask = 2147483647; 423 | files = ( 424 | ); 425 | runOnlyForDeploymentPostprocessing = 0; 426 | }; 427 | 52D6D9EE1BEFFFBE002C0205 /* Resources */ = { 428 | isa = PBXResourcesBuildPhase; 429 | buildActionMask = 2147483647; 430 | files = ( 431 | ); 432 | runOnlyForDeploymentPostprocessing = 0; 433 | }; 434 | 52D6DA0D1BF000BD002C0205 /* Resources */ = { 435 | isa = PBXResourcesBuildPhase; 436 | buildActionMask = 2147483647; 437 | files = ( 438 | ); 439 | runOnlyForDeploymentPostprocessing = 0; 440 | }; 441 | DD7502781C68FCFC006590AF /* Resources */ = { 442 | isa = PBXResourcesBuildPhase; 443 | buildActionMask = 2147483647; 444 | files = ( 445 | ); 446 | runOnlyForDeploymentPostprocessing = 0; 447 | }; 448 | DD75028B1C690C7A006590AF /* Resources */ = { 449 | isa = PBXResourcesBuildPhase; 450 | buildActionMask = 2147483647; 451 | files = ( 452 | ); 453 | runOnlyForDeploymentPostprocessing = 0; 454 | }; 455 | /* End PBXResourcesBuildPhase section */ 456 | 457 | /* Begin PBXSourcesBuildPhase section */ 458 | 52D6D9771BEFF229002C0205 /* Sources */ = { 459 | isa = PBXSourcesBuildPhase; 460 | buildActionMask = 2147483647; 461 | files = ( 462 | 8933C7851EB5B820000D00A4 /* CGOperators.swift in Sources */, 463 | ); 464 | runOnlyForDeploymentPostprocessing = 0; 465 | }; 466 | 52D6D9821BEFF229002C0205 /* Sources */ = { 467 | isa = PBXSourcesBuildPhase; 468 | buildActionMask = 2147483647; 469 | files = ( 470 | 8933C7901EB5B82D000D00A4 /* CGOperatorsTests.swift in Sources */, 471 | ); 472 | runOnlyForDeploymentPostprocessing = 0; 473 | }; 474 | 52D6D9DD1BEFFF6E002C0205 /* Sources */ = { 475 | isa = PBXSourcesBuildPhase; 476 | buildActionMask = 2147483647; 477 | files = ( 478 | 8933C7871EB5B820000D00A4 /* CGOperators.swift in Sources */, 479 | ); 480 | runOnlyForDeploymentPostprocessing = 0; 481 | }; 482 | 52D6D9EB1BEFFFBE002C0205 /* Sources */ = { 483 | isa = PBXSourcesBuildPhase; 484 | buildActionMask = 2147483647; 485 | files = ( 486 | 8933C7881EB5B820000D00A4 /* CGOperators.swift in Sources */, 487 | ); 488 | runOnlyForDeploymentPostprocessing = 0; 489 | }; 490 | 52D6DA0A1BF000BD002C0205 /* Sources */ = { 491 | isa = PBXSourcesBuildPhase; 492 | buildActionMask = 2147483647; 493 | files = ( 494 | 8933C7861EB5B820000D00A4 /* CGOperators.swift in Sources */, 495 | ); 496 | runOnlyForDeploymentPostprocessing = 0; 497 | }; 498 | DD7502761C68FCFC006590AF /* Sources */ = { 499 | isa = PBXSourcesBuildPhase; 500 | buildActionMask = 2147483647; 501 | files = ( 502 | 8933C78F1EB5B82C000D00A4 /* CGOperatorsTests.swift in Sources */, 503 | ); 504 | runOnlyForDeploymentPostprocessing = 0; 505 | }; 506 | DD7502891C690C7A006590AF /* Sources */ = { 507 | isa = PBXSourcesBuildPhase; 508 | buildActionMask = 2147483647; 509 | files = ( 510 | 8933C78E1EB5B82C000D00A4 /* CGOperatorsTests.swift in Sources */, 511 | ); 512 | runOnlyForDeploymentPostprocessing = 0; 513 | }; 514 | /* End PBXSourcesBuildPhase section */ 515 | 516 | /* Begin PBXTargetDependency section */ 517 | 52D6D9891BEFF229002C0205 /* PBXTargetDependency */ = { 518 | isa = PBXTargetDependency; 519 | target = 52D6D97B1BEFF229002C0205 /* CGOperators-iOS */; 520 | targetProxy = 52D6D9881BEFF229002C0205 /* PBXContainerItemProxy */; 521 | }; 522 | DD7502811C68FCFC006590AF /* PBXTargetDependency */ = { 523 | isa = PBXTargetDependency; 524 | target = 52D6DA0E1BF000BD002C0205 /* CGOperators-macOS */; 525 | targetProxy = DD7502801C68FCFC006590AF /* PBXContainerItemProxy */; 526 | }; 527 | DD7502941C690C7A006590AF /* PBXTargetDependency */ = { 528 | isa = PBXTargetDependency; 529 | target = 52D6D9EF1BEFFFBE002C0205 /* CGOperators-tvOS */; 530 | targetProxy = DD7502931C690C7A006590AF /* PBXContainerItemProxy */; 531 | }; 532 | /* End PBXTargetDependency section */ 533 | 534 | /* Begin XCBuildConfiguration section */ 535 | 52D6D98E1BEFF229002C0205 /* Debug */ = { 536 | isa = XCBuildConfiguration; 537 | buildSettings = { 538 | ALWAYS_SEARCH_USER_PATHS = NO; 539 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 540 | CLANG_CXX_LIBRARY = "libc++"; 541 | CLANG_ENABLE_MODULES = YES; 542 | CLANG_ENABLE_OBJC_ARC = YES; 543 | CLANG_WARN_BOOL_CONVERSION = YES; 544 | CLANG_WARN_CONSTANT_CONVERSION = YES; 545 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 546 | CLANG_WARN_EMPTY_BODY = YES; 547 | CLANG_WARN_ENUM_CONVERSION = YES; 548 | CLANG_WARN_INFINITE_RECURSION = YES; 549 | CLANG_WARN_INT_CONVERSION = YES; 550 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 551 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 552 | CLANG_WARN_UNREACHABLE_CODE = YES; 553 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 554 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 555 | COPY_PHASE_STRIP = NO; 556 | CURRENT_PROJECT_VERSION = 1; 557 | DEBUG_INFORMATION_FORMAT = dwarf; 558 | ENABLE_STRICT_OBJC_MSGSEND = YES; 559 | ENABLE_TESTABILITY = YES; 560 | GCC_C_LANGUAGE_STANDARD = gnu99; 561 | GCC_DYNAMIC_NO_PIC = NO; 562 | GCC_NO_COMMON_BLOCKS = YES; 563 | GCC_OPTIMIZATION_LEVEL = 0; 564 | GCC_PREPROCESSOR_DEFINITIONS = ( 565 | "DEBUG=1", 566 | "$(inherited)", 567 | ); 568 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 569 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 570 | GCC_WARN_UNDECLARED_SELECTOR = YES; 571 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 572 | GCC_WARN_UNUSED_FUNCTION = YES; 573 | GCC_WARN_UNUSED_VARIABLE = YES; 574 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 575 | MTL_ENABLE_DEBUG_INFO = YES; 576 | ONLY_ACTIVE_ARCH = YES; 577 | SDKROOT = iphoneos; 578 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 579 | SWIFT_VERSION = 3.0; 580 | TARGETED_DEVICE_FAMILY = "1,2"; 581 | VERSIONING_SYSTEM = "apple-generic"; 582 | VERSION_INFO_PREFIX = ""; 583 | }; 584 | name = Debug; 585 | }; 586 | 52D6D98F1BEFF229002C0205 /* Release */ = { 587 | isa = XCBuildConfiguration; 588 | buildSettings = { 589 | ALWAYS_SEARCH_USER_PATHS = NO; 590 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 591 | CLANG_CXX_LIBRARY = "libc++"; 592 | CLANG_ENABLE_MODULES = YES; 593 | CLANG_ENABLE_OBJC_ARC = YES; 594 | CLANG_WARN_BOOL_CONVERSION = YES; 595 | CLANG_WARN_CONSTANT_CONVERSION = YES; 596 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 597 | CLANG_WARN_EMPTY_BODY = YES; 598 | CLANG_WARN_ENUM_CONVERSION = YES; 599 | CLANG_WARN_INFINITE_RECURSION = YES; 600 | CLANG_WARN_INT_CONVERSION = YES; 601 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 602 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 603 | CLANG_WARN_UNREACHABLE_CODE = YES; 604 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 605 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 606 | COPY_PHASE_STRIP = NO; 607 | CURRENT_PROJECT_VERSION = 1; 608 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 609 | ENABLE_NS_ASSERTIONS = NO; 610 | ENABLE_STRICT_OBJC_MSGSEND = YES; 611 | GCC_C_LANGUAGE_STANDARD = gnu99; 612 | GCC_NO_COMMON_BLOCKS = YES; 613 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 614 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 615 | GCC_WARN_UNDECLARED_SELECTOR = YES; 616 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 617 | GCC_WARN_UNUSED_FUNCTION = YES; 618 | GCC_WARN_UNUSED_VARIABLE = YES; 619 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 620 | MTL_ENABLE_DEBUG_INFO = NO; 621 | SDKROOT = iphoneos; 622 | SWIFT_VERSION = 3.0; 623 | TARGETED_DEVICE_FAMILY = "1,2"; 624 | VALIDATE_PRODUCT = YES; 625 | VERSIONING_SYSTEM = "apple-generic"; 626 | VERSION_INFO_PREFIX = ""; 627 | }; 628 | name = Release; 629 | }; 630 | 52D6D9911BEFF229002C0205 /* Debug */ = { 631 | isa = XCBuildConfiguration; 632 | buildSettings = { 633 | APPLICATION_EXTENSION_API_ONLY = YES; 634 | CLANG_ENABLE_MODULES = YES; 635 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 636 | DEFINES_MODULE = YES; 637 | DYLIB_COMPATIBILITY_VERSION = 1; 638 | DYLIB_CURRENT_VERSION = 1; 639 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 640 | INFOPLIST_FILE = Configs/CGOperators.plist; 641 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 642 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 643 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 644 | ONLY_ACTIVE_ARCH = NO; 645 | PRODUCT_BUNDLE_IDENTIFIER = "com.CGOperators.CGOperators-iOS"; 646 | PRODUCT_NAME = CGOperators; 647 | SKIP_INSTALL = YES; 648 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 649 | SWIFT_VERSION = 3.0; 650 | }; 651 | name = Debug; 652 | }; 653 | 52D6D9921BEFF229002C0205 /* Release */ = { 654 | isa = XCBuildConfiguration; 655 | buildSettings = { 656 | APPLICATION_EXTENSION_API_ONLY = YES; 657 | CLANG_ENABLE_MODULES = YES; 658 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 659 | DEFINES_MODULE = YES; 660 | DYLIB_COMPATIBILITY_VERSION = 1; 661 | DYLIB_CURRENT_VERSION = 1; 662 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 663 | INFOPLIST_FILE = Configs/CGOperators.plist; 664 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 665 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 666 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 667 | PRODUCT_BUNDLE_IDENTIFIER = "com.CGOperators.CGOperators-iOS"; 668 | PRODUCT_NAME = CGOperators; 669 | SKIP_INSTALL = YES; 670 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 671 | SWIFT_VERSION = 3.0; 672 | }; 673 | name = Release; 674 | }; 675 | 52D6D9941BEFF229002C0205 /* Debug */ = { 676 | isa = XCBuildConfiguration; 677 | buildSettings = { 678 | CLANG_ENABLE_MODULES = YES; 679 | INFOPLIST_FILE = Configs/CGOperatorsTests.plist; 680 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 681 | PRODUCT_BUNDLE_IDENTIFIER = "com.CGOperators.CGOperators-iOS-Tests"; 682 | PRODUCT_NAME = "$(TARGET_NAME)"; 683 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 684 | SWIFT_VERSION = 3.0; 685 | }; 686 | name = Debug; 687 | }; 688 | 52D6D9951BEFF229002C0205 /* Release */ = { 689 | isa = XCBuildConfiguration; 690 | buildSettings = { 691 | CLANG_ENABLE_MODULES = YES; 692 | INFOPLIST_FILE = Configs/CGOperatorsTests.plist; 693 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 694 | PRODUCT_BUNDLE_IDENTIFIER = "com.CGOperators.CGOperators-iOS-Tests"; 695 | PRODUCT_NAME = "$(TARGET_NAME)"; 696 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 697 | SWIFT_VERSION = 3.0; 698 | }; 699 | name = Release; 700 | }; 701 | 52D6D9E81BEFFF6E002C0205 /* Debug */ = { 702 | isa = XCBuildConfiguration; 703 | buildSettings = { 704 | APPLICATION_EXTENSION_API_ONLY = YES; 705 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 706 | DEFINES_MODULE = YES; 707 | DYLIB_COMPATIBILITY_VERSION = 1; 708 | DYLIB_CURRENT_VERSION = 1; 709 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 710 | INFOPLIST_FILE = Configs/CGOperators.plist; 711 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 712 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 713 | PRODUCT_BUNDLE_IDENTIFIER = "com.CGOperators.CGOperators-watchOS"; 714 | PRODUCT_NAME = CGOperators; 715 | SDKROOT = watchos; 716 | SKIP_INSTALL = YES; 717 | SWIFT_VERSION = 3.0; 718 | TARGETED_DEVICE_FAMILY = 4; 719 | WATCHOS_DEPLOYMENT_TARGET = 2.0; 720 | }; 721 | name = Debug; 722 | }; 723 | 52D6D9E91BEFFF6E002C0205 /* Release */ = { 724 | isa = XCBuildConfiguration; 725 | buildSettings = { 726 | APPLICATION_EXTENSION_API_ONLY = YES; 727 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 728 | DEFINES_MODULE = YES; 729 | DYLIB_COMPATIBILITY_VERSION = 1; 730 | DYLIB_CURRENT_VERSION = 1; 731 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 732 | INFOPLIST_FILE = Configs/CGOperators.plist; 733 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 734 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 735 | PRODUCT_BUNDLE_IDENTIFIER = "com.CGOperators.CGOperators-watchOS"; 736 | PRODUCT_NAME = CGOperators; 737 | SDKROOT = watchos; 738 | SKIP_INSTALL = YES; 739 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 740 | SWIFT_VERSION = 3.0; 741 | TARGETED_DEVICE_FAMILY = 4; 742 | WATCHOS_DEPLOYMENT_TARGET = 2.0; 743 | }; 744 | name = Release; 745 | }; 746 | 52D6DA021BEFFFBE002C0205 /* Debug */ = { 747 | isa = XCBuildConfiguration; 748 | buildSettings = { 749 | APPLICATION_EXTENSION_API_ONLY = YES; 750 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 751 | DEFINES_MODULE = YES; 752 | DYLIB_COMPATIBILITY_VERSION = 1; 753 | DYLIB_CURRENT_VERSION = 1; 754 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 755 | INFOPLIST_FILE = Configs/CGOperators.plist; 756 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 757 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 758 | PRODUCT_BUNDLE_IDENTIFIER = "com.CGOperators.CGOperators-tvOS"; 759 | PRODUCT_NAME = CGOperators; 760 | SDKROOT = appletvos; 761 | SKIP_INSTALL = YES; 762 | SWIFT_VERSION = 3.0; 763 | TARGETED_DEVICE_FAMILY = 3; 764 | TVOS_DEPLOYMENT_TARGET = 9.0; 765 | }; 766 | name = Debug; 767 | }; 768 | 52D6DA031BEFFFBE002C0205 /* Release */ = { 769 | isa = XCBuildConfiguration; 770 | buildSettings = { 771 | APPLICATION_EXTENSION_API_ONLY = YES; 772 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 773 | DEFINES_MODULE = YES; 774 | DYLIB_COMPATIBILITY_VERSION = 1; 775 | DYLIB_CURRENT_VERSION = 1; 776 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 777 | INFOPLIST_FILE = Configs/CGOperators.plist; 778 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 779 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 780 | PRODUCT_BUNDLE_IDENTIFIER = "com.CGOperators.CGOperators-tvOS"; 781 | PRODUCT_NAME = CGOperators; 782 | SDKROOT = appletvos; 783 | SKIP_INSTALL = YES; 784 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 785 | SWIFT_VERSION = 3.0; 786 | TARGETED_DEVICE_FAMILY = 3; 787 | TVOS_DEPLOYMENT_TARGET = 9.0; 788 | }; 789 | name = Release; 790 | }; 791 | 52D6DA211BF000BD002C0205 /* Debug */ = { 792 | isa = XCBuildConfiguration; 793 | buildSettings = { 794 | APPLICATION_EXTENSION_API_ONLY = YES; 795 | CODE_SIGN_IDENTITY = "-"; 796 | COMBINE_HIDPI_IMAGES = YES; 797 | DEFINES_MODULE = YES; 798 | DYLIB_COMPATIBILITY_VERSION = 1; 799 | DYLIB_CURRENT_VERSION = 1; 800 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 801 | FRAMEWORK_VERSION = A; 802 | INFOPLIST_FILE = Configs/CGOperators.plist; 803 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 804 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 805 | MACOSX_DEPLOYMENT_TARGET = 10.10; 806 | PRODUCT_BUNDLE_IDENTIFIER = "com.CGOperators.CGOperators-macOS"; 807 | PRODUCT_NAME = CGOperators; 808 | SDKROOT = macosx; 809 | SKIP_INSTALL = YES; 810 | SWIFT_VERSION = 3.0; 811 | }; 812 | name = Debug; 813 | }; 814 | 52D6DA221BF000BD002C0205 /* Release */ = { 815 | isa = XCBuildConfiguration; 816 | buildSettings = { 817 | APPLICATION_EXTENSION_API_ONLY = YES; 818 | CODE_SIGN_IDENTITY = "-"; 819 | COMBINE_HIDPI_IMAGES = YES; 820 | DEFINES_MODULE = YES; 821 | DYLIB_COMPATIBILITY_VERSION = 1; 822 | DYLIB_CURRENT_VERSION = 1; 823 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 824 | FRAMEWORK_VERSION = A; 825 | INFOPLIST_FILE = Configs/CGOperators.plist; 826 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 827 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 828 | MACOSX_DEPLOYMENT_TARGET = 10.10; 829 | PRODUCT_BUNDLE_IDENTIFIER = "com.CGOperators.CGOperators-macOS"; 830 | PRODUCT_NAME = CGOperators; 831 | SDKROOT = macosx; 832 | SKIP_INSTALL = YES; 833 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 834 | SWIFT_VERSION = 3.0; 835 | }; 836 | name = Release; 837 | }; 838 | DD7502831C68FCFC006590AF /* Debug */ = { 839 | isa = XCBuildConfiguration; 840 | buildSettings = { 841 | CODE_SIGN_IDENTITY = "-"; 842 | COMBINE_HIDPI_IMAGES = YES; 843 | INFOPLIST_FILE = Configs/CGOperatorsTests.plist; 844 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 845 | MACOSX_DEPLOYMENT_TARGET = 10.11; 846 | PRODUCT_BUNDLE_IDENTIFIER = "com.CGOperators.CGOperators-macOS-Tests"; 847 | PRODUCT_NAME = "$(TARGET_NAME)"; 848 | SDKROOT = macosx; 849 | SWIFT_VERSION = 3.0; 850 | }; 851 | name = Debug; 852 | }; 853 | DD7502841C68FCFC006590AF /* Release */ = { 854 | isa = XCBuildConfiguration; 855 | buildSettings = { 856 | CODE_SIGN_IDENTITY = "-"; 857 | COMBINE_HIDPI_IMAGES = YES; 858 | INFOPLIST_FILE = Configs/CGOperatorsTests.plist; 859 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 860 | MACOSX_DEPLOYMENT_TARGET = 10.11; 861 | PRODUCT_BUNDLE_IDENTIFIER = "com.CGOperators.CGOperators-macOS-Tests"; 862 | PRODUCT_NAME = "$(TARGET_NAME)"; 863 | SDKROOT = macosx; 864 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 865 | SWIFT_VERSION = 3.0; 866 | }; 867 | name = Release; 868 | }; 869 | DD7502961C690C7A006590AF /* Debug */ = { 870 | isa = XCBuildConfiguration; 871 | buildSettings = { 872 | INFOPLIST_FILE = Configs/CGOperatorsTests.plist; 873 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 874 | PRODUCT_BUNDLE_IDENTIFIER = "com.CGOperators.CGOperators-tvOS-Tests"; 875 | PRODUCT_NAME = "$(TARGET_NAME)"; 876 | SDKROOT = appletvos; 877 | SWIFT_VERSION = 3.0; 878 | TVOS_DEPLOYMENT_TARGET = 9.1; 879 | }; 880 | name = Debug; 881 | }; 882 | DD7502971C690C7A006590AF /* Release */ = { 883 | isa = XCBuildConfiguration; 884 | buildSettings = { 885 | INFOPLIST_FILE = Configs/CGOperatorsTests.plist; 886 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 887 | PRODUCT_BUNDLE_IDENTIFIER = "com.CGOperators.CGOperators-tvOS-Tests"; 888 | PRODUCT_NAME = "$(TARGET_NAME)"; 889 | SDKROOT = appletvos; 890 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 891 | SWIFT_VERSION = 3.0; 892 | TVOS_DEPLOYMENT_TARGET = 9.1; 893 | }; 894 | name = Release; 895 | }; 896 | /* End XCBuildConfiguration section */ 897 | 898 | /* Begin XCConfigurationList section */ 899 | 52D6D9761BEFF229002C0205 /* Build configuration list for PBXProject "CGOperators" */ = { 900 | isa = XCConfigurationList; 901 | buildConfigurations = ( 902 | 52D6D98E1BEFF229002C0205 /* Debug */, 903 | 52D6D98F1BEFF229002C0205 /* Release */, 904 | ); 905 | defaultConfigurationIsVisible = 0; 906 | defaultConfigurationName = Release; 907 | }; 908 | 52D6D9901BEFF229002C0205 /* Build configuration list for PBXNativeTarget "CGOperators-iOS" */ = { 909 | isa = XCConfigurationList; 910 | buildConfigurations = ( 911 | 52D6D9911BEFF229002C0205 /* Debug */, 912 | 52D6D9921BEFF229002C0205 /* Release */, 913 | ); 914 | defaultConfigurationIsVisible = 0; 915 | defaultConfigurationName = Release; 916 | }; 917 | 52D6D9931BEFF229002C0205 /* Build configuration list for PBXNativeTarget "CGOperators-iOS Tests" */ = { 918 | isa = XCConfigurationList; 919 | buildConfigurations = ( 920 | 52D6D9941BEFF229002C0205 /* Debug */, 921 | 52D6D9951BEFF229002C0205 /* Release */, 922 | ); 923 | defaultConfigurationIsVisible = 0; 924 | defaultConfigurationName = Release; 925 | }; 926 | 52D6D9E71BEFFF6E002C0205 /* Build configuration list for PBXNativeTarget "CGOperators-watchOS" */ = { 927 | isa = XCConfigurationList; 928 | buildConfigurations = ( 929 | 52D6D9E81BEFFF6E002C0205 /* Debug */, 930 | 52D6D9E91BEFFF6E002C0205 /* Release */, 931 | ); 932 | defaultConfigurationIsVisible = 0; 933 | defaultConfigurationName = Release; 934 | }; 935 | 52D6DA011BEFFFBE002C0205 /* Build configuration list for PBXNativeTarget "CGOperators-tvOS" */ = { 936 | isa = XCConfigurationList; 937 | buildConfigurations = ( 938 | 52D6DA021BEFFFBE002C0205 /* Debug */, 939 | 52D6DA031BEFFFBE002C0205 /* Release */, 940 | ); 941 | defaultConfigurationIsVisible = 0; 942 | defaultConfigurationName = Release; 943 | }; 944 | 52D6DA201BF000BD002C0205 /* Build configuration list for PBXNativeTarget "CGOperators-macOS" */ = { 945 | isa = XCConfigurationList; 946 | buildConfigurations = ( 947 | 52D6DA211BF000BD002C0205 /* Debug */, 948 | 52D6DA221BF000BD002C0205 /* Release */, 949 | ); 950 | defaultConfigurationIsVisible = 0; 951 | defaultConfigurationName = Release; 952 | }; 953 | DD7502821C68FCFC006590AF /* Build configuration list for PBXNativeTarget "CGOperators-macOS Tests" */ = { 954 | isa = XCConfigurationList; 955 | buildConfigurations = ( 956 | DD7502831C68FCFC006590AF /* Debug */, 957 | DD7502841C68FCFC006590AF /* Release */, 958 | ); 959 | defaultConfigurationIsVisible = 0; 960 | defaultConfigurationName = Release; 961 | }; 962 | DD7502951C690C7A006590AF /* Build configuration list for PBXNativeTarget "CGOperators-tvOS Tests" */ = { 963 | isa = XCConfigurationList; 964 | buildConfigurations = ( 965 | DD7502961C690C7A006590AF /* Debug */, 966 | DD7502971C690C7A006590AF /* Release */, 967 | ); 968 | defaultConfigurationIsVisible = 0; 969 | defaultConfigurationName = Release; 970 | }; 971 | /* End XCConfigurationList section */ 972 | }; 973 | rootObject = 52D6D9731BEFF229002C0205 /* Project object */; 974 | } 975 | -------------------------------------------------------------------------------- /CGOperators.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CGOperators.xcodeproj/xcshareddata/xcschemes/CGOperators-iOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 34 | 40 | 41 | 42 | 43 | 44 | 50 | 51 | 52 | 53 | 54 | 55 | 65 | 66 | 72 | 73 | 74 | 75 | 76 | 77 | 83 | 84 | 90 | 91 | 92 | 93 | 95 | 96 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /CGOperators.xcodeproj/xcshareddata/xcschemes/CGOperators-macOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 34 | 40 | 41 | 42 | 43 | 44 | 50 | 51 | 52 | 53 | 54 | 55 | 65 | 66 | 72 | 73 | 74 | 75 | 76 | 77 | 83 | 84 | 90 | 91 | 92 | 93 | 95 | 96 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /CGOperators.xcodeproj/xcshareddata/xcschemes/CGOperators-tvOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 34 | 40 | 41 | 42 | 43 | 44 | 50 | 51 | 52 | 53 | 54 | 55 | 65 | 66 | 72 | 73 | 74 | 75 | 76 | 77 | 83 | 84 | 90 | 91 | 92 | 93 | 95 | 96 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /CGOperators.xcodeproj/xcshareddata/xcschemes/CGOperators-watchOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 33 | 34 | 35 | 36 | 46 | 47 | 53 | 54 | 55 | 56 | 57 | 58 | 64 | 65 | 71 | 72 | 73 | 74 | 76 | 77 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # CGOperators Code of Conduct 2 | 3 | Below is the Code of Conduct that all contributors and participants in the CGOperators community are expected to adhere to. 4 | It's adopted from the [Contributor Covenant Code of Conduct][homepage]. 5 | 6 | ## Our Pledge 7 | 8 | In the interest of fostering an open and welcoming environment, we as 9 | contributors and maintainers pledge to making participation in our project and 10 | our community a harassment-free experience for everyone, regardless of age, body 11 | size, disability, ethnicity, gender identity and expression, level of experience, 12 | nationality, personal appearance, race, religion, or sexual identity and 13 | orientation. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to creating a positive environment 18 | include: 19 | 20 | * Using welcoming and inclusive language 21 | * Being respectful of differing viewpoints and experiences 22 | * Gracefully accepting constructive criticism 23 | * Focusing on what is best for the community 24 | * Showing empathy towards other community members 25 | 26 | Examples of unacceptable behavior by participants include: 27 | 28 | * The use of sexualized language or imagery and unwelcome sexual attention or 29 | advances 30 | * Trolling, insulting/derogatory comments, and personal or political attacks 31 | * Public or private harassment 32 | * Publishing others' private information, such as a physical or electronic 33 | address, without explicit permission 34 | * Other conduct which could reasonably be considered inappropriate in a 35 | professional setting 36 | 37 | ## Our Responsibilities 38 | 39 | Project maintainers are responsible for clarifying the standards of acceptable 40 | behavior and are expected to take appropriate and fair corrective action in 41 | response to any instances of unacceptable behavior. 42 | 43 | Project maintainers have the right and responsibility to remove, edit, or 44 | reject comments, commits, code, wiki edits, issues, and other contributions 45 | that are not aligned to this Code of Conduct, or to ban temporarily or 46 | permanently any contributor for other behaviors that they deem inappropriate, 47 | threatening, offensive, or harmful. 48 | 49 | ## Scope 50 | 51 | This Code of Conduct applies both within project spaces and in public spaces 52 | when an individual is representing the project or its community. Examples of 53 | representing a project or community include using an official project e-mail 54 | address, posting via an official social media account, or acting as an appointed 55 | representative at an online or offline event. Representation of a project may be 56 | further defined and clarified by project maintainers. 57 | 58 | ## Enforcement 59 | 60 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 61 | reported by contacting the project leader at john@sundell.co. All 62 | complaints will be reviewed and investigated and will result in a response that 63 | is deemed necessary and appropriate to the circumstances. The project team is 64 | obligated to maintain confidentiality with regard to the reporter of an incident. 65 | Further details of specific enforcement policies may be posted separately. 66 | 67 | Project maintainers who do not follow or enforce the Code of Conduct in good 68 | faith may face temporary or permanent repercussions as determined by other 69 | members of the project's leadership. 70 | 71 | ## Attribution 72 | 73 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 74 | available at [http://contributor-covenant.org/version/1/4][version] 75 | 76 | [homepage]: http://contributor-covenant.org 77 | [version]: http://contributor-covenant.org/version/1/4/ 78 | -------------------------------------------------------------------------------- /Configs/CGOperators.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSHumanReadableCopyright 24 | Copyright © 2017 John Sundell. All rights reserved. 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Configs/CGOperatorsTests.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 John Sundell 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JohnSundell/CGOperators/b852676f7b297698ddb9863e0ceeba5b76fd94d4/Logo.png -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | import PackageDescription 2 | 3 | let package = Package( 4 | name: "CGOperators" 5 | ) 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | CGOperators 3 |

4 | 5 |

6 | 7 | CocoaPods 8 | 9 | 10 | Carthage 11 | 12 | 13 | Swift Package Manager 14 | 15 | 16 | Marathon 17 | 18 | 19 | Twitter: @johnsundell 20 | 21 |

22 | 23 | Welcome to `CGOperators`, a small Swift framework that enables you to easily manipulate Core Graphics' 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. 24 | 25 | ## Examples 26 | 27 | **Add two vectors** 28 | 29 | ```swift 30 | let point = view.frame.origin + CGPoint(x: 10, y: 20) 31 | let size = image.size + view.frame.size 32 | let vector = physicsWorld.gravity + player.size 33 | ``` 34 | 35 | **Subtract two vectors** 36 | 37 | ```swift 38 | let point = view.frame.origin - CGPoint(x: 10, y: 20) 39 | let size = image.size - view.frame.size 40 | let vector = physicsWorld.gravity - player.size 41 | ``` 42 | 43 | **Multiply a vector with a constant** 44 | 45 | ```swift 46 | view.frame.size = image.size * 4 47 | button.frame.origin = superview.bounds.size * 2 48 | physicsWorld.gravity = player.position * 10 49 | ``` 50 | 51 | **Divide a vector by a constant** 52 | 53 | ```swift 54 | view.frame.size = image.size / 4 55 | button.frame.origin = superview.bounds.size / 2 56 | physicsWorld.gravity = player.position / 10 57 | ``` 58 | 59 | ## Installation 60 | 61 | **Using [CocoaPods](https://cocoapods.org)** 62 | 63 | Add `pod CGOperators` to your `Podfile` 64 | 65 | **Using [Carthage](https://github.com/Carthage/Carthage)** 66 | 67 | Add `git "JohnSundell/CGOperators"` to your `Cartfile` 68 | 69 | **Using the [Swift Package Manager](https://github.com/apple/swift-package-manager)** 70 | 71 | Add `Package(url: "https://github.com/JohnSundell/CGOperators.git", majorVersion: 1)` to your `Package.swift` file. 72 | 73 | **Using [Marathon](https://github.com/JohnSundell/Marathon)** 74 | 75 | Run `marathon add https://github.com/JohnSundell/CGOperators.git` on the command line. 76 | 77 | ## Help, feedback or suggestions? 78 | 79 | - [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. 80 | - [Open a PR](https://github.com/JohnSundell/CGOperators/pull/new/master) if you want to make some change to `CGOperators`. 81 | - Contact [@johnsundell on Twitter](https://twitter.com/johnsundell) for discussions, news & announcements about `CGOperators` and other open source projects. 82 | -------------------------------------------------------------------------------- /Sources/CGOperators.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * CGOperators 3 | * Copyright (c) John Sundell 2017 4 | * Licensed under the MIT license. See LICENSE file. 5 | */ 6 | 7 | import Foundation 8 | import CoreGraphics 9 | 10 | /// Protocol used to describe a type as a Core Graphics 2D vector 11 | /// Default implementations are provided for `CGPoint`, `CGSize` & `CGVector` 12 | public protocol CGVectorProtocol { 13 | /// The X & Y components that make up this vector 14 | var components: (x: CGFloat, y: CGFloat) { get } 15 | 16 | /// Initialize an instance of this type with X & Y components 17 | /// - parameter components: The components to fill in the vector with 18 | init(components: (x: CGFloat, y: CGFloat)) 19 | } 20 | 21 | extension CGPoint: CGVectorProtocol { 22 | public var components: (x: CGFloat, y: CGFloat) { 23 | return (x, y) 24 | } 25 | 26 | public init(components: (x: CGFloat, y: CGFloat)) { 27 | self.init(x: components.x, y: components.y) 28 | } 29 | } 30 | 31 | extension CGSize: CGVectorProtocol { 32 | public var components: (x: CGFloat, y: CGFloat) { 33 | return (width, height) 34 | } 35 | 36 | public init(components: (x: CGFloat, y: CGFloat)) { 37 | self.init(width: components.x, height: components.y) 38 | } 39 | } 40 | 41 | extension CGVector: CGVectorProtocol { 42 | public var components: (x: CGFloat, y: CGFloat) { 43 | return (dx, dy) 44 | } 45 | 46 | public init(components: (x: CGFloat, y: CGFloat)) { 47 | self.init(dx: components.x, dy: components.y) 48 | } 49 | } 50 | 51 | public extension CGVectorProtocol { 52 | /// Add two vectors, returning a new vector with the sum of their X & Y components 53 | /// Example: `CGPoint(x: 10, y: 20) + CGPoint(x: 20, y: 40) = CGPoint(x: 30, y: 60)` 54 | static func +(lhs: Self, rhs: CGVectorProtocol) -> Self { 55 | return lhs.applying(operator: +, with: rhs) 56 | } 57 | 58 | /// Subtract a vector from another, returning a new vector with the result of subtracting 59 | /// the right hand vector's components from the left hand vector's. 60 | /// Example: `CGPoint(x: 20, y: 30) - CGPoint(x: 5, y: 10) = CGPoint(x: 15, y: 20)` 61 | static func -(lhs: Self, rhs: CGVectorProtocol) -> Self { 62 | return lhs.applying(operator: -, with: rhs) 63 | } 64 | 65 | /// Return a new vector by multiplying a vector's components with a constant 66 | /// Example: `CGSize(width: 30, height: 90) * 3 = CGSize(width: 90, height: 270) 67 | static func *(lhs: Self, rhs: CGFloat) -> Self { 68 | return lhs.applying(operator: *, with: rhs) 69 | } 70 | 71 | /// Return a new vector by dividing a vector's components with a constant 72 | /// Example: `CGSize(width: 30, height: 90) / 3 = CGSize(width: 10, height: 30)` 73 | static func /(lhs: Self, rhs: CGFloat) -> Self { 74 | return lhs.applying(operator: /, with: rhs) 75 | } 76 | } 77 | 78 | private extension CGVectorProtocol { 79 | func applying(operator o: (CGFloat, CGFloat) -> CGFloat, with vector: CGVectorProtocol) -> Self { 80 | let lhsComponents = components 81 | let rhsComponents = vector.components 82 | return Self(components: (o(lhsComponents.x, rhsComponents.x), 83 | o(lhsComponents.y, rhsComponents.y))) 84 | } 85 | 86 | func applying(operator o: (CGFloat, CGFloat) -> CGFloat, with constant: CGFloat) -> Self { 87 | let components = self.components 88 | return Self(components: (o(components.x, constant), o(components.y, constant))) 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /Tests/CGOperatorsTests/CGOperatorsTests.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * CGOperators 3 | * Copyright (c) John Sundell 2017 4 | * Licensed under the MIT license. See LICENSE file. 5 | */ 6 | 7 | import Foundation 8 | import CoreGraphics 9 | import XCTest 10 | import CGOperators 11 | 12 | final class CGOperatorsTests: XCTestCase { 13 | func testAddingPoints() { 14 | XCTAssertEqual(CGPoint(x: 10, y: 20) + CGPoint(x: 50, y: 70), 15 | CGPoint(x: 60, y: 90)) 16 | } 17 | 18 | func testAddingSizeAndPoint() { 19 | XCTAssertEqual(CGSize(width: 30, height: 40) + CGPoint(x: 10, y: 90), 20 | CGSize(width: 40, height: 130)) 21 | } 22 | 23 | func testAddingVectorAndSize() { 24 | XCTAssertEqual(CGVector(dx: 5, dy: 25) + CGSize(width: 15, height: 35), 25 | CGVector(dx: 20, dy: 60)) 26 | } 27 | 28 | func testSubtractingPoints() { 29 | XCTAssertEqual(CGPoint(x: 50, y: 70) - CGPoint(x: 10, y: 20), 30 | CGPoint(x: 40, y: 50)) 31 | } 32 | 33 | func testSubtractingPointFromSize() { 34 | XCTAssertEqual(CGSize(width: 100, height: 90) - CGPoint(x: 10, y: 20), 35 | CGSize(width: 90, height: 70)) 36 | } 37 | 38 | func testSubtractingSizeFromVector() { 39 | XCTAssertEqual(CGVector(dx: 30, dy: 60) - CGSize(width: 10, height: 20), 40 | CGVector(dx: 20, dy: 40)) 41 | } 42 | 43 | func testMultiplyingPoint() { 44 | XCTAssertEqual(CGPoint(x: 150, y: 100) * 3, 45 | CGPoint(x: 450, y: 300)) 46 | } 47 | 48 | func testMultiplyingSize() { 49 | XCTAssertEqual(CGSize(width: 150, height: 100) * 3, 50 | CGSize(width: 450, height: 300)) 51 | } 52 | 53 | func testMultiplyingVector() { 54 | XCTAssertEqual(CGVector(dx: 150, dy: 100) * 3, 55 | CGVector(dx: 450, dy: 300)) 56 | } 57 | 58 | func testDividingPoint() { 59 | XCTAssertEqual(CGPoint(x: 500, y: 1000) / 5, 60 | CGPoint(x: 100, y: 200)) 61 | } 62 | 63 | func testDividingSize() { 64 | XCTAssertEqual(CGSize(width: 500, height: 1000) / 5, 65 | CGSize(width: 100, height: 200)) 66 | } 67 | 68 | func testDividingVector() { 69 | XCTAssertEqual(CGVector(dx: 500, dy: 1000) / 5, 70 | CGVector(dx: 100, dy: 200)) 71 | } 72 | } 73 | --------------------------------------------------------------------------------