├── .gitignore ├── LICENSE ├── LICENSE.md ├── Lic-OSX ├── Info.plist └── Lic-OSX.h ├── Lic-OSXTests ├── Info.plist └── Lic_OSXTests.swift ├── Lic-iOS ├── Info.plist └── Lic-iOS.h ├── Lic-iOSTests ├── Info.plist └── Lic_iOSTests.swift ├── Lic.podspec ├── Lic.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcshareddata │ └── xcschemes │ ├── Lic-OSX.xcscheme │ └── Lic-iOS.xcscheme ├── Lic └── Lic.swift ├── LicTests └── LicTests.swift └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | .DS_Store 3 | */build/* 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | *.xccheckout 14 | profile 15 | *.moved-aside 16 | DerivedData 17 | .idea/ 18 | *.hmap 19 | 20 | #CocoaPods 21 | Pods 22 | Podfile.lock 23 | 24 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Lic contributors 4 | 5 | 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: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | 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. 10 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Daniel Duan 4 | 5 | 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: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | 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. 10 | -------------------------------------------------------------------------------- /Lic-OSX/Info.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 | 0.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Lic-OSX/Lic-OSX.h: -------------------------------------------------------------------------------- 1 | // 2 | // Lic-OSX.h 3 | // Lic-OSX 4 | // 5 | // Created by Daniel Duan on 7/18/15. 6 | // 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for Lic-OSX. 12 | FOUNDATION_EXPORT double Lic_OSXVersionNumber; 13 | 14 | //! Project version string for Lic-OSX. 15 | FOUNDATION_EXPORT const unsigned char Lic_OSXVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /Lic-OSXTests/Info.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 | -------------------------------------------------------------------------------- /Lic-OSXTests/Lic_OSXTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Lic_OSXTests.swift 3 | // Lic-OSXTests 4 | // 5 | // Created by Daniel Duan on 7/18/15. 6 | // 7 | // 8 | 9 | import XCTest 10 | 11 | class Lic_OSXTests: XCTestCase { 12 | 13 | override func setUp() { 14 | super.setUp() 15 | // Put setup code here. This method is called before the invocation of each test method in the class. 16 | } 17 | 18 | override func tearDown() { 19 | // Put teardown code here. This method is called after the invocation of each test method in the class. 20 | super.tearDown() 21 | } 22 | 23 | func testExample() { 24 | // This is an example of a functional test case. 25 | // Use XCTAssert and related functions to verify your tests produce the correct results. 26 | } 27 | 28 | func testPerformanceExample() { 29 | // This is an example of a performance test case. 30 | self.measureBlock { 31 | // Put the code you want to measure the time of here. 32 | } 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /Lic-iOS/Info.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 | 0.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Lic-iOS/Lic-iOS.h: -------------------------------------------------------------------------------- 1 | // 2 | // Lic-iOS.h 3 | // Lic-iOS 4 | // 5 | // Created by Daniel Duan on 7/18/15. 6 | // 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for Lic-iOS. 12 | FOUNDATION_EXPORT double Lic_iOSVersionNumber; 13 | 14 | //! Project version string for Lic-iOS. 15 | FOUNDATION_EXPORT const unsigned char Lic_iOSVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /Lic-iOSTests/Info.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 | -------------------------------------------------------------------------------- /Lic-iOSTests/Lic_iOSTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Lic_iOSTests.swift 3 | // Lic-iOSTests 4 | // 5 | // Created by Daniel Duan on 7/18/15. 6 | // 7 | // 8 | 9 | import XCTest 10 | 11 | class Lic_iOSTests: XCTestCase { 12 | 13 | override func setUp() { 14 | super.setUp() 15 | // Put setup code here. This method is called before the invocation of each test method in the class. 16 | } 17 | 18 | override func tearDown() { 19 | // Put teardown code here. This method is called after the invocation of each test method in the class. 20 | super.tearDown() 21 | } 22 | 23 | func testExample() { 24 | // This is an example of a functional test case. 25 | // Use XCTAssert and related functions to verify your tests produce the correct results. 26 | } 27 | 28 | func testPerformanceExample() { 29 | // This is an example of a performance test case. 30 | self.measureBlock { 31 | // Put the code you want to measure the time of here. 32 | } 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /Lic.podspec: -------------------------------------------------------------------------------- 1 | 2 | Pod::Spec.new do |s| 3 | 4 | s.name = "Lic" 5 | s.version = "0.1.2" 6 | s.summary = "Easy, safe object slicing for Swift" 7 | 8 | s.description = <<-DESC 9 | Lic is a μ-framework that makes getting slices of arrays 10 | and strings in Swift 2 safe and easy. 11 | 12 | DESC 13 | 14 | s.homepage = "https://github.com/dduan/Lic" 15 | 16 | s.license = { :type => "MIT", :file => "LICENSE.md" } 17 | s.author = { "Daniel Duan" => "daniel@duan.org" } 18 | s.social_media_url = "https://twitter.com/Daniel_Duan" 19 | 20 | s.ios.deployment_target = "8.0" 21 | s.osx.deployment_target = "10.10" 22 | 23 | s.source = { :git => "https://github.com/dduan/Lic.git", :tag => "v#{s.version}" } 24 | 25 | s.source_files = "Lic", "Lic/**/*.{swift}" 26 | 27 | end 28 | -------------------------------------------------------------------------------- /Lic.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 94E1ECAC1B5B27AB00387C5D /* Lic-iOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 94E1ECAB1B5B27AB00387C5D /* Lic-iOS.h */; settings = {ATTRIBUTES = (Public, ); }; }; 11 | 94E1ECB11B5B27E900387C5D /* Lic.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94E1EC861B5B0C5700387C5D /* Lic.swift */; }; 12 | 94E1ECB21B5B27EA00387C5D /* Lic.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94E1EC861B5B0C5700387C5D /* Lic.swift */; }; 13 | 94E1ECBA1B5B283800387C5D /* Lic_iOSTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94E1ECB91B5B283800387C5D /* Lic_iOSTests.swift */; }; 14 | 94E1ECBC1B5B283800387C5D /* Lic.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 94E1ECA91B5B27AB00387C5D /* Lic.framework */; }; 15 | 94E1ECC91B5B284700387C5D /* Lic_OSXTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94E1ECC81B5B284700387C5D /* Lic_OSXTests.swift */; }; 16 | 94E1ECCB1B5B284700387C5D /* Lic.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 94E1EC9C1B5B279900387C5D /* Lic.framework */; }; 17 | 94E1ECD11B5B284D00387C5D /* LicTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94E1EC8E1B5B0CCB00387C5D /* LicTests.swift */; }; 18 | 94E1ECD21B5B284E00387C5D /* LicTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94E1EC8E1B5B0CCB00387C5D /* LicTests.swift */; }; 19 | 94E1ECFD1B5B304100387C5D /* Lic-OSX.h in Headers */ = {isa = PBXBuildFile; fileRef = 94E1EC9E1B5B279900387C5D /* Lic-OSX.h */; settings = {ATTRIBUTES = (Public, ); }; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXContainerItemProxy section */ 23 | 94E1ECBD1B5B283800387C5D /* PBXContainerItemProxy */ = { 24 | isa = PBXContainerItemProxy; 25 | containerPortal = 94E1EC721B5B0C4500387C5D /* Project object */; 26 | proxyType = 1; 27 | remoteGlobalIDString = 94E1ECA81B5B27AB00387C5D; 28 | remoteInfo = "Lic-iOS"; 29 | }; 30 | 94E1ECCC1B5B284700387C5D /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = 94E1EC721B5B0C4500387C5D /* Project object */; 33 | proxyType = 1; 34 | remoteGlobalIDString = 94E1EC9B1B5B279900387C5D; 35 | remoteInfo = "Lic-OSX"; 36 | }; 37 | /* End PBXContainerItemProxy section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | 94E1EC861B5B0C5700387C5D /* Lic.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Lic.swift; sourceTree = ""; }; 41 | 94E1EC8E1B5B0CCB00387C5D /* LicTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LicTests.swift; sourceTree = ""; }; 42 | 94E1EC9C1B5B279900387C5D /* Lic.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Lic.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | 94E1EC9E1B5B279900387C5D /* Lic-OSX.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Lic-OSX.h"; sourceTree = ""; }; 44 | 94E1ECA01B5B279900387C5D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 45 | 94E1ECA91B5B27AB00387C5D /* Lic.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Lic.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 46 | 94E1ECAB1B5B27AB00387C5D /* Lic-iOS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Lic-iOS.h"; sourceTree = ""; }; 47 | 94E1ECAD1B5B27AB00387C5D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 48 | 94E1ECB71B5B283800387C5D /* Lic-iOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Lic-iOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | 94E1ECB91B5B283800387C5D /* Lic_iOSTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Lic_iOSTests.swift; sourceTree = ""; }; 50 | 94E1ECBB1B5B283800387C5D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 51 | 94E1ECC61B5B284700387C5D /* Lic-OSXTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Lic-OSXTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 52 | 94E1ECC81B5B284700387C5D /* Lic_OSXTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Lic_OSXTests.swift; sourceTree = ""; }; 53 | 94E1ECCA1B5B284700387C5D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 54 | /* End PBXFileReference section */ 55 | 56 | /* Begin PBXFrameworksBuildPhase section */ 57 | 94E1EC981B5B279900387C5D /* Frameworks */ = { 58 | isa = PBXFrameworksBuildPhase; 59 | buildActionMask = 2147483647; 60 | files = ( 61 | ); 62 | runOnlyForDeploymentPostprocessing = 0; 63 | }; 64 | 94E1ECA51B5B27AB00387C5D /* Frameworks */ = { 65 | isa = PBXFrameworksBuildPhase; 66 | buildActionMask = 2147483647; 67 | files = ( 68 | ); 69 | runOnlyForDeploymentPostprocessing = 0; 70 | }; 71 | 94E1ECB41B5B283800387C5D /* Frameworks */ = { 72 | isa = PBXFrameworksBuildPhase; 73 | buildActionMask = 2147483647; 74 | files = ( 75 | 94E1ECBC1B5B283800387C5D /* Lic.framework in Frameworks */, 76 | ); 77 | runOnlyForDeploymentPostprocessing = 0; 78 | }; 79 | 94E1ECC31B5B284700387C5D /* Frameworks */ = { 80 | isa = PBXFrameworksBuildPhase; 81 | buildActionMask = 2147483647; 82 | files = ( 83 | 94E1ECCB1B5B284700387C5D /* Lic.framework in Frameworks */, 84 | ); 85 | runOnlyForDeploymentPostprocessing = 0; 86 | }; 87 | /* End PBXFrameworksBuildPhase section */ 88 | 89 | /* Begin PBXGroup section */ 90 | 94E1EC711B5B0C4500387C5D = { 91 | isa = PBXGroup; 92 | children = ( 93 | 94E1EC7D1B5B0C4500387C5D /* Source */, 94 | 94E1EC8D1B5B0CCB00387C5D /* Tests */, 95 | 94E1EC9D1B5B279900387C5D /* Lic-OSX */, 96 | 94E1ECAA1B5B27AB00387C5D /* Lic-iOS */, 97 | 94E1ECB81B5B283800387C5D /* Lic-iOSTests */, 98 | 94E1ECC71B5B284700387C5D /* Lic-OSXTests */, 99 | 94E1EC7C1B5B0C4500387C5D /* Products */, 100 | ); 101 | sourceTree = ""; 102 | }; 103 | 94E1EC7C1B5B0C4500387C5D /* Products */ = { 104 | isa = PBXGroup; 105 | children = ( 106 | 94E1EC9C1B5B279900387C5D /* Lic.framework */, 107 | 94E1ECA91B5B27AB00387C5D /* Lic.framework */, 108 | 94E1ECB71B5B283800387C5D /* Lic-iOSTests.xctest */, 109 | 94E1ECC61B5B284700387C5D /* Lic-OSXTests.xctest */, 110 | ); 111 | name = Products; 112 | sourceTree = ""; 113 | }; 114 | 94E1EC7D1B5B0C4500387C5D /* Source */ = { 115 | isa = PBXGroup; 116 | children = ( 117 | 94E1EC861B5B0C5700387C5D /* Lic.swift */, 118 | ); 119 | name = Source; 120 | path = Lic; 121 | sourceTree = ""; 122 | }; 123 | 94E1EC8D1B5B0CCB00387C5D /* Tests */ = { 124 | isa = PBXGroup; 125 | children = ( 126 | 94E1EC8E1B5B0CCB00387C5D /* LicTests.swift */, 127 | ); 128 | name = Tests; 129 | path = LicTests; 130 | sourceTree = ""; 131 | }; 132 | 94E1EC9D1B5B279900387C5D /* Lic-OSX */ = { 133 | isa = PBXGroup; 134 | children = ( 135 | 94E1EC9E1B5B279900387C5D /* Lic-OSX.h */, 136 | 94E1ECA01B5B279900387C5D /* Info.plist */, 137 | ); 138 | path = "Lic-OSX"; 139 | sourceTree = ""; 140 | }; 141 | 94E1ECAA1B5B27AB00387C5D /* Lic-iOS */ = { 142 | isa = PBXGroup; 143 | children = ( 144 | 94E1ECAB1B5B27AB00387C5D /* Lic-iOS.h */, 145 | 94E1ECAD1B5B27AB00387C5D /* Info.plist */, 146 | ); 147 | path = "Lic-iOS"; 148 | sourceTree = ""; 149 | }; 150 | 94E1ECB81B5B283800387C5D /* Lic-iOSTests */ = { 151 | isa = PBXGroup; 152 | children = ( 153 | 94E1ECB91B5B283800387C5D /* Lic_iOSTests.swift */, 154 | 94E1ECBB1B5B283800387C5D /* Info.plist */, 155 | ); 156 | path = "Lic-iOSTests"; 157 | sourceTree = ""; 158 | }; 159 | 94E1ECC71B5B284700387C5D /* Lic-OSXTests */ = { 160 | isa = PBXGroup; 161 | children = ( 162 | 94E1ECC81B5B284700387C5D /* Lic_OSXTests.swift */, 163 | 94E1ECCA1B5B284700387C5D /* Info.plist */, 164 | ); 165 | path = "Lic-OSXTests"; 166 | sourceTree = ""; 167 | }; 168 | /* End PBXGroup section */ 169 | 170 | /* Begin PBXHeadersBuildPhase section */ 171 | 94E1EC991B5B279900387C5D /* Headers */ = { 172 | isa = PBXHeadersBuildPhase; 173 | buildActionMask = 2147483647; 174 | files = ( 175 | 94E1ECFD1B5B304100387C5D /* Lic-OSX.h in Headers */, 176 | ); 177 | runOnlyForDeploymentPostprocessing = 0; 178 | }; 179 | 94E1ECA61B5B27AB00387C5D /* Headers */ = { 180 | isa = PBXHeadersBuildPhase; 181 | buildActionMask = 2147483647; 182 | files = ( 183 | 94E1ECAC1B5B27AB00387C5D /* Lic-iOS.h in Headers */, 184 | ); 185 | runOnlyForDeploymentPostprocessing = 0; 186 | }; 187 | /* End PBXHeadersBuildPhase section */ 188 | 189 | /* Begin PBXNativeTarget section */ 190 | 94E1EC9B1B5B279900387C5D /* Lic-OSX */ = { 191 | isa = PBXNativeTarget; 192 | buildConfigurationList = 94E1ECA11B5B279900387C5D /* Build configuration list for PBXNativeTarget "Lic-OSX" */; 193 | buildPhases = ( 194 | 94E1EC971B5B279900387C5D /* Sources */, 195 | 94E1EC981B5B279900387C5D /* Frameworks */, 196 | 94E1EC991B5B279900387C5D /* Headers */, 197 | 94E1EC9A1B5B279900387C5D /* Resources */, 198 | ); 199 | buildRules = ( 200 | ); 201 | dependencies = ( 202 | ); 203 | name = "Lic-OSX"; 204 | productName = "Lic-OSX"; 205 | productReference = 94E1EC9C1B5B279900387C5D /* Lic.framework */; 206 | productType = "com.apple.product-type.framework"; 207 | }; 208 | 94E1ECA81B5B27AB00387C5D /* Lic-iOS */ = { 209 | isa = PBXNativeTarget; 210 | buildConfigurationList = 94E1ECAE1B5B27AB00387C5D /* Build configuration list for PBXNativeTarget "Lic-iOS" */; 211 | buildPhases = ( 212 | 94E1ECA41B5B27AB00387C5D /* Sources */, 213 | 94E1ECA51B5B27AB00387C5D /* Frameworks */, 214 | 94E1ECA61B5B27AB00387C5D /* Headers */, 215 | 94E1ECA71B5B27AB00387C5D /* Resources */, 216 | ); 217 | buildRules = ( 218 | ); 219 | dependencies = ( 220 | ); 221 | name = "Lic-iOS"; 222 | productName = "Lic-iOS"; 223 | productReference = 94E1ECA91B5B27AB00387C5D /* Lic.framework */; 224 | productType = "com.apple.product-type.framework"; 225 | }; 226 | 94E1ECB61B5B283800387C5D /* Lic-iOSTests */ = { 227 | isa = PBXNativeTarget; 228 | buildConfigurationList = 94E1ECBF1B5B283800387C5D /* Build configuration list for PBXNativeTarget "Lic-iOSTests" */; 229 | buildPhases = ( 230 | 94E1ECB31B5B283800387C5D /* Sources */, 231 | 94E1ECB41B5B283800387C5D /* Frameworks */, 232 | 94E1ECB51B5B283800387C5D /* Resources */, 233 | ); 234 | buildRules = ( 235 | ); 236 | dependencies = ( 237 | 94E1ECBE1B5B283800387C5D /* PBXTargetDependency */, 238 | ); 239 | name = "Lic-iOSTests"; 240 | productName = "Lic-iOSTests"; 241 | productReference = 94E1ECB71B5B283800387C5D /* Lic-iOSTests.xctest */; 242 | productType = "com.apple.product-type.bundle.unit-test"; 243 | }; 244 | 94E1ECC51B5B284700387C5D /* Lic-OSXTests */ = { 245 | isa = PBXNativeTarget; 246 | buildConfigurationList = 94E1ECCE1B5B284700387C5D /* Build configuration list for PBXNativeTarget "Lic-OSXTests" */; 247 | buildPhases = ( 248 | 94E1ECC21B5B284700387C5D /* Sources */, 249 | 94E1ECC31B5B284700387C5D /* Frameworks */, 250 | 94E1ECC41B5B284700387C5D /* Resources */, 251 | ); 252 | buildRules = ( 253 | ); 254 | dependencies = ( 255 | 94E1ECCD1B5B284700387C5D /* PBXTargetDependency */, 256 | ); 257 | name = "Lic-OSXTests"; 258 | productName = "Lic-OSXTests"; 259 | productReference = 94E1ECC61B5B284700387C5D /* Lic-OSXTests.xctest */; 260 | productType = "com.apple.product-type.bundle.unit-test"; 261 | }; 262 | /* End PBXNativeTarget section */ 263 | 264 | /* Begin PBXProject section */ 265 | 94E1EC721B5B0C4500387C5D /* Project object */ = { 266 | isa = PBXProject; 267 | attributes = { 268 | LastSwiftUpdateCheck = 0700; 269 | LastUpgradeCheck = 0700; 270 | ORGANIZATIONNAME = ""; 271 | TargetAttributes = { 272 | 94E1EC9B1B5B279900387C5D = { 273 | CreatedOnToolsVersion = 7.0; 274 | }; 275 | 94E1ECA81B5B27AB00387C5D = { 276 | CreatedOnToolsVersion = 7.0; 277 | }; 278 | 94E1ECB61B5B283800387C5D = { 279 | CreatedOnToolsVersion = 7.0; 280 | }; 281 | 94E1ECC51B5B284700387C5D = { 282 | CreatedOnToolsVersion = 7.0; 283 | }; 284 | }; 285 | }; 286 | buildConfigurationList = 94E1EC751B5B0C4500387C5D /* Build configuration list for PBXProject "Lic" */; 287 | compatibilityVersion = "Xcode 3.2"; 288 | developmentRegion = English; 289 | hasScannedForEncodings = 0; 290 | knownRegions = ( 291 | en, 292 | ); 293 | mainGroup = 94E1EC711B5B0C4500387C5D; 294 | productRefGroup = 94E1EC7C1B5B0C4500387C5D /* Products */; 295 | projectDirPath = ""; 296 | projectRoot = ""; 297 | targets = ( 298 | 94E1EC9B1B5B279900387C5D /* Lic-OSX */, 299 | 94E1ECA81B5B27AB00387C5D /* Lic-iOS */, 300 | 94E1ECB61B5B283800387C5D /* Lic-iOSTests */, 301 | 94E1ECC51B5B284700387C5D /* Lic-OSXTests */, 302 | ); 303 | }; 304 | /* End PBXProject section */ 305 | 306 | /* Begin PBXResourcesBuildPhase section */ 307 | 94E1EC9A1B5B279900387C5D /* Resources */ = { 308 | isa = PBXResourcesBuildPhase; 309 | buildActionMask = 2147483647; 310 | files = ( 311 | ); 312 | runOnlyForDeploymentPostprocessing = 0; 313 | }; 314 | 94E1ECA71B5B27AB00387C5D /* Resources */ = { 315 | isa = PBXResourcesBuildPhase; 316 | buildActionMask = 2147483647; 317 | files = ( 318 | ); 319 | runOnlyForDeploymentPostprocessing = 0; 320 | }; 321 | 94E1ECB51B5B283800387C5D /* Resources */ = { 322 | isa = PBXResourcesBuildPhase; 323 | buildActionMask = 2147483647; 324 | files = ( 325 | ); 326 | runOnlyForDeploymentPostprocessing = 0; 327 | }; 328 | 94E1ECC41B5B284700387C5D /* Resources */ = { 329 | isa = PBXResourcesBuildPhase; 330 | buildActionMask = 2147483647; 331 | files = ( 332 | ); 333 | runOnlyForDeploymentPostprocessing = 0; 334 | }; 335 | /* End PBXResourcesBuildPhase section */ 336 | 337 | /* Begin PBXSourcesBuildPhase section */ 338 | 94E1EC971B5B279900387C5D /* Sources */ = { 339 | isa = PBXSourcesBuildPhase; 340 | buildActionMask = 2147483647; 341 | files = ( 342 | 94E1ECB11B5B27E900387C5D /* Lic.swift in Sources */, 343 | ); 344 | runOnlyForDeploymentPostprocessing = 0; 345 | }; 346 | 94E1ECA41B5B27AB00387C5D /* Sources */ = { 347 | isa = PBXSourcesBuildPhase; 348 | buildActionMask = 2147483647; 349 | files = ( 350 | 94E1ECB21B5B27EA00387C5D /* Lic.swift in Sources */, 351 | ); 352 | runOnlyForDeploymentPostprocessing = 0; 353 | }; 354 | 94E1ECB31B5B283800387C5D /* Sources */ = { 355 | isa = PBXSourcesBuildPhase; 356 | buildActionMask = 2147483647; 357 | files = ( 358 | 94E1ECD11B5B284D00387C5D /* LicTests.swift in Sources */, 359 | 94E1ECBA1B5B283800387C5D /* Lic_iOSTests.swift in Sources */, 360 | ); 361 | runOnlyForDeploymentPostprocessing = 0; 362 | }; 363 | 94E1ECC21B5B284700387C5D /* Sources */ = { 364 | isa = PBXSourcesBuildPhase; 365 | buildActionMask = 2147483647; 366 | files = ( 367 | 94E1ECD21B5B284E00387C5D /* LicTests.swift in Sources */, 368 | 94E1ECC91B5B284700387C5D /* Lic_OSXTests.swift in Sources */, 369 | ); 370 | runOnlyForDeploymentPostprocessing = 0; 371 | }; 372 | /* End PBXSourcesBuildPhase section */ 373 | 374 | /* Begin PBXTargetDependency section */ 375 | 94E1ECBE1B5B283800387C5D /* PBXTargetDependency */ = { 376 | isa = PBXTargetDependency; 377 | target = 94E1ECA81B5B27AB00387C5D /* Lic-iOS */; 378 | targetProxy = 94E1ECBD1B5B283800387C5D /* PBXContainerItemProxy */; 379 | }; 380 | 94E1ECCD1B5B284700387C5D /* PBXTargetDependency */ = { 381 | isa = PBXTargetDependency; 382 | target = 94E1EC9B1B5B279900387C5D /* Lic-OSX */; 383 | targetProxy = 94E1ECCC1B5B284700387C5D /* PBXContainerItemProxy */; 384 | }; 385 | /* End PBXTargetDependency section */ 386 | 387 | /* Begin XCBuildConfiguration section */ 388 | 94E1EC811B5B0C4500387C5D /* Debug */ = { 389 | isa = XCBuildConfiguration; 390 | buildSettings = { 391 | ALWAYS_SEARCH_USER_PATHS = NO; 392 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 393 | CLANG_CXX_LIBRARY = "libc++"; 394 | CLANG_ENABLE_MODULES = YES; 395 | CLANG_ENABLE_OBJC_ARC = YES; 396 | CLANG_WARN_BOOL_CONVERSION = YES; 397 | CLANG_WARN_CONSTANT_CONVERSION = YES; 398 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 399 | CLANG_WARN_EMPTY_BODY = YES; 400 | CLANG_WARN_ENUM_CONVERSION = YES; 401 | CLANG_WARN_INT_CONVERSION = YES; 402 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 403 | CLANG_WARN_UNREACHABLE_CODE = YES; 404 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 405 | COPY_PHASE_STRIP = NO; 406 | CURRENT_PROJECT_VERSION = 1; 407 | DEBUG_INFORMATION_FORMAT = dwarf; 408 | ENABLE_STRICT_OBJC_MSGSEND = YES; 409 | ENABLE_TESTABILITY = YES; 410 | GCC_C_LANGUAGE_STANDARD = gnu99; 411 | GCC_DYNAMIC_NO_PIC = NO; 412 | GCC_NO_COMMON_BLOCKS = YES; 413 | GCC_OPTIMIZATION_LEVEL = 0; 414 | GCC_PREPROCESSOR_DEFINITIONS = ( 415 | "DEBUG=1", 416 | "$(inherited)", 417 | ); 418 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 419 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 420 | GCC_WARN_UNDECLARED_SELECTOR = YES; 421 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 422 | GCC_WARN_UNUSED_FUNCTION = YES; 423 | GCC_WARN_UNUSED_VARIABLE = YES; 424 | MACOSX_DEPLOYMENT_TARGET = 10.10; 425 | MTL_ENABLE_DEBUG_INFO = YES; 426 | ONLY_ACTIVE_ARCH = YES; 427 | SDKROOT = macosx; 428 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 429 | VERSIONING_SYSTEM = "apple-generic"; 430 | VERSION_INFO_PREFIX = ""; 431 | }; 432 | name = Debug; 433 | }; 434 | 94E1EC821B5B0C4500387C5D /* Release */ = { 435 | isa = XCBuildConfiguration; 436 | buildSettings = { 437 | ALWAYS_SEARCH_USER_PATHS = NO; 438 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 439 | CLANG_CXX_LIBRARY = "libc++"; 440 | CLANG_ENABLE_MODULES = YES; 441 | CLANG_ENABLE_OBJC_ARC = YES; 442 | CLANG_WARN_BOOL_CONVERSION = YES; 443 | CLANG_WARN_CONSTANT_CONVERSION = YES; 444 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 445 | CLANG_WARN_EMPTY_BODY = YES; 446 | CLANG_WARN_ENUM_CONVERSION = YES; 447 | CLANG_WARN_INT_CONVERSION = YES; 448 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 449 | CLANG_WARN_UNREACHABLE_CODE = YES; 450 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 451 | COPY_PHASE_STRIP = NO; 452 | CURRENT_PROJECT_VERSION = 1; 453 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 454 | ENABLE_NS_ASSERTIONS = NO; 455 | ENABLE_STRICT_OBJC_MSGSEND = YES; 456 | GCC_C_LANGUAGE_STANDARD = gnu99; 457 | GCC_NO_COMMON_BLOCKS = YES; 458 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 459 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 460 | GCC_WARN_UNDECLARED_SELECTOR = YES; 461 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 462 | GCC_WARN_UNUSED_FUNCTION = YES; 463 | GCC_WARN_UNUSED_VARIABLE = YES; 464 | MACOSX_DEPLOYMENT_TARGET = 10.10; 465 | MTL_ENABLE_DEBUG_INFO = NO; 466 | SDKROOT = macosx; 467 | VERSIONING_SYSTEM = "apple-generic"; 468 | VERSION_INFO_PREFIX = ""; 469 | }; 470 | name = Release; 471 | }; 472 | 94E1ECA21B5B279900387C5D /* Debug */ = { 473 | isa = XCBuildConfiguration; 474 | buildSettings = { 475 | COMBINE_HIDPI_IMAGES = YES; 476 | DEFINES_MODULE = YES; 477 | DYLIB_COMPATIBILITY_VERSION = 1; 478 | DYLIB_CURRENT_VERSION = 1; 479 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 480 | FRAMEWORK_VERSION = A; 481 | INFOPLIST_FILE = "Lic-OSX/Info.plist"; 482 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 483 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 484 | PRODUCT_BUNDLE_IDENTIFIER = "swift.free.Lic-OSX"; 485 | PRODUCT_NAME = Lic; 486 | SKIP_INSTALL = YES; 487 | }; 488 | name = Debug; 489 | }; 490 | 94E1ECA31B5B279900387C5D /* Release */ = { 491 | isa = XCBuildConfiguration; 492 | buildSettings = { 493 | COMBINE_HIDPI_IMAGES = YES; 494 | DEFINES_MODULE = YES; 495 | DYLIB_COMPATIBILITY_VERSION = 1; 496 | DYLIB_CURRENT_VERSION = 1; 497 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 498 | FRAMEWORK_VERSION = A; 499 | INFOPLIST_FILE = "Lic-OSX/Info.plist"; 500 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 501 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 502 | PRODUCT_BUNDLE_IDENTIFIER = "swift.free.Lic-OSX"; 503 | PRODUCT_NAME = Lic; 504 | SKIP_INSTALL = YES; 505 | }; 506 | name = Release; 507 | }; 508 | 94E1ECAF1B5B27AB00387C5D /* Debug */ = { 509 | isa = XCBuildConfiguration; 510 | buildSettings = { 511 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 512 | DEFINES_MODULE = YES; 513 | DYLIB_COMPATIBILITY_VERSION = 1; 514 | DYLIB_CURRENT_VERSION = 1; 515 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 516 | INFOPLIST_FILE = "Lic-iOS/Info.plist"; 517 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 518 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 519 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 520 | PRODUCT_BUNDLE_IDENTIFIER = "swift.free.Lic-iOS"; 521 | PRODUCT_NAME = Lic; 522 | SDKROOT = iphoneos; 523 | SKIP_INSTALL = YES; 524 | TARGETED_DEVICE_FAMILY = "1,2"; 525 | }; 526 | name = Debug; 527 | }; 528 | 94E1ECB01B5B27AB00387C5D /* Release */ = { 529 | isa = XCBuildConfiguration; 530 | buildSettings = { 531 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 532 | DEFINES_MODULE = YES; 533 | DYLIB_COMPATIBILITY_VERSION = 1; 534 | DYLIB_CURRENT_VERSION = 1; 535 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 536 | INFOPLIST_FILE = "Lic-iOS/Info.plist"; 537 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 538 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 539 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 540 | PRODUCT_BUNDLE_IDENTIFIER = "swift.free.Lic-iOS"; 541 | PRODUCT_NAME = Lic; 542 | SDKROOT = iphoneos; 543 | SKIP_INSTALL = YES; 544 | TARGETED_DEVICE_FAMILY = "1,2"; 545 | VALIDATE_PRODUCT = YES; 546 | }; 547 | name = Release; 548 | }; 549 | 94E1ECC01B5B283800387C5D /* Debug */ = { 550 | isa = XCBuildConfiguration; 551 | buildSettings = { 552 | INFOPLIST_FILE = "Lic-iOSTests/Info.plist"; 553 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 554 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 555 | PRODUCT_BUNDLE_IDENTIFIER = "swift.free.Lic-iOSTests"; 556 | PRODUCT_NAME = "$(TARGET_NAME)"; 557 | SDKROOT = iphoneos; 558 | }; 559 | name = Debug; 560 | }; 561 | 94E1ECC11B5B283800387C5D /* Release */ = { 562 | isa = XCBuildConfiguration; 563 | buildSettings = { 564 | INFOPLIST_FILE = "Lic-iOSTests/Info.plist"; 565 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 566 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 567 | PRODUCT_BUNDLE_IDENTIFIER = "swift.free.Lic-iOSTests"; 568 | PRODUCT_NAME = "$(TARGET_NAME)"; 569 | SDKROOT = iphoneos; 570 | VALIDATE_PRODUCT = YES; 571 | }; 572 | name = Release; 573 | }; 574 | 94E1ECCF1B5B284700387C5D /* Debug */ = { 575 | isa = XCBuildConfiguration; 576 | buildSettings = { 577 | COMBINE_HIDPI_IMAGES = YES; 578 | INFOPLIST_FILE = "Lic-OSXTests/Info.plist"; 579 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 580 | PRODUCT_BUNDLE_IDENTIFIER = "swift.free.Lic-OSXTests"; 581 | PRODUCT_NAME = "$(TARGET_NAME)"; 582 | }; 583 | name = Debug; 584 | }; 585 | 94E1ECD01B5B284700387C5D /* Release */ = { 586 | isa = XCBuildConfiguration; 587 | buildSettings = { 588 | COMBINE_HIDPI_IMAGES = YES; 589 | INFOPLIST_FILE = "Lic-OSXTests/Info.plist"; 590 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 591 | PRODUCT_BUNDLE_IDENTIFIER = "swift.free.Lic-OSXTests"; 592 | PRODUCT_NAME = "$(TARGET_NAME)"; 593 | }; 594 | name = Release; 595 | }; 596 | /* End XCBuildConfiguration section */ 597 | 598 | /* Begin XCConfigurationList section */ 599 | 94E1EC751B5B0C4500387C5D /* Build configuration list for PBXProject "Lic" */ = { 600 | isa = XCConfigurationList; 601 | buildConfigurations = ( 602 | 94E1EC811B5B0C4500387C5D /* Debug */, 603 | 94E1EC821B5B0C4500387C5D /* Release */, 604 | ); 605 | defaultConfigurationIsVisible = 0; 606 | defaultConfigurationName = Release; 607 | }; 608 | 94E1ECA11B5B279900387C5D /* Build configuration list for PBXNativeTarget "Lic-OSX" */ = { 609 | isa = XCConfigurationList; 610 | buildConfigurations = ( 611 | 94E1ECA21B5B279900387C5D /* Debug */, 612 | 94E1ECA31B5B279900387C5D /* Release */, 613 | ); 614 | defaultConfigurationIsVisible = 0; 615 | defaultConfigurationName = Release; 616 | }; 617 | 94E1ECAE1B5B27AB00387C5D /* Build configuration list for PBXNativeTarget "Lic-iOS" */ = { 618 | isa = XCConfigurationList; 619 | buildConfigurations = ( 620 | 94E1ECAF1B5B27AB00387C5D /* Debug */, 621 | 94E1ECB01B5B27AB00387C5D /* Release */, 622 | ); 623 | defaultConfigurationIsVisible = 0; 624 | defaultConfigurationName = Release; 625 | }; 626 | 94E1ECBF1B5B283800387C5D /* Build configuration list for PBXNativeTarget "Lic-iOSTests" */ = { 627 | isa = XCConfigurationList; 628 | buildConfigurations = ( 629 | 94E1ECC01B5B283800387C5D /* Debug */, 630 | 94E1ECC11B5B283800387C5D /* Release */, 631 | ); 632 | defaultConfigurationIsVisible = 0; 633 | defaultConfigurationName = Release; 634 | }; 635 | 94E1ECCE1B5B284700387C5D /* Build configuration list for PBXNativeTarget "Lic-OSXTests" */ = { 636 | isa = XCConfigurationList; 637 | buildConfigurations = ( 638 | 94E1ECCF1B5B284700387C5D /* Debug */, 639 | 94E1ECD01B5B284700387C5D /* Release */, 640 | ); 641 | defaultConfigurationIsVisible = 0; 642 | defaultConfigurationName = Release; 643 | }; 644 | /* End XCConfigurationList section */ 645 | }; 646 | rootObject = 94E1EC721B5B0C4500387C5D /* Project object */; 647 | } 648 | -------------------------------------------------------------------------------- /Lic.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Lic.xcodeproj/xcshareddata/xcschemes/Lic-OSX.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 64 | 65 | 71 | 72 | 73 | 74 | 75 | 76 | 82 | 83 | 89 | 90 | 91 | 92 | 94 | 95 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /Lic.xcodeproj/xcshareddata/xcschemes/Lic-iOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 64 | 65 | 71 | 72 | 73 | 74 | 75 | 76 | 82 | 83 | 89 | 90 | 91 | 92 | 94 | 95 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /Lic/Lic.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Lic.swift 3 | // Lic 4 | // 5 | // Created by Daniel Duan on 7/18/15. 6 | // 7 | 8 | /// - parameter start: any integer to indicate the beginning of the range 9 | /// - parameter end: any integer to indicate the end of the range 10 | /// - parameter total: maximum available length 11 | /// - returns: (start, end), the safe range indicators 12 | internal func normalize(start: Int?, end: Int?, total: Int) -> (Int, Int) { 13 | var actualStart = start ?? 0 14 | actualStart = actualStart < 0 ? total + actualStart : actualStart 15 | actualStart = max(0, actualStart) 16 | 17 | var actualEnd = end ?? total 18 | actualEnd = actualEnd < 0 ? total + actualEnd : actualEnd 19 | actualEnd = max(0, actualEnd) 20 | 21 | let safeEnd = min(actualEnd, total) 22 | return (min(actualStart, safeEnd), min(actualEnd, total)) 23 | } 24 | 25 | 26 | extension CollectionType { 27 | /// - parameter start: any integer or `nil` to indicate the beginning of the 28 | /// range 29 | /// - parameter end: any integer or `nil` to indicate the end of the range 30 | /// - returns: an Subsequence with content as specified by the input 31 | public subscript(start:Int?, end:Int?) -> Self.SubSequence { 32 | let (safeStart, safeEnd) = normalize( 33 | start, end: end, total: self.count as! Int) 34 | let safeStartIndex = startIndex.advancedBy( 35 | safeStart as! Self.Index.Distance) 36 | let safeEndIndex = startIndex.advancedBy( 37 | safeEnd as! Self.Index.Distance) 38 | return self[safeStartIndex.. String { 47 | let (safeStart, safeEnd) = normalize( 48 | start, end: end, total: self.characters.count) 49 | 50 | let startIndex = self.startIndex.advancedBy(safeStart) 51 | let endIndex = self.startIndex.advancedBy(safeEnd) 52 | return self[startIndex.. = ArraySlice([]) 14 | let anIntArray : [Int] = [0,1,2,3,4,5,6,7,8,9] 15 | let anIntArraySlice : ArraySlice = [0,1,2,3,4,5,6,7,8,9] 16 | let aString: String = "abcdefghijklmnopqrstuvwxyz" 17 | 18 | // MARK: Array slicing 19 | func testNormalArraySlicing() { 20 | XCTAssertEqual(anIntArray[0, anIntArray.count], anIntArraySlice, "full normal range") 21 | XCTAssertEqual(anIntArray[0, 4], ArraySlice([0,1,2,3]), "start to a normal position") 22 | XCTAssertEqual(anIntArray[4, anIntArray.count], ArraySlice([4,5,6,7,8,9]), "a normal position to end") 23 | XCTAssertEqual(anIntArray[1, 4], ArraySlice([1,2,3]), "a normal range") 24 | } 25 | 26 | func testOutOfBoundArraySlicing() { 27 | XCTAssertEqual(anIntArray[0, 100], anIntArraySlice, "start to out of bound") 28 | XCTAssertEqual(anIntArray[4, 100], ArraySlice([4,5,6,7,8,9]), "normal index to out of bound") 29 | XCTAssertEqual(anIntArray[100, 1000], ArraySlice(emptySlice), "positive out of bound to positive out of bound") 30 | XCTAssertEqual(anIntArray[-100, anIntArray.count], anIntArraySlice, "negative out of bound to the end") 31 | XCTAssertEqual(anIntArray[-100, 4], ArraySlice([0,1,2,3]), "negative out of bound to a normal position") 32 | XCTAssertEqual(anIntArray[-1000, -100], emptySlice, "negative out of bound to a normal position") 33 | XCTAssertEqual(anIntArray[-1000, 1000], anIntArraySlice, "negative out of bound to positive out of bound") 34 | } 35 | 36 | func testArraySlicingWithNormalNegativeBounds() { 37 | XCTAssertEqual(anIntArray[0, -6], ArraySlice([0,1,2,3]), "start to in-bound negative index") 38 | XCTAssertEqual(anIntArray[-6, anIntArray.count], ArraySlice([4,5,6,7,8,9]), "in-bound negative index to the end") 39 | XCTAssertEqual(anIntArray[-6, -4], ArraySlice([4,5]), "two in-bound negative indexes") 40 | } 41 | 42 | func testArraySlicingWithOutOfOrderBounds() { 43 | XCTAssertEqual(anIntArray[6, 4], emptySlice, "from a bigger positive index to a smaller positive index") 44 | XCTAssertEqual(anIntArray[-4, -6], emptySlice, "from a bigger negative index to a smaller negative index") 45 | } 46 | 47 | func testArraySlicingWithEqualStartAndEndIndex() { 48 | XCTAssertEqual(anIntArray[0, 0], emptySlice, "(0,0)") 49 | let length = anIntArray.count 50 | XCTAssertEqual(anIntArray[length, length], emptySlice, "(\(length), \(length)) - end position") 51 | XCTAssertEqual(anIntArray[100, 100], emptySlice, "(100,100) - out of bound range indexes") 52 | XCTAssertEqual(anIntArray[4, 4], emptySlice, "(4,4) - normal range") 53 | XCTAssertEqual(anIntArray[-4, -4], emptySlice, "(-4,-4) - normal range by negative indexes") 54 | XCTAssertEqual(anIntArray[-100, -100], emptySlice, "(-100,-100) - out of bound range by negative indexes") 55 | } 56 | 57 | func testArraySlicingWithNilInput() { 58 | let length = anIntArray.count 59 | XCTAssertEqual(anIntArray[nil, nil], anIntArraySlice, "two nils") 60 | XCTAssertEqual(anIntArray[0, nil], anIntArraySlice, "start to nil") 61 | XCTAssertEqual(anIntArray[nil, length], anIntArraySlice, "nil to end") 62 | XCTAssertEqual(anIntArray[4, nil], ArraySlice([4,5,6,7,8,9]), "nil to end") 63 | XCTAssertEqual(anIntArray[nil, 4], ArraySlice([0,1,2,3]), "nil to end") 64 | } 65 | 66 | // MARK: ArraySlice slicing 67 | func testNormalArraySliceSlicing() { 68 | XCTAssertEqual(anIntArraySlice[0, anIntArray.count], anIntArraySlice, "full normal range") 69 | XCTAssertEqual(anIntArraySlice[0, 4], ArraySlice([0,1,2,3]), "start to a normal position") 70 | XCTAssertEqual(anIntArraySlice[4, anIntArray.count], ArraySlice([4,5,6,7,8,9]), "a normal position to end") 71 | XCTAssertEqual(anIntArraySlice[1, 4], ArraySlice([1,2,3]), "a normal range") 72 | } 73 | 74 | func testOutOfBoundArraySliceSliceSlicing() { 75 | XCTAssertEqual(anIntArraySlice[0, 100], anIntArraySlice, "start to out of bound") 76 | XCTAssertEqual(anIntArraySlice[4, 100], ArraySlice([4,5,6,7,8,9]), "normal index to out of bound") 77 | XCTAssertEqual(anIntArraySlice[100, 1000], ArraySlice(emptySlice), "positive out of bound to positive out of bound") 78 | XCTAssertEqual(anIntArraySlice[-100, anIntArray.count], anIntArraySlice, "negative out of bound to the end") 79 | XCTAssertEqual(anIntArraySlice[-100, 4], ArraySlice([0,1,2,3]), "negative out of bound to a normal position") 80 | XCTAssertEqual(anIntArraySlice[-1000, -100], emptySlice, "negative out of bound to a normal position") 81 | XCTAssertEqual(anIntArraySlice[-1000, 1000], anIntArraySlice, "negative out of bound to positive out of bound") 82 | } 83 | 84 | func testArraySliceSlicingWitSlicehNormalNegativeBounds() { 85 | XCTAssertEqual(anIntArraySlice[0, -6], ArraySlice([0,1,2,3]), "start to in-bound negative index") 86 | XCTAssertEqual(anIntArraySlice[-6, anIntArray.count], ArraySlice([4,5,6,7,8,9]), "in-bound negative index to the end") 87 | XCTAssertEqual(anIntArraySlice[-6, -4], ArraySlice([4,5]), "two in-bound negative indexes") 88 | } 89 | 90 | func testArraySliceSlicingWitSlicehOutOfOrderBounds() { 91 | XCTAssertEqual(anIntArraySlice[6, 4], emptySlice, "from a bigger positive index to a smaller positive index") 92 | XCTAssertEqual(anIntArraySlice[-4, -6], emptySlice, "from a bigger negative index to a smaller negative index") 93 | } 94 | 95 | func testArraySliceSlicingWitSlicehEqualStartAndEndIndex() { 96 | XCTAssertEqual(anIntArraySlice[0, 0], emptySlice, "(0,0)") 97 | let length = anIntArraySlice.count 98 | XCTAssertEqual(anIntArraySlice[length, length], emptySlice, "(\(length), \(length)) - end position") 99 | XCTAssertEqual(anIntArraySlice[100, 100], emptySlice, "(100,100) - out of bound range indexes") 100 | XCTAssertEqual(anIntArraySlice[4, 4], emptySlice, "(4,4) - normal range") 101 | XCTAssertEqual(anIntArraySlice[-4, -4], emptySlice, "(-4,-4) - normal range by negative indexes") 102 | XCTAssertEqual(anIntArraySlice[-100, -100], emptySlice, "(-100,-100) - out of bound range by negative indexes") 103 | } 104 | 105 | // MARK: string slicing 106 | func testNormalStringSlicing() { 107 | let length = aString.characters.count 108 | XCTAssertEqual(aString[0, length], aString, "full normal range") 109 | XCTAssertEqual(aString[0, 4], "abcd", "start to a normal position") 110 | XCTAssertEqual(aString[4, length], "efghijklmnopqrstuvwxyz", "a normal position to end") 111 | XCTAssertEqual(aString[1, 4], "bcd", "a normal range") 112 | } 113 | 114 | func testOutOfBoundStringSlicing() { 115 | let length = aString.characters.count 116 | XCTAssertEqual(aString[0, 100], aString, "start to out of bound") 117 | XCTAssertEqual(aString[4, 100], "efghijklmnopqrstuvwxyz", "normal index to out of bound") 118 | XCTAssertEqual(aString[100, 1000], "", "positive out of bound to positive out of bound") 119 | XCTAssertEqual(aString[-100, length], aString, "negative out of bound to the end") 120 | XCTAssertEqual(aString[-100, 4], "abcd", "negative out of bound to a normal position") 121 | XCTAssertEqual(aString[-1000, -100], "", "negative out of bound to a normal position") 122 | XCTAssertEqual(aString[-1000, 1000], aString, "negative out of bound to positive out of bound") 123 | } 124 | 125 | func testStringSlicingWithNormalNegativeBounds() { 126 | let length = aString.characters.count 127 | XCTAssertEqual(aString[0, -6], "abcdefghijklmnopqrst", "start to in-bound negative index") 128 | XCTAssertEqual(aString[-6, length], "uvwxyz", "in-bound negative index to the end") 129 | XCTAssertEqual(aString[-6, -4], "uv", "two in-bound negative indexes") 130 | } 131 | 132 | func testStringSlicingWithOutOfOrderBounds() { 133 | XCTAssertEqual(aString[6, 4], "", "from a bigger positive index to a smaller positive index") 134 | XCTAssertEqual(aString[-4, -6], "", "from a bigger negative index to a smaller negative index") 135 | } 136 | 137 | func testStringSlicingWithEqualStartAndEndIndex() { 138 | let length = aString.characters.count 139 | XCTAssertEqual(aString[0, 0], "", "(0,0)") 140 | XCTAssertEqual(aString[length, length], "", "(\(length), \(length)) - end position") 141 | XCTAssertEqual(aString[100, 100], "", "(100,100) - out of bound range indexes") 142 | XCTAssertEqual(aString[4, 4], "", "(4,4) - normal range") 143 | XCTAssertEqual(aString[-4, -4], "", "(-4,-4) - normal range by negative indexes") 144 | XCTAssertEqual(aString[-100, -100], "", "(-100,-100) - out of bound range by negative indexes") 145 | } 146 | } 147 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Lic - easy, safe object slicing for Swift 2 | 3 | 4 | ## Summary 5 | *Lic* is a μ-framework that makes getting slices of arrays and strings in Swift 2 safe and easy: 6 | 7 | ```swift 8 | [0,1,2,3][1, -1] // => ArraySlice([1, 2]) 9 | "Hello"[-1000, nil] // => "Hello" 10 | [1,2,3,4,5,6,7,8][1,5][2,3] // => ArraySlice([4]) 11 | ``` 12 | 13 | *Lic* has no dependencies, not even `Foundation`. 14 | 15 | ## Range Free Slices 16 | 17 | To make a slice, you must give two indexes, indicating the start and end positions where the slice will be produced. 18 | *Lic* tries to make sense of the indexes following these rules: 19 | 20 | * a negative index indicates a position counted in the reverse direction 21 | * `nil` is equivalent to the start or end index 22 | * an out-of-bound index is treated as the same as start or end index, depending on which bound it goes beyond 23 | * if the start index ends up at a position after the end index, *Lic* returns the empty value 24 | 25 | When it comes to slicing, your ranges are always safe and accepted. 26 | 27 | ## Install 28 | 29 | ### Carthage 30 | 31 | github "dduan/Lic" 32 | 33 | ### CocoaPods 34 | 35 | platform :ios, '8.0' 36 | use_frameworks! 37 | 38 | target 'MyApp' do 39 | pod 'Lic' 40 | end 41 | 42 | ### Source File 43 | Include the single source file in your project. 44 | 45 | (There's no dependencies at all). 46 | 47 | ## What kind of name is "Lic"? 48 | 49 | It's `"slice"[1,-1]` - a slice of the word "slice", you know, what *Lic* produces. 50 | 51 | ## License 52 | 53 | BSD, see [LICENSE](https://github.com/dduan/Lic/blob/master/LICENSE) 54 | --------------------------------------------------------------------------------