├── .github ├── FUNDING.yml └── auto_assign-issues.yml ├── .gitignore ├── Example ├── Example.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── Example.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── Example │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ ├── Contents.json │ │ ├── background.imageset │ │ │ ├── Contents.json │ │ │ ├── maxresdefault-1.jpg │ │ │ ├── maxresdefault-2.jpg │ │ │ └── maxresdefault.jpg │ │ ├── icon1.imageset │ │ │ ├── Contents.json │ │ │ ├── s-1.png │ │ │ ├── s-2.png │ │ │ └── s.png │ │ ├── icon2.imageset │ │ │ ├── Contents.json │ │ │ ├── t-1.png │ │ │ ├── t-2.png │ │ │ └── t.png │ │ ├── icon3.imageset │ │ │ ├── Contents.json │ │ │ ├── o-1.png │ │ │ ├── o-2.png │ │ │ └── o.png │ │ └── icon4.imageset │ │ │ ├── Contents.json │ │ │ ├── x-1.png │ │ │ ├── x-2.png │ │ │ └── x.png │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Info.plist │ └── ViewController.swift ├── Podfile ├── Podfile.lock └── Pods │ ├── Headers │ └── Public │ │ └── SliceControl │ │ ├── SliceControl-umbrella.h │ │ └── SliceControl.modulemap │ ├── Local Podspecs │ ├── Constrictor.podspec.json │ ├── Fluky.podspec.json │ └── SliceControl.podspec.json │ ├── Manifest.lock │ ├── Pods.xcodeproj │ └── project.pbxproj │ └── Target Support Files │ ├── Pods-Example │ ├── Info.plist │ ├── Pods-Example-acknowledgements.markdown │ ├── Pods-Example-acknowledgements.plist │ ├── Pods-Example-dummy.m │ ├── Pods-Example-frameworks.sh │ ├── Pods-Example-resources.sh │ ├── Pods-Example-umbrella.h │ ├── Pods-Example.debug.xcconfig │ ├── Pods-Example.modulemap │ └── Pods-Example.release.xcconfig │ └── SliceControl │ ├── SliceControl-dummy.m │ ├── SliceControl-prefix.pch │ ├── SliceControl-umbrella.h │ ├── SliceControl.modulemap │ └── SliceControl.xcconfig ├── LICENSE ├── Package.swift ├── README.md ├── SliceControl.podspec ├── SliceControl.xcodeproj ├── project.pbxproj └── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── SliceControl ├── Core │ ├── SliceControl.swift │ └── SliceControlDelegate.swift ├── Extensions │ ├── Anchor.swift │ ├── Collection+Clamp.swift │ ├── NSObject+Create.swift │ ├── UIEdgeInsets+Init.swift │ ├── UILabel+Init.swift │ ├── UIStackView+Add.swift │ ├── UIView+Add.swift │ └── UIView+Rounded.swift └── Info.plist └── logo.gif /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: pedrommcarrasco 2 | custom: ['https://www.buymeacoffee.com/pedrommcarrasco', 'https://www.paypal.me/pedrommcarrasco'] 3 | -------------------------------------------------------------------------------- /.github/auto_assign-issues.yml: -------------------------------------------------------------------------------- 1 | # If enabled, auto-assigns users when a new issue is created 2 | # Defaults to true, allows you to install the app globally, and disable on a per-repo basis 3 | addAssignees: true 4 | 5 | # The list of users to assign to new issues. 6 | # If empty or not provided, the repository owner is assigned 7 | assignees: 8 | - pedrommcarrasco 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | ## Playgrounds 32 | timeline.xctimeline 33 | playground.xcworkspace 34 | 35 | # Swift Package Manager 36 | # 37 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 38 | # Packages/ 39 | # Package.pins 40 | # Package.resolved 41 | .build/ 42 | 43 | # CocoaPods 44 | # 45 | # We recommend against adding the Pods directory to your .gitignore. However 46 | # you should judge for yourself, the pros and cons are mentioned at: 47 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 48 | # 49 | # Pods/ 50 | 51 | # Carthage 52 | # 53 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 54 | # Carthage/Checkouts 55 | 56 | Carthage/Build 57 | 58 | # fastlane 59 | # 60 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 61 | # screenshots whenever they are needed. 62 | # For more information about the recommended setup visit: 63 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 64 | 65 | fastlane/report.xml 66 | fastlane/Preview.html 67 | fastlane/screenshots/**/*.png 68 | fastlane/test_output 69 | 70 | \.DS_Store 71 | -------------------------------------------------------------------------------- /Example/Example.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 203559FA20B371B900A82EB8 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 203559F920B371B900A82EB8 /* AppDelegate.swift */; }; 11 | 203559FC20B371B900A82EB8 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 203559FB20B371B900A82EB8 /* ViewController.swift */; }; 12 | 203559FF20B371B900A82EB8 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 203559FD20B371B900A82EB8 /* Main.storyboard */; }; 13 | 20355A0120B371BB00A82EB8 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 20355A0020B371BB00A82EB8 /* Assets.xcassets */; }; 14 | 20355A0420B371BB00A82EB8 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 20355A0220B371BB00A82EB8 /* LaunchScreen.storyboard */; }; 15 | 8ECA734855E07CD56060EDE9 /* libPods-Example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F9164658DAF9914261ECF13F /* libPods-Example.a */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXFileReference section */ 19 | 203559F620B371B900A82EB8 /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 20 | 203559F920B371B900A82EB8 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 21 | 203559FB20B371B900A82EB8 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 22 | 203559FE20B371B900A82EB8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 23 | 20355A0020B371BB00A82EB8 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 24 | 20355A0320B371BB00A82EB8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 25 | 20355A0520B371BB00A82EB8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 26 | 68C87651C3AC19C7DB6EDE86 /* Pods-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig"; sourceTree = ""; }; 27 | 810D2625B22C3D585D7157A4 /* Pods-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-Example/Pods-Example.release.xcconfig"; sourceTree = ""; }; 28 | F9164658DAF9914261ECF13F /* libPods-Example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Example.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 29 | /* End PBXFileReference section */ 30 | 31 | /* Begin PBXFrameworksBuildPhase section */ 32 | 203559F320B371B900A82EB8 /* Frameworks */ = { 33 | isa = PBXFrameworksBuildPhase; 34 | buildActionMask = 2147483647; 35 | files = ( 36 | 8ECA734855E07CD56060EDE9 /* libPods-Example.a in Frameworks */, 37 | ); 38 | runOnlyForDeploymentPostprocessing = 0; 39 | }; 40 | /* End PBXFrameworksBuildPhase section */ 41 | 42 | /* Begin PBXGroup section */ 43 | 1971680AD76A225740D46043 /* Pods */ = { 44 | isa = PBXGroup; 45 | children = ( 46 | 68C87651C3AC19C7DB6EDE86 /* Pods-Example.debug.xcconfig */, 47 | 810D2625B22C3D585D7157A4 /* Pods-Example.release.xcconfig */, 48 | ); 49 | name = Pods; 50 | sourceTree = ""; 51 | }; 52 | 203559ED20B371B900A82EB8 = { 53 | isa = PBXGroup; 54 | children = ( 55 | 203559F820B371B900A82EB8 /* Example */, 56 | 203559F720B371B900A82EB8 /* Products */, 57 | 1971680AD76A225740D46043 /* Pods */, 58 | 46412AEAB7B7DE7CAF1E120E /* Frameworks */, 59 | ); 60 | sourceTree = ""; 61 | }; 62 | 203559F720B371B900A82EB8 /* Products */ = { 63 | isa = PBXGroup; 64 | children = ( 65 | 203559F620B371B900A82EB8 /* Example.app */, 66 | ); 67 | name = Products; 68 | sourceTree = ""; 69 | }; 70 | 203559F820B371B900A82EB8 /* Example */ = { 71 | isa = PBXGroup; 72 | children = ( 73 | 203559F920B371B900A82EB8 /* AppDelegate.swift */, 74 | 203559FB20B371B900A82EB8 /* ViewController.swift */, 75 | 203559FD20B371B900A82EB8 /* Main.storyboard */, 76 | 20355A0020B371BB00A82EB8 /* Assets.xcassets */, 77 | 20355A0220B371BB00A82EB8 /* LaunchScreen.storyboard */, 78 | 20355A0520B371BB00A82EB8 /* Info.plist */, 79 | ); 80 | path = Example; 81 | sourceTree = ""; 82 | }; 83 | 46412AEAB7B7DE7CAF1E120E /* Frameworks */ = { 84 | isa = PBXGroup; 85 | children = ( 86 | F9164658DAF9914261ECF13F /* libPods-Example.a */, 87 | ); 88 | name = Frameworks; 89 | sourceTree = ""; 90 | }; 91 | /* End PBXGroup section */ 92 | 93 | /* Begin PBXNativeTarget section */ 94 | 203559F520B371B900A82EB8 /* Example */ = { 95 | isa = PBXNativeTarget; 96 | buildConfigurationList = 20355A0820B371BB00A82EB8 /* Build configuration list for PBXNativeTarget "Example" */; 97 | buildPhases = ( 98 | E3BE9F3FF71AE0B9786F4AD0 /* [CP] Check Pods Manifest.lock */, 99 | 203559F220B371B900A82EB8 /* Sources */, 100 | 203559F320B371B900A82EB8 /* Frameworks */, 101 | 203559F420B371B900A82EB8 /* Resources */, 102 | ); 103 | buildRules = ( 104 | ); 105 | dependencies = ( 106 | ); 107 | name = Example; 108 | productName = Example; 109 | productReference = 203559F620B371B900A82EB8 /* Example.app */; 110 | productType = "com.apple.product-type.application"; 111 | }; 112 | /* End PBXNativeTarget section */ 113 | 114 | /* Begin PBXProject section */ 115 | 203559EE20B371B900A82EB8 /* Project object */ = { 116 | isa = PBXProject; 117 | attributes = { 118 | LastSwiftUpdateCheck = 0930; 119 | LastUpgradeCheck = 0930; 120 | ORGANIZATIONNAME = "Pedro Carrasco"; 121 | TargetAttributes = { 122 | 203559F520B371B900A82EB8 = { 123 | CreatedOnToolsVersion = 9.3; 124 | LastSwiftMigration = 1000; 125 | }; 126 | }; 127 | }; 128 | buildConfigurationList = 203559F120B371B900A82EB8 /* Build configuration list for PBXProject "Example" */; 129 | compatibilityVersion = "Xcode 9.3"; 130 | developmentRegion = en; 131 | hasScannedForEncodings = 0; 132 | knownRegions = ( 133 | en, 134 | Base, 135 | ); 136 | mainGroup = 203559ED20B371B900A82EB8; 137 | productRefGroup = 203559F720B371B900A82EB8 /* Products */; 138 | projectDirPath = ""; 139 | projectRoot = ""; 140 | targets = ( 141 | 203559F520B371B900A82EB8 /* Example */, 142 | ); 143 | }; 144 | /* End PBXProject section */ 145 | 146 | /* Begin PBXResourcesBuildPhase section */ 147 | 203559F420B371B900A82EB8 /* Resources */ = { 148 | isa = PBXResourcesBuildPhase; 149 | buildActionMask = 2147483647; 150 | files = ( 151 | 20355A0420B371BB00A82EB8 /* LaunchScreen.storyboard in Resources */, 152 | 20355A0120B371BB00A82EB8 /* Assets.xcassets in Resources */, 153 | 203559FF20B371B900A82EB8 /* Main.storyboard in Resources */, 154 | ); 155 | runOnlyForDeploymentPostprocessing = 0; 156 | }; 157 | /* End PBXResourcesBuildPhase section */ 158 | 159 | /* Begin PBXShellScriptBuildPhase section */ 160 | E3BE9F3FF71AE0B9786F4AD0 /* [CP] Check Pods Manifest.lock */ = { 161 | isa = PBXShellScriptBuildPhase; 162 | buildActionMask = 2147483647; 163 | files = ( 164 | ); 165 | inputPaths = ( 166 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 167 | "${PODS_ROOT}/Manifest.lock", 168 | ); 169 | name = "[CP] Check Pods Manifest.lock"; 170 | outputPaths = ( 171 | "$(DERIVED_FILE_DIR)/Pods-Example-checkManifestLockResult.txt", 172 | ); 173 | runOnlyForDeploymentPostprocessing = 0; 174 | shellPath = /bin/sh; 175 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 176 | showEnvVarsInLog = 0; 177 | }; 178 | /* End PBXShellScriptBuildPhase section */ 179 | 180 | /* Begin PBXSourcesBuildPhase section */ 181 | 203559F220B371B900A82EB8 /* Sources */ = { 182 | isa = PBXSourcesBuildPhase; 183 | buildActionMask = 2147483647; 184 | files = ( 185 | 203559FC20B371B900A82EB8 /* ViewController.swift in Sources */, 186 | 203559FA20B371B900A82EB8 /* AppDelegate.swift in Sources */, 187 | ); 188 | runOnlyForDeploymentPostprocessing = 0; 189 | }; 190 | /* End PBXSourcesBuildPhase section */ 191 | 192 | /* Begin PBXVariantGroup section */ 193 | 203559FD20B371B900A82EB8 /* Main.storyboard */ = { 194 | isa = PBXVariantGroup; 195 | children = ( 196 | 203559FE20B371B900A82EB8 /* Base */, 197 | ); 198 | name = Main.storyboard; 199 | sourceTree = ""; 200 | }; 201 | 20355A0220B371BB00A82EB8 /* LaunchScreen.storyboard */ = { 202 | isa = PBXVariantGroup; 203 | children = ( 204 | 20355A0320B371BB00A82EB8 /* Base */, 205 | ); 206 | name = LaunchScreen.storyboard; 207 | sourceTree = ""; 208 | }; 209 | /* End PBXVariantGroup section */ 210 | 211 | /* Begin XCBuildConfiguration section */ 212 | 20355A0620B371BB00A82EB8 /* Debug */ = { 213 | isa = XCBuildConfiguration; 214 | buildSettings = { 215 | ALWAYS_SEARCH_USER_PATHS = NO; 216 | CLANG_ANALYZER_NONNULL = YES; 217 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 218 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 219 | CLANG_CXX_LIBRARY = "libc++"; 220 | CLANG_ENABLE_MODULES = YES; 221 | CLANG_ENABLE_OBJC_ARC = YES; 222 | CLANG_ENABLE_OBJC_WEAK = YES; 223 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 224 | CLANG_WARN_BOOL_CONVERSION = YES; 225 | CLANG_WARN_COMMA = YES; 226 | CLANG_WARN_CONSTANT_CONVERSION = YES; 227 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 228 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 229 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 230 | CLANG_WARN_EMPTY_BODY = YES; 231 | CLANG_WARN_ENUM_CONVERSION = YES; 232 | CLANG_WARN_INFINITE_RECURSION = YES; 233 | CLANG_WARN_INT_CONVERSION = YES; 234 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 235 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 236 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 237 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 238 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 239 | CLANG_WARN_STRICT_PROTOTYPES = YES; 240 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 241 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 242 | CLANG_WARN_UNREACHABLE_CODE = YES; 243 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 244 | CODE_SIGN_IDENTITY = "iPhone Developer"; 245 | COPY_PHASE_STRIP = NO; 246 | DEBUG_INFORMATION_FORMAT = dwarf; 247 | ENABLE_STRICT_OBJC_MSGSEND = YES; 248 | ENABLE_TESTABILITY = YES; 249 | GCC_C_LANGUAGE_STANDARD = gnu11; 250 | GCC_DYNAMIC_NO_PIC = NO; 251 | GCC_NO_COMMON_BLOCKS = YES; 252 | GCC_OPTIMIZATION_LEVEL = 0; 253 | GCC_PREPROCESSOR_DEFINITIONS = ( 254 | "DEBUG=1", 255 | "$(inherited)", 256 | ); 257 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 258 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 259 | GCC_WARN_UNDECLARED_SELECTOR = YES; 260 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 261 | GCC_WARN_UNUSED_FUNCTION = YES; 262 | GCC_WARN_UNUSED_VARIABLE = YES; 263 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 264 | MTL_ENABLE_DEBUG_INFO = YES; 265 | ONLY_ACTIVE_ARCH = YES; 266 | SDKROOT = iphoneos; 267 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 268 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 269 | SWIFT_VERSION = 4.2; 270 | }; 271 | name = Debug; 272 | }; 273 | 20355A0720B371BB00A82EB8 /* Release */ = { 274 | isa = XCBuildConfiguration; 275 | buildSettings = { 276 | ALWAYS_SEARCH_USER_PATHS = NO; 277 | CLANG_ANALYZER_NONNULL = YES; 278 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 279 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 280 | CLANG_CXX_LIBRARY = "libc++"; 281 | CLANG_ENABLE_MODULES = YES; 282 | CLANG_ENABLE_OBJC_ARC = YES; 283 | CLANG_ENABLE_OBJC_WEAK = YES; 284 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 285 | CLANG_WARN_BOOL_CONVERSION = YES; 286 | CLANG_WARN_COMMA = YES; 287 | CLANG_WARN_CONSTANT_CONVERSION = YES; 288 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 289 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 290 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 291 | CLANG_WARN_EMPTY_BODY = YES; 292 | CLANG_WARN_ENUM_CONVERSION = YES; 293 | CLANG_WARN_INFINITE_RECURSION = YES; 294 | CLANG_WARN_INT_CONVERSION = YES; 295 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 296 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 297 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 298 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 299 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 300 | CLANG_WARN_STRICT_PROTOTYPES = YES; 301 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 302 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 303 | CLANG_WARN_UNREACHABLE_CODE = YES; 304 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 305 | CODE_SIGN_IDENTITY = "iPhone Developer"; 306 | COPY_PHASE_STRIP = NO; 307 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 308 | ENABLE_NS_ASSERTIONS = NO; 309 | ENABLE_STRICT_OBJC_MSGSEND = YES; 310 | GCC_C_LANGUAGE_STANDARD = gnu11; 311 | GCC_NO_COMMON_BLOCKS = YES; 312 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 313 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 314 | GCC_WARN_UNDECLARED_SELECTOR = YES; 315 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 316 | GCC_WARN_UNUSED_FUNCTION = YES; 317 | GCC_WARN_UNUSED_VARIABLE = YES; 318 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 319 | MTL_ENABLE_DEBUG_INFO = NO; 320 | SDKROOT = iphoneos; 321 | SWIFT_COMPILATION_MODE = wholemodule; 322 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 323 | SWIFT_VERSION = 4.2; 324 | VALIDATE_PRODUCT = YES; 325 | }; 326 | name = Release; 327 | }; 328 | 20355A0920B371BB00A82EB8 /* Debug */ = { 329 | isa = XCBuildConfiguration; 330 | baseConfigurationReference = 68C87651C3AC19C7DB6EDE86 /* Pods-Example.debug.xcconfig */; 331 | buildSettings = { 332 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 333 | CODE_SIGN_STYLE = Automatic; 334 | DEVELOPMENT_TEAM = 7GE4Q65N57; 335 | INFOPLIST_FILE = Example/Info.plist; 336 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 337 | LD_RUNPATH_SEARCH_PATHS = ( 338 | "$(inherited)", 339 | "@executable_path/Frameworks", 340 | ); 341 | PRODUCT_BUNDLE_IDENTIFIER = pedrommcarrasco.Example; 342 | PRODUCT_NAME = "$(TARGET_NAME)"; 343 | SWIFT_VERSION = 4.0; 344 | TARGETED_DEVICE_FAMILY = "1,2"; 345 | }; 346 | name = Debug; 347 | }; 348 | 20355A0A20B371BB00A82EB8 /* Release */ = { 349 | isa = XCBuildConfiguration; 350 | baseConfigurationReference = 810D2625B22C3D585D7157A4 /* Pods-Example.release.xcconfig */; 351 | buildSettings = { 352 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 353 | CODE_SIGN_STYLE = Automatic; 354 | DEVELOPMENT_TEAM = 7GE4Q65N57; 355 | INFOPLIST_FILE = Example/Info.plist; 356 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 357 | LD_RUNPATH_SEARCH_PATHS = ( 358 | "$(inherited)", 359 | "@executable_path/Frameworks", 360 | ); 361 | PRODUCT_BUNDLE_IDENTIFIER = pedrommcarrasco.Example; 362 | PRODUCT_NAME = "$(TARGET_NAME)"; 363 | SWIFT_VERSION = 4.0; 364 | TARGETED_DEVICE_FAMILY = "1,2"; 365 | }; 366 | name = Release; 367 | }; 368 | /* End XCBuildConfiguration section */ 369 | 370 | /* Begin XCConfigurationList section */ 371 | 203559F120B371B900A82EB8 /* Build configuration list for PBXProject "Example" */ = { 372 | isa = XCConfigurationList; 373 | buildConfigurations = ( 374 | 20355A0620B371BB00A82EB8 /* Debug */, 375 | 20355A0720B371BB00A82EB8 /* Release */, 376 | ); 377 | defaultConfigurationIsVisible = 0; 378 | defaultConfigurationName = Release; 379 | }; 380 | 20355A0820B371BB00A82EB8 /* Build configuration list for PBXNativeTarget "Example" */ = { 381 | isa = XCConfigurationList; 382 | buildConfigurations = ( 383 | 20355A0920B371BB00A82EB8 /* Debug */, 384 | 20355A0A20B371BB00A82EB8 /* Release */, 385 | ); 386 | defaultConfigurationIsVisible = 0; 387 | defaultConfigurationName = Release; 388 | }; 389 | /* End XCConfigurationList section */ 390 | }; 391 | rootObject = 203559EE20B371B900A82EB8 /* Project object */; 392 | } 393 | -------------------------------------------------------------------------------- /Example/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/Example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/Example.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/Example.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/Example/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // Example 4 | // 5 | // Created by Pedro Carrasco on 21/05/2018. 6 | // Copyright © 2018 Pedro Carrasco. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 24 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /Example/Example/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /Example/Example/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Example/Example/Assets.xcassets/background.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "maxresdefault-1.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "maxresdefault.jpg", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "maxresdefault-2.jpg", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Example/Example/Assets.xcassets/background.imageset/maxresdefault-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pedrommcarrasco/SliceControl/de2a54d25b85b13ae8c10730e4e58638803b0353/Example/Example/Assets.xcassets/background.imageset/maxresdefault-1.jpg -------------------------------------------------------------------------------- /Example/Example/Assets.xcassets/background.imageset/maxresdefault-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pedrommcarrasco/SliceControl/de2a54d25b85b13ae8c10730e4e58638803b0353/Example/Example/Assets.xcassets/background.imageset/maxresdefault-2.jpg -------------------------------------------------------------------------------- /Example/Example/Assets.xcassets/background.imageset/maxresdefault.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pedrommcarrasco/SliceControl/de2a54d25b85b13ae8c10730e4e58638803b0353/Example/Example/Assets.xcassets/background.imageset/maxresdefault.jpg -------------------------------------------------------------------------------- /Example/Example/Assets.xcassets/icon1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "s.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "s-1.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "s-2.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Example/Example/Assets.xcassets/icon1.imageset/s-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pedrommcarrasco/SliceControl/de2a54d25b85b13ae8c10730e4e58638803b0353/Example/Example/Assets.xcassets/icon1.imageset/s-1.png -------------------------------------------------------------------------------- /Example/Example/Assets.xcassets/icon1.imageset/s-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pedrommcarrasco/SliceControl/de2a54d25b85b13ae8c10730e4e58638803b0353/Example/Example/Assets.xcassets/icon1.imageset/s-2.png -------------------------------------------------------------------------------- /Example/Example/Assets.xcassets/icon1.imageset/s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pedrommcarrasco/SliceControl/de2a54d25b85b13ae8c10730e4e58638803b0353/Example/Example/Assets.xcassets/icon1.imageset/s.png -------------------------------------------------------------------------------- /Example/Example/Assets.xcassets/icon2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "t.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "t-1.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "t-2.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Example/Example/Assets.xcassets/icon2.imageset/t-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pedrommcarrasco/SliceControl/de2a54d25b85b13ae8c10730e4e58638803b0353/Example/Example/Assets.xcassets/icon2.imageset/t-1.png -------------------------------------------------------------------------------- /Example/Example/Assets.xcassets/icon2.imageset/t-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pedrommcarrasco/SliceControl/de2a54d25b85b13ae8c10730e4e58638803b0353/Example/Example/Assets.xcassets/icon2.imageset/t-2.png -------------------------------------------------------------------------------- /Example/Example/Assets.xcassets/icon2.imageset/t.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pedrommcarrasco/SliceControl/de2a54d25b85b13ae8c10730e4e58638803b0353/Example/Example/Assets.xcassets/icon2.imageset/t.png -------------------------------------------------------------------------------- /Example/Example/Assets.xcassets/icon3.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "o.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "o-1.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "o-2.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Example/Example/Assets.xcassets/icon3.imageset/o-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pedrommcarrasco/SliceControl/de2a54d25b85b13ae8c10730e4e58638803b0353/Example/Example/Assets.xcassets/icon3.imageset/o-1.png -------------------------------------------------------------------------------- /Example/Example/Assets.xcassets/icon3.imageset/o-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pedrommcarrasco/SliceControl/de2a54d25b85b13ae8c10730e4e58638803b0353/Example/Example/Assets.xcassets/icon3.imageset/o-2.png -------------------------------------------------------------------------------- /Example/Example/Assets.xcassets/icon3.imageset/o.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pedrommcarrasco/SliceControl/de2a54d25b85b13ae8c10730e4e58638803b0353/Example/Example/Assets.xcassets/icon3.imageset/o.png -------------------------------------------------------------------------------- /Example/Example/Assets.xcassets/icon4.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "x.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "x-1.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "x-2.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Example/Example/Assets.xcassets/icon4.imageset/x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pedrommcarrasco/SliceControl/de2a54d25b85b13ae8c10730e4e58638803b0353/Example/Example/Assets.xcassets/icon4.imageset/x-1.png -------------------------------------------------------------------------------- /Example/Example/Assets.xcassets/icon4.imageset/x-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pedrommcarrasco/SliceControl/de2a54d25b85b13ae8c10730e4e58638803b0353/Example/Example/Assets.xcassets/icon4.imageset/x-2.png -------------------------------------------------------------------------------- /Example/Example/Assets.xcassets/icon4.imageset/x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pedrommcarrasco/SliceControl/de2a54d25b85b13ae8c10730e4e58638803b0353/Example/Example/Assets.xcassets/icon4.imageset/x.png -------------------------------------------------------------------------------- /Example/Example/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Example/Example/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Example/Example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /Example/Example/ViewController.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import SliceControl 3 | 4 | class ViewController: UIViewController { 5 | 6 | var sliceControl: SliceControl! 7 | var sliceControl2: SliceControl! 8 | var sliceControl3: SliceControl! 9 | var sliceControl4: SliceControl! 10 | 11 | override func viewDidLoad() { 12 | super.viewDidLoad() 13 | 14 | navigationController?.navigationBar.isHidden = true 15 | view.backgroundColor = .white 16 | 17 | sliceControl = SliceControl(with: ["S", "L", "I"], 18 | primaryColor: UIColor(red:0.16, green:0.16, blue:0.15, alpha:1.0), 19 | secondaryColor: UIColor(red:0.99, green:0.81, blue:0.05, alpha:1.0), 20 | padding: 12, 21 | startAt: 0) 22 | 23 | view.addSubview(sliceControl) 24 | sliceControl.translatesAutoresizingMaskIntoConstraints = false 25 | 26 | NSLayoutConstraint.activate( 27 | [ 28 | sliceControl.topAnchor.constraint(equalTo: view.topAnchor, constant: 54), 29 | sliceControl.leadingAnchor.constraint(equalTo: view.leadingAnchor), 30 | sliceControl.trailingAnchor.constraint(equalTo: view.trailingAnchor), 31 | sliceControl.heightAnchor.constraint(equalToConstant: 54) 32 | ] 33 | ) 34 | 35 | 36 | sliceControl2 = SliceControl(with: ["C", "E"], 37 | primaryColor: UIColor(red:0.99, green:0.81, blue:0.05, alpha:1.0), 38 | secondaryColor: UIColor(red:0.16, green:0.16, blue:0.15, alpha:1.0), 39 | 40 | padding: 12, 41 | startAt: 0) 42 | 43 | view.addSubview(sliceControl2) 44 | sliceControl2.translatesAutoresizingMaskIntoConstraints = false 45 | 46 | NSLayoutConstraint.activate( 47 | [ 48 | sliceControl2.topAnchor.constraint(equalTo: sliceControl.bottomAnchor), 49 | sliceControl2.leadingAnchor.constraint(equalTo: view.leadingAnchor), 50 | sliceControl2.trailingAnchor.constraint(equalTo: view.trailingAnchor), 51 | sliceControl2.heightAnchor.constraint(equalToConstant: 54) 52 | ] 53 | ) 54 | 55 | sliceControl3 = SliceControl(with: ["C", "O", "N"], 56 | primaryColor: UIColor(red:0.91, green:0.95, blue:0.95, alpha:1.0), 57 | secondaryColor: UIColor(red: 0.10, green: 0.10, blue: 0.14, alpha: 1.0), 58 | padding: 12, 59 | startAt: 1) 60 | 61 | view.addSubview(sliceControl3) 62 | sliceControl3.translatesAutoresizingMaskIntoConstraints = false 63 | 64 | NSLayoutConstraint.activate( 65 | [ 66 | sliceControl3.topAnchor.constraint(equalTo: sliceControl2.bottomAnchor), 67 | sliceControl3.leadingAnchor.constraint(equalTo: view.leadingAnchor), 68 | sliceControl3.trailingAnchor.constraint(equalTo: view.trailingAnchor), 69 | sliceControl3.heightAnchor.constraint(equalToConstant: 54) 70 | ] 71 | ) 72 | 73 | sliceControl4 = SliceControl(with: ["T", "R", "O", "L"], 74 | primaryColor: UIColor(red: 0.10, green: 0.10, blue: 0.14, alpha: 1.0), 75 | secondaryColor: UIColor(red:0.91, green:0.95, blue:0.95, alpha:1.0), 76 | padding: 12, 77 | startAt: 2) 78 | 79 | view.addSubview(sliceControl4) 80 | sliceControl4.translatesAutoresizingMaskIntoConstraints = false 81 | 82 | NSLayoutConstraint.activate( 83 | [ 84 | sliceControl4.topAnchor.constraint(equalTo: sliceControl3.bottomAnchor), 85 | sliceControl4.leadingAnchor.constraint(equalTo: view.leadingAnchor), 86 | sliceControl4.trailingAnchor.constraint(equalTo: view.trailingAnchor), 87 | sliceControl4.heightAnchor.constraint(equalToConstant: 54) 88 | ] 89 | ) 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | # platform :ios, 11.0' 3 | 4 | target 'Example' do 5 | # Comment the next line if you're not using Swift and don't want to use dynamic frameworks 6 | 7 | # Pods for Example 8 | pod 'SliceControl', :path => ".." 9 | 10 | end 11 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - SliceControl (1.3.0) 3 | 4 | DEPENDENCIES: 5 | - SliceControl (from `..`) 6 | 7 | EXTERNAL SOURCES: 8 | SliceControl: 9 | :path: ".." 10 | 11 | SPEC CHECKSUMS: 12 | SliceControl: 6f4b8a068f35efdecfa00408037a434fa850cb59 13 | 14 | PODFILE CHECKSUM: 472c6bdd43948203743cec6a19ad73dd429ea8e0 15 | 16 | COCOAPODS: 1.6.0.beta.1 17 | -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/SliceControl/SliceControl-umbrella.h: -------------------------------------------------------------------------------- 1 | /Users/pedrommcarrasco/Desktop/Developer/Projects/SliceControl/Example/Pods/Target Support Files/SliceControl/SliceControl-umbrella.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/SliceControl/SliceControl.modulemap: -------------------------------------------------------------------------------- 1 | /Users/pedrommcarrasco/Desktop/Developer/Projects/SliceControl/Example/Pods/Target Support Files/SliceControl/SliceControl.modulemap -------------------------------------------------------------------------------- /Example/Pods/Local Podspecs/Constrictor.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Constrictor", 3 | "swift_version": "4.2", 4 | "version": "3.0.1", 5 | "summary": "🐍 AutoLayout's µFramework", 6 | "description": "(Boe) Constrictor's AutoLayout µFramework with the goal of simplying your constraints by reducing the amount of code you have to write.", 7 | "homepage": "https://github.com/pedrommcarrasco/Constrictor", 8 | "license": { 9 | "type": "MIT", 10 | "file": "LICENSE" 11 | }, 12 | "authors": "Pedro Carrasco", 13 | "social_media_url": "http://twitter.com/pedrommcarrasco", 14 | "platforms": { 15 | "ios": "9.0" 16 | }, 17 | "source": { 18 | "git": "https://github.com/pedrommcarrasco/Constrictor.git", 19 | "tag": "3.0.1" 20 | }, 21 | "source_files": "Constrictor/Constrictor/**/*", 22 | "exclude_files": "Constrictor/Constrictor/*.plist" 23 | } 24 | -------------------------------------------------------------------------------- /Example/Pods/Local Podspecs/Fluky.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Fluky", 3 | "swift_version": "4.2", 4 | "version": "1.0.0", 5 | "summary": "🎲 Loading based on random icons", 6 | "description": "Make every loading screen different with Fluky, your random loading screen inspired by PlayStation.", 7 | "homepage": "https://github.com/pedrommcarrasco/Fluky", 8 | "license": { 9 | "type": "MIT", 10 | "file": "LICENSE" 11 | }, 12 | "authors": "Pedro Carrasco", 13 | "social_media_url": "http://twitter.com/pedrommcarrasco", 14 | "platforms": { 15 | "ios": "9.0" 16 | }, 17 | "source": { 18 | "git": "https://github.com/pedrommcarrasco/Fluky.git", 19 | "tag": "1.0.0" 20 | }, 21 | "source_files": "Fluky/Fluky/**/*", 22 | "exclude_files": "Fluky/Fluky/*.plist" 23 | } 24 | -------------------------------------------------------------------------------- /Example/Pods/Local Podspecs/SliceControl.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "SliceControl", 3 | "swift_version": "4.2", 4 | "version": "1.3.0", 5 | "summary": "🍰 Simply a better & animated UISegmentedControl", 6 | "description": "🍰 Simply a better & animated UISegmentedControl", 7 | "homepage": "https://github.com/pedrommcarrasco/SliceControl", 8 | "license": { 9 | "type": "MIT", 10 | "file": "LICENSE" 11 | }, 12 | "authors": "Pedro Carrasco", 13 | "social_media_url": "http://twitter.com/pedrommcarrasco", 14 | "platforms": { 15 | "ios": "9.0" 16 | }, 17 | "source": { 18 | "git": "https://github.com/pedrommcarrasco/SliceControl.git", 19 | "tag": "1.3.0" 20 | }, 21 | "source_files": "SliceControl/**/*", 22 | "exclude_files": "SliceControl/*.plist" 23 | } 24 | -------------------------------------------------------------------------------- /Example/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - SliceControl (1.3.0) 3 | 4 | DEPENDENCIES: 5 | - SliceControl (from `..`) 6 | 7 | EXTERNAL SOURCES: 8 | SliceControl: 9 | :path: ".." 10 | 11 | SPEC CHECKSUMS: 12 | SliceControl: 6f4b8a068f35efdecfa00408037a434fa850cb59 13 | 14 | PODFILE CHECKSUM: 472c6bdd43948203743cec6a19ad73dd429ea8e0 15 | 16 | COCOAPODS: 1.6.0.beta.1 17 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 063BE9330204F1913A5E948871374554 /* SliceControl-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 87610A612CA86F6628C27B2B3E78E444 /* SliceControl-dummy.m */; }; 11 | 0B27795202D1C870B58DE65682AB583B /* SliceControl.swift in Sources */ = {isa = PBXBuildFile; fileRef = E611759CC0FBA8F8AF8A6E21D63AD458 /* SliceControl.swift */; }; 12 | 16CB4013B0D445D83435E6C3A096BFE8 /* Collection+Clamp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83960041B655A79A11BEDD1E8E87F703 /* Collection+Clamp.swift */; }; 13 | 40DC687349E7BB6C7E923F83C15B844B /* SliceControl-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = A3531EE26FA5C0B48B9B2A2038A0BC12 /* SliceControl-umbrella.h */; settings = {ATTRIBUTES = (Project, ); }; }; 14 | 54F0C620D9916957E93CB6C9894492EC /* NSObject+Create.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12774431979A3D83FA2B2690A42FA897 /* NSObject+Create.swift */; }; 15 | 5D74B53AEA2C6AD0E986FE4085883509 /* UIStackView+Add.swift in Sources */ = {isa = PBXBuildFile; fileRef = 22BB0A00E3F2B177CC7516E44C73264C /* UIStackView+Add.swift */; }; 16 | 64705845D0838661BCC1165AB6C02AC4 /* UILabel+Init.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9610F9704259C37330DFECD57FF4F241 /* UILabel+Init.swift */; }; 17 | 76BBDCD56973BD47192BD08842B9C8D3 /* UIView+Add.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75296E9D3EDEEC4A783EF232A5065427 /* UIView+Add.swift */; }; 18 | 8CF8BF0A917959F5616AB773B031576B /* Pods-Example-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = F8F633DEA56389DC4ED732ABBD8D8B20 /* Pods-Example-dummy.m */; }; 19 | 91C64F7FB2106F43BA1BD62E1BC81392 /* Pods-Example-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = D42D159A47DC837C70E4D53AB3E9015F /* Pods-Example-umbrella.h */; settings = {ATTRIBUTES = (Project, ); }; }; 20 | A398D2594397A344C51D57A3C123F905 /* UIView+Rounded.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F5AAA4CE2E52F184B47206054AE8629 /* UIView+Rounded.swift */; }; 21 | A5322883A426F575A3013AC94225437B /* SliceControlDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 14C3296766DAA7C7B1AB36F9F84CBCE8 /* SliceControlDelegate.swift */; }; 22 | B1DDED14E9A5F16884F5CD45070DF125 /* UIEdgeInsets+Init.swift in Sources */ = {isa = PBXBuildFile; fileRef = C165AA1A6A001A73BE43E54C0B527B13 /* UIEdgeInsets+Init.swift */; }; 23 | C8F6010A90E5FBF5900150BA8059C0EB /* Anchor.swift in Sources */ = {isa = PBXBuildFile; fileRef = DED2791EE5AB67320143D79887EF6BD1 /* Anchor.swift */; }; 24 | /* End PBXBuildFile section */ 25 | 26 | /* Begin PBXContainerItemProxy section */ 27 | CCF0F80ED0C96C6C7DF827AC7785C32D /* PBXContainerItemProxy */ = { 28 | isa = PBXContainerItemProxy; 29 | containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; 30 | proxyType = 1; 31 | remoteGlobalIDString = 481AB4A8EACFE9F04332000886CFA3E6; 32 | remoteInfo = SliceControl; 33 | }; 34 | /* End PBXContainerItemProxy section */ 35 | 36 | /* Begin PBXFileReference section */ 37 | 04239285FD8E362D816F1B1D09001D65 /* Pods-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-Example.debug.xcconfig"; sourceTree = ""; }; 38 | 105CC86DB62D7D342C7A8ED5FFCB2E08 /* SliceControl.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = SliceControl.xcconfig; sourceTree = ""; }; 39 | 12774431979A3D83FA2B2690A42FA897 /* NSObject+Create.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = "NSObject+Create.swift"; sourceTree = ""; }; 40 | 14C3296766DAA7C7B1AB36F9F84CBCE8 /* SliceControlDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SliceControlDelegate.swift; sourceTree = ""; }; 41 | 22BB0A00E3F2B177CC7516E44C73264C /* UIStackView+Add.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = "UIStackView+Add.swift"; sourceTree = ""; }; 42 | 3934CC4ED3E5E56B4560DA4444C63F20 /* Pods-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-Example.release.xcconfig"; sourceTree = ""; }; 43 | 75296E9D3EDEEC4A783EF232A5065427 /* UIView+Add.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = "UIView+Add.swift"; sourceTree = ""; }; 44 | 7DF4926C3E1FC12FDE4D4C3B2F6B10D8 /* libSliceControl.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; name = libSliceControl.a; path = libSliceControl.a; sourceTree = BUILT_PRODUCTS_DIR; }; 45 | 80F5D6764D6F0D4D838D6FEA2573494B /* Pods-Example-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-Example-acknowledgements.plist"; sourceTree = ""; }; 46 | 83960041B655A79A11BEDD1E8E87F703 /* Collection+Clamp.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = "Collection+Clamp.swift"; sourceTree = ""; }; 47 | 87610A612CA86F6628C27B2B3E78E444 /* SliceControl-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "SliceControl-dummy.m"; sourceTree = ""; }; 48 | 8906A7DD14B97F077BB5A483B0F6C732 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; path = LICENSE; sourceTree = ""; }; 49 | 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 50 | 9610F9704259C37330DFECD57FF4F241 /* UILabel+Init.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = "UILabel+Init.swift"; sourceTree = ""; }; 51 | 98879D9F9EE30273574D5ECD717966FC /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; path = README.md; sourceTree = ""; }; 52 | 9EAE4C3F7F522E179FDFCE4E3C7E299D /* libPods-Example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; name = "libPods-Example.a"; path = "libPods-Example.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 53 | 9F5AAA4CE2E52F184B47206054AE8629 /* UIView+Rounded.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = "UIView+Rounded.swift"; sourceTree = ""; }; 54 | A3531EE26FA5C0B48B9B2A2038A0BC12 /* SliceControl-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "SliceControl-umbrella.h"; sourceTree = ""; }; 55 | A7F8F9DAADAC940A6430E9F6375B1795 /* SliceControl-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "SliceControl-prefix.pch"; sourceTree = ""; }; 56 | B33ABD984166D937704E99B29A3C5598 /* Pods-Example-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-Example-acknowledgements.markdown"; sourceTree = ""; }; 57 | B8297D52B29A6075BE1936E1D97CE125 /* Pods-Example.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-Example.modulemap"; sourceTree = ""; }; 58 | C165AA1A6A001A73BE43E54C0B527B13 /* UIEdgeInsets+Init.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = "UIEdgeInsets+Init.swift"; sourceTree = ""; }; 59 | D42D159A47DC837C70E4D53AB3E9015F /* Pods-Example-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-Example-umbrella.h"; sourceTree = ""; }; 60 | D4602DB62CBF6B538F20C931708E0FED /* SliceControl.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = SliceControl.modulemap; sourceTree = ""; }; 61 | D5B80539057CE427E5E9E1AF37D20623 /* SliceControl.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; path = SliceControl.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 62 | DED2791EE5AB67320143D79887EF6BD1 /* Anchor.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Anchor.swift; sourceTree = ""; }; 63 | E611759CC0FBA8F8AF8A6E21D63AD458 /* SliceControl.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SliceControl.swift; sourceTree = ""; }; 64 | F8F633DEA56389DC4ED732ABBD8D8B20 /* Pods-Example-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-Example-dummy.m"; sourceTree = ""; }; 65 | /* End PBXFileReference section */ 66 | 67 | /* Begin PBXFrameworksBuildPhase section */ 68 | 83876CECEDD19FCB19218EE9F1FFE2DC /* Frameworks */ = { 69 | isa = PBXFrameworksBuildPhase; 70 | buildActionMask = 2147483647; 71 | files = ( 72 | ); 73 | runOnlyForDeploymentPostprocessing = 0; 74 | }; 75 | C16D6D6ED8B42D239595C3E508D0D818 /* Frameworks */ = { 76 | isa = PBXFrameworksBuildPhase; 77 | buildActionMask = 2147483647; 78 | files = ( 79 | ); 80 | runOnlyForDeploymentPostprocessing = 0; 81 | }; 82 | /* End PBXFrameworksBuildPhase section */ 83 | 84 | /* Begin PBXGroup section */ 85 | 037AE159A43E5E631B2F86CE2D6B9366 /* Pods-Example */ = { 86 | isa = PBXGroup; 87 | children = ( 88 | B8297D52B29A6075BE1936E1D97CE125 /* Pods-Example.modulemap */, 89 | B33ABD984166D937704E99B29A3C5598 /* Pods-Example-acknowledgements.markdown */, 90 | 80F5D6764D6F0D4D838D6FEA2573494B /* Pods-Example-acknowledgements.plist */, 91 | F8F633DEA56389DC4ED732ABBD8D8B20 /* Pods-Example-dummy.m */, 92 | D42D159A47DC837C70E4D53AB3E9015F /* Pods-Example-umbrella.h */, 93 | 04239285FD8E362D816F1B1D09001D65 /* Pods-Example.debug.xcconfig */, 94 | 3934CC4ED3E5E56B4560DA4444C63F20 /* Pods-Example.release.xcconfig */, 95 | ); 96 | name = "Pods-Example"; 97 | path = "Target Support Files/Pods-Example"; 98 | sourceTree = ""; 99 | }; 100 | 0F8D2E47FE03D3B91B51069F7C273AF4 /* Frameworks */ = { 101 | isa = PBXGroup; 102 | children = ( 103 | ); 104 | name = Frameworks; 105 | sourceTree = ""; 106 | }; 107 | 3B6083152689823D75ECD0C17DABCBF8 /* SliceControl */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | 8AA6C0E450A16090915C2097A41B504C /* Core */, 111 | 584E26C40C9A22A6D02EF8BCDB914EA0 /* Extensions */, 112 | E10D4022B3F7F377AD57B271649034E2 /* Pod */, 113 | ABB6537ACB25615A64A2ACD7DBC9A805 /* Support Files */, 114 | ); 115 | name = SliceControl; 116 | path = ../..; 117 | sourceTree = ""; 118 | }; 119 | 584E26C40C9A22A6D02EF8BCDB914EA0 /* Extensions */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | DED2791EE5AB67320143D79887EF6BD1 /* Anchor.swift */, 123 | 83960041B655A79A11BEDD1E8E87F703 /* Collection+Clamp.swift */, 124 | 12774431979A3D83FA2B2690A42FA897 /* NSObject+Create.swift */, 125 | C165AA1A6A001A73BE43E54C0B527B13 /* UIEdgeInsets+Init.swift */, 126 | 9610F9704259C37330DFECD57FF4F241 /* UILabel+Init.swift */, 127 | 22BB0A00E3F2B177CC7516E44C73264C /* UIStackView+Add.swift */, 128 | 75296E9D3EDEEC4A783EF232A5065427 /* UIView+Add.swift */, 129 | 9F5AAA4CE2E52F184B47206054AE8629 /* UIView+Rounded.swift */, 130 | ); 131 | name = Extensions; 132 | path = SliceControl/Extensions; 133 | sourceTree = ""; 134 | }; 135 | 6B96ACCE6DE1A6130A8665B41A535A09 /* Development Pods */ = { 136 | isa = PBXGroup; 137 | children = ( 138 | 3B6083152689823D75ECD0C17DABCBF8 /* SliceControl */, 139 | ); 140 | name = "Development Pods"; 141 | sourceTree = ""; 142 | }; 143 | 6C49482DA5D4F97709CE2787E2211CE4 /* Targets Support Files */ = { 144 | isa = PBXGroup; 145 | children = ( 146 | 037AE159A43E5E631B2F86CE2D6B9366 /* Pods-Example */, 147 | ); 148 | name = "Targets Support Files"; 149 | sourceTree = ""; 150 | }; 151 | 7DB346D0F39D3F0E887471402A8071AB = { 152 | isa = PBXGroup; 153 | children = ( 154 | 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */, 155 | 6B96ACCE6DE1A6130A8665B41A535A09 /* Development Pods */, 156 | 0F8D2E47FE03D3B91B51069F7C273AF4 /* Frameworks */, 157 | BFD90E33755A04C8366E8FFB16DFE332 /* Products */, 158 | 6C49482DA5D4F97709CE2787E2211CE4 /* Targets Support Files */, 159 | ); 160 | sourceTree = ""; 161 | }; 162 | 8AA6C0E450A16090915C2097A41B504C /* Core */ = { 163 | isa = PBXGroup; 164 | children = ( 165 | E611759CC0FBA8F8AF8A6E21D63AD458 /* SliceControl.swift */, 166 | 14C3296766DAA7C7B1AB36F9F84CBCE8 /* SliceControlDelegate.swift */, 167 | ); 168 | name = Core; 169 | path = SliceControl/Core; 170 | sourceTree = ""; 171 | }; 172 | ABB6537ACB25615A64A2ACD7DBC9A805 /* Support Files */ = { 173 | isa = PBXGroup; 174 | children = ( 175 | D4602DB62CBF6B538F20C931708E0FED /* SliceControl.modulemap */, 176 | 105CC86DB62D7D342C7A8ED5FFCB2E08 /* SliceControl.xcconfig */, 177 | 87610A612CA86F6628C27B2B3E78E444 /* SliceControl-dummy.m */, 178 | A7F8F9DAADAC940A6430E9F6375B1795 /* SliceControl-prefix.pch */, 179 | A3531EE26FA5C0B48B9B2A2038A0BC12 /* SliceControl-umbrella.h */, 180 | ); 181 | name = "Support Files"; 182 | path = "Example/Pods/Target Support Files/SliceControl"; 183 | sourceTree = ""; 184 | }; 185 | BFD90E33755A04C8366E8FFB16DFE332 /* Products */ = { 186 | isa = PBXGroup; 187 | children = ( 188 | 9EAE4C3F7F522E179FDFCE4E3C7E299D /* libPods-Example.a */, 189 | 7DF4926C3E1FC12FDE4D4C3B2F6B10D8 /* libSliceControl.a */, 190 | ); 191 | name = Products; 192 | sourceTree = ""; 193 | }; 194 | E10D4022B3F7F377AD57B271649034E2 /* Pod */ = { 195 | isa = PBXGroup; 196 | children = ( 197 | 8906A7DD14B97F077BB5A483B0F6C732 /* LICENSE */, 198 | 98879D9F9EE30273574D5ECD717966FC /* README.md */, 199 | D5B80539057CE427E5E9E1AF37D20623 /* SliceControl.podspec */, 200 | ); 201 | name = Pod; 202 | sourceTree = ""; 203 | }; 204 | /* End PBXGroup section */ 205 | 206 | /* Begin PBXHeadersBuildPhase section */ 207 | 0BFC58ED5E2A752BFA5E02D636E9038F /* Headers */ = { 208 | isa = PBXHeadersBuildPhase; 209 | buildActionMask = 2147483647; 210 | files = ( 211 | 91C64F7FB2106F43BA1BD62E1BC81392 /* Pods-Example-umbrella.h in Headers */, 212 | ); 213 | runOnlyForDeploymentPostprocessing = 0; 214 | }; 215 | EF66728E88562DC7F45FDBA397DA15CC /* Headers */ = { 216 | isa = PBXHeadersBuildPhase; 217 | buildActionMask = 2147483647; 218 | files = ( 219 | 40DC687349E7BB6C7E923F83C15B844B /* SliceControl-umbrella.h in Headers */, 220 | ); 221 | runOnlyForDeploymentPostprocessing = 0; 222 | }; 223 | /* End PBXHeadersBuildPhase section */ 224 | 225 | /* Begin PBXNativeTarget section */ 226 | 481AB4A8EACFE9F04332000886CFA3E6 /* SliceControl */ = { 227 | isa = PBXNativeTarget; 228 | buildConfigurationList = CACE829F49C32025E7C6600CD5EA6AE8 /* Build configuration list for PBXNativeTarget "SliceControl" */; 229 | buildPhases = ( 230 | EF66728E88562DC7F45FDBA397DA15CC /* Headers */, 231 | CC617AD947382A1F730765F715B3B6A2 /* Sources */, 232 | C16D6D6ED8B42D239595C3E508D0D818 /* Frameworks */, 233 | F23477105388FFD78BA99E42F2438691 /* Copy generated compatibility header */, 234 | ); 235 | buildRules = ( 236 | ); 237 | dependencies = ( 238 | ); 239 | name = SliceControl; 240 | productName = SliceControl; 241 | productReference = 7DF4926C3E1FC12FDE4D4C3B2F6B10D8 /* libSliceControl.a */; 242 | productType = "com.apple.product-type.library.static"; 243 | }; 244 | 91114590897166971DCDE67EBC8E297F /* Pods-Example */ = { 245 | isa = PBXNativeTarget; 246 | buildConfigurationList = 2E8832716ADA4270FFE10CDCD8D7F91A /* Build configuration list for PBXNativeTarget "Pods-Example" */; 247 | buildPhases = ( 248 | 0BFC58ED5E2A752BFA5E02D636E9038F /* Headers */, 249 | DEA6CA5B4BBC61C09CC9FC92345468C5 /* Sources */, 250 | 83876CECEDD19FCB19218EE9F1FFE2DC /* Frameworks */, 251 | ); 252 | buildRules = ( 253 | ); 254 | dependencies = ( 255 | FDFD5288E820CCA71967972DEC4BBBB2 /* PBXTargetDependency */, 256 | ); 257 | name = "Pods-Example"; 258 | productName = "Pods-Example"; 259 | productReference = 9EAE4C3F7F522E179FDFCE4E3C7E299D /* libPods-Example.a */; 260 | productType = "com.apple.product-type.library.static"; 261 | }; 262 | /* End PBXNativeTarget section */ 263 | 264 | /* Begin PBXProject section */ 265 | D41D8CD98F00B204E9800998ECF8427E /* Project object */ = { 266 | isa = PBXProject; 267 | attributes = { 268 | LastSwiftUpdateCheck = 0930; 269 | LastUpgradeCheck = 0930; 270 | }; 271 | buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; 272 | compatibilityVersion = "Xcode 3.2"; 273 | developmentRegion = English; 274 | hasScannedForEncodings = 0; 275 | knownRegions = ( 276 | en, 277 | ); 278 | mainGroup = 7DB346D0F39D3F0E887471402A8071AB; 279 | productRefGroup = BFD90E33755A04C8366E8FFB16DFE332 /* Products */; 280 | projectDirPath = ""; 281 | projectRoot = ""; 282 | targets = ( 283 | 91114590897166971DCDE67EBC8E297F /* Pods-Example */, 284 | 481AB4A8EACFE9F04332000886CFA3E6 /* SliceControl */, 285 | ); 286 | }; 287 | /* End PBXProject section */ 288 | 289 | /* Begin PBXShellScriptBuildPhase section */ 290 | F23477105388FFD78BA99E42F2438691 /* Copy generated compatibility header */ = { 291 | isa = PBXShellScriptBuildPhase; 292 | buildActionMask = 2147483647; 293 | files = ( 294 | ); 295 | inputFileListPaths = ( 296 | ); 297 | inputPaths = ( 298 | "${DERIVED_SOURCES_DIR}/${PRODUCT_MODULE_NAME}-Swift.h", 299 | "${PODS_ROOT}/Headers/Public/SliceControl/SliceControl.modulemap", 300 | "${PODS_ROOT}/Headers/Public/SliceControl/SliceControl-umbrella.h", 301 | ); 302 | name = "Copy generated compatibility header"; 303 | outputFileListPaths = ( 304 | ); 305 | outputPaths = ( 306 | "${BUILT_PRODUCTS_DIR}/${PRODUCT_MODULE_NAME}.modulemap", 307 | "${BUILT_PRODUCTS_DIR}/SliceControl-umbrella.h", 308 | "${BUILT_PRODUCTS_DIR}/Swift Compatibility Header/${PRODUCT_MODULE_NAME}-Swift.h", 309 | ); 310 | runOnlyForDeploymentPostprocessing = 0; 311 | shellPath = /bin/sh; 312 | shellScript = "COMPATIBILITY_HEADER_PATH=\"${BUILT_PRODUCTS_DIR}/Swift Compatibility Header/${PRODUCT_MODULE_NAME}-Swift.h\"\nMODULE_MAP_PATH=\"${BUILT_PRODUCTS_DIR}/${PRODUCT_MODULE_NAME}.modulemap\"\n\nditto \"${DERIVED_SOURCES_DIR}/${PRODUCT_MODULE_NAME}-Swift.h\" \"${COMPATIBILITY_HEADER_PATH}\"\nditto \"${PODS_ROOT}/Headers/Public/SliceControl/SliceControl.modulemap\" \"${MODULE_MAP_PATH}\"\nditto \"${PODS_ROOT}/Headers/Public/SliceControl/SliceControl-umbrella.h\" \"${BUILT_PRODUCTS_DIR}\"\nprintf \"\\n\\nmodule ${PRODUCT_MODULE_NAME}.Swift {\\n header \\\"${COMPATIBILITY_HEADER_PATH}\\\"\\n requires objc\\n}\\n\" >> \"${MODULE_MAP_PATH}\"\n"; 313 | showEnvVarsInLog = 1; 314 | }; 315 | /* End PBXShellScriptBuildPhase section */ 316 | 317 | /* Begin PBXSourcesBuildPhase section */ 318 | CC617AD947382A1F730765F715B3B6A2 /* Sources */ = { 319 | isa = PBXSourcesBuildPhase; 320 | buildActionMask = 2147483647; 321 | files = ( 322 | C8F6010A90E5FBF5900150BA8059C0EB /* Anchor.swift in Sources */, 323 | 16CB4013B0D445D83435E6C3A096BFE8 /* Collection+Clamp.swift in Sources */, 324 | 54F0C620D9916957E93CB6C9894492EC /* NSObject+Create.swift in Sources */, 325 | 063BE9330204F1913A5E948871374554 /* SliceControl-dummy.m in Sources */, 326 | 0B27795202D1C870B58DE65682AB583B /* SliceControl.swift in Sources */, 327 | A5322883A426F575A3013AC94225437B /* SliceControlDelegate.swift in Sources */, 328 | B1DDED14E9A5F16884F5CD45070DF125 /* UIEdgeInsets+Init.swift in Sources */, 329 | 64705845D0838661BCC1165AB6C02AC4 /* UILabel+Init.swift in Sources */, 330 | 5D74B53AEA2C6AD0E986FE4085883509 /* UIStackView+Add.swift in Sources */, 331 | 76BBDCD56973BD47192BD08842B9C8D3 /* UIView+Add.swift in Sources */, 332 | A398D2594397A344C51D57A3C123F905 /* UIView+Rounded.swift in Sources */, 333 | ); 334 | runOnlyForDeploymentPostprocessing = 0; 335 | }; 336 | DEA6CA5B4BBC61C09CC9FC92345468C5 /* Sources */ = { 337 | isa = PBXSourcesBuildPhase; 338 | buildActionMask = 2147483647; 339 | files = ( 340 | 8CF8BF0A917959F5616AB773B031576B /* Pods-Example-dummy.m in Sources */, 341 | ); 342 | runOnlyForDeploymentPostprocessing = 0; 343 | }; 344 | /* End PBXSourcesBuildPhase section */ 345 | 346 | /* Begin PBXTargetDependency section */ 347 | FDFD5288E820CCA71967972DEC4BBBB2 /* PBXTargetDependency */ = { 348 | isa = PBXTargetDependency; 349 | name = SliceControl; 350 | target = 481AB4A8EACFE9F04332000886CFA3E6 /* SliceControl */; 351 | targetProxy = CCF0F80ED0C96C6C7DF827AC7785C32D /* PBXContainerItemProxy */; 352 | }; 353 | /* End PBXTargetDependency section */ 354 | 355 | /* Begin XCBuildConfiguration section */ 356 | 1CBCD4E81A6CBF2E75C36ABDE71188DE /* Release */ = { 357 | isa = XCBuildConfiguration; 358 | baseConfigurationReference = 105CC86DB62D7D342C7A8ED5FFCB2E08 /* SliceControl.xcconfig */; 359 | buildSettings = { 360 | ARCHS = "$(ARCHS_STANDARD_64_BIT)"; 361 | CODE_SIGN_IDENTITY = "iPhone Developer"; 362 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 363 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 364 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 365 | GCC_PREFIX_HEADER = "Target Support Files/SliceControl/SliceControl-prefix.pch"; 366 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 367 | MODULEMAP_FILE = Headers/Public/SliceControl/SliceControl.modulemap; 368 | OTHER_LDFLAGS = ""; 369 | OTHER_LIBTOOLFLAGS = ""; 370 | PRIVATE_HEADERS_FOLDER_PATH = ""; 371 | PRODUCT_MODULE_NAME = SliceControl; 372 | PRODUCT_NAME = SliceControl; 373 | PUBLIC_HEADERS_FOLDER_PATH = ""; 374 | SDKROOT = iphoneos; 375 | SKIP_INSTALL = YES; 376 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; 377 | SWIFT_COMPILATION_MODE = wholemodule; 378 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 379 | SWIFT_VERSION = 4.2; 380 | TARGETED_DEVICE_FAMILY = "1,2"; 381 | VALIDATE_PRODUCT = YES; 382 | }; 383 | name = Release; 384 | }; 385 | 20959D460C31BEC0E7AC73DE34AF0934 /* Debug */ = { 386 | isa = XCBuildConfiguration; 387 | baseConfigurationReference = 04239285FD8E362D816F1B1D09001D65 /* Pods-Example.debug.xcconfig */; 388 | buildSettings = { 389 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; 390 | ARCHS = "$(ARCHS_STANDARD_64_BIT)"; 391 | CLANG_ENABLE_OBJC_WEAK = NO; 392 | CODE_SIGN_IDENTITY = "iPhone Developer"; 393 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 394 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 395 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 396 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 397 | MACH_O_TYPE = staticlib; 398 | MODULEMAP_FILE = "Target Support Files/Pods-Example/Pods-Example.modulemap"; 399 | OTHER_LDFLAGS = ""; 400 | OTHER_LIBTOOLFLAGS = ""; 401 | PODS_ROOT = "$(SRCROOT)"; 402 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; 403 | SDKROOT = iphoneos; 404 | SKIP_INSTALL = YES; 405 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 406 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 407 | TARGETED_DEVICE_FAMILY = "1,2"; 408 | }; 409 | name = Debug; 410 | }; 411 | 283C15C18A8A97EBCE5268C609BE0F6E /* Release */ = { 412 | isa = XCBuildConfiguration; 413 | baseConfigurationReference = 3934CC4ED3E5E56B4560DA4444C63F20 /* Pods-Example.release.xcconfig */; 414 | buildSettings = { 415 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; 416 | ARCHS = "$(ARCHS_STANDARD_64_BIT)"; 417 | CLANG_ENABLE_OBJC_WEAK = NO; 418 | CODE_SIGN_IDENTITY = "iPhone Developer"; 419 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 420 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 421 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 422 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 423 | MACH_O_TYPE = staticlib; 424 | MODULEMAP_FILE = "Target Support Files/Pods-Example/Pods-Example.modulemap"; 425 | OTHER_LDFLAGS = ""; 426 | OTHER_LIBTOOLFLAGS = ""; 427 | PODS_ROOT = "$(SRCROOT)"; 428 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; 429 | SDKROOT = iphoneos; 430 | SKIP_INSTALL = YES; 431 | SWIFT_COMPILATION_MODE = wholemodule; 432 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 433 | TARGETED_DEVICE_FAMILY = "1,2"; 434 | VALIDATE_PRODUCT = YES; 435 | }; 436 | name = Release; 437 | }; 438 | 2F120133884A025CE770700D3B3A8A2B /* Debug */ = { 439 | isa = XCBuildConfiguration; 440 | baseConfigurationReference = 105CC86DB62D7D342C7A8ED5FFCB2E08 /* SliceControl.xcconfig */; 441 | buildSettings = { 442 | ARCHS = "$(ARCHS_STANDARD_64_BIT)"; 443 | CODE_SIGN_IDENTITY = "iPhone Developer"; 444 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 445 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 446 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 447 | GCC_PREFIX_HEADER = "Target Support Files/SliceControl/SliceControl-prefix.pch"; 448 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 449 | MODULEMAP_FILE = Headers/Public/SliceControl/SliceControl.modulemap; 450 | OTHER_LDFLAGS = ""; 451 | OTHER_LIBTOOLFLAGS = ""; 452 | PRIVATE_HEADERS_FOLDER_PATH = ""; 453 | PRODUCT_MODULE_NAME = SliceControl; 454 | PRODUCT_NAME = SliceControl; 455 | PUBLIC_HEADERS_FOLDER_PATH = ""; 456 | SDKROOT = iphoneos; 457 | SKIP_INSTALL = YES; 458 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; 459 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 460 | SWIFT_VERSION = 4.2; 461 | TARGETED_DEVICE_FAMILY = "1,2"; 462 | }; 463 | name = Debug; 464 | }; 465 | 8C3D32AC054F4DBEE82EB2FD6A303D73 /* Debug */ = { 466 | isa = XCBuildConfiguration; 467 | buildSettings = { 468 | ALWAYS_SEARCH_USER_PATHS = NO; 469 | CLANG_ANALYZER_NONNULL = YES; 470 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 471 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 472 | CLANG_CXX_LIBRARY = "libc++"; 473 | CLANG_ENABLE_MODULES = YES; 474 | CLANG_ENABLE_OBJC_ARC = YES; 475 | CLANG_ENABLE_OBJC_WEAK = YES; 476 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 477 | CLANG_WARN_BOOL_CONVERSION = YES; 478 | CLANG_WARN_COMMA = YES; 479 | CLANG_WARN_CONSTANT_CONVERSION = YES; 480 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 481 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 482 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 483 | CLANG_WARN_EMPTY_BODY = YES; 484 | CLANG_WARN_ENUM_CONVERSION = YES; 485 | CLANG_WARN_INFINITE_RECURSION = YES; 486 | CLANG_WARN_INT_CONVERSION = YES; 487 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 488 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 489 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 490 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 491 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 492 | CLANG_WARN_STRICT_PROTOTYPES = YES; 493 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 494 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 495 | CLANG_WARN_UNREACHABLE_CODE = YES; 496 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 497 | CODE_SIGNING_ALLOWED = NO; 498 | CODE_SIGNING_REQUIRED = NO; 499 | COPY_PHASE_STRIP = NO; 500 | DEBUG_INFORMATION_FORMAT = dwarf; 501 | ENABLE_STRICT_OBJC_MSGSEND = YES; 502 | ENABLE_TESTABILITY = YES; 503 | GCC_C_LANGUAGE_STANDARD = gnu11; 504 | GCC_DYNAMIC_NO_PIC = NO; 505 | GCC_NO_COMMON_BLOCKS = YES; 506 | GCC_OPTIMIZATION_LEVEL = 0; 507 | GCC_PREPROCESSOR_DEFINITIONS = ( 508 | "POD_CONFIGURATION_DEBUG=1", 509 | "DEBUG=1", 510 | "$(inherited)", 511 | ); 512 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 513 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 514 | GCC_WARN_UNDECLARED_SELECTOR = YES; 515 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 516 | GCC_WARN_UNUSED_FUNCTION = YES; 517 | GCC_WARN_UNUSED_VARIABLE = YES; 518 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 519 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 520 | MTL_FAST_MATH = YES; 521 | ONLY_ACTIVE_ARCH = YES; 522 | PRODUCT_NAME = "$(TARGET_NAME)"; 523 | STRIP_INSTALLED_PRODUCT = NO; 524 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 525 | SYMROOT = "${SRCROOT}/../build"; 526 | }; 527 | name = Debug; 528 | }; 529 | B751CA5B597BFC35A6C0287C65F9E2E1 /* Release */ = { 530 | isa = XCBuildConfiguration; 531 | buildSettings = { 532 | ALWAYS_SEARCH_USER_PATHS = NO; 533 | CLANG_ANALYZER_NONNULL = YES; 534 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 535 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 536 | CLANG_CXX_LIBRARY = "libc++"; 537 | CLANG_ENABLE_MODULES = YES; 538 | CLANG_ENABLE_OBJC_ARC = YES; 539 | CLANG_ENABLE_OBJC_WEAK = YES; 540 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 541 | CLANG_WARN_BOOL_CONVERSION = YES; 542 | CLANG_WARN_COMMA = YES; 543 | CLANG_WARN_CONSTANT_CONVERSION = YES; 544 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 545 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 546 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 547 | CLANG_WARN_EMPTY_BODY = YES; 548 | CLANG_WARN_ENUM_CONVERSION = YES; 549 | CLANG_WARN_INFINITE_RECURSION = YES; 550 | CLANG_WARN_INT_CONVERSION = YES; 551 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 552 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 553 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 554 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 555 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 556 | CLANG_WARN_STRICT_PROTOTYPES = YES; 557 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 558 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 559 | CLANG_WARN_UNREACHABLE_CODE = YES; 560 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 561 | CODE_SIGNING_ALLOWED = NO; 562 | CODE_SIGNING_REQUIRED = NO; 563 | COPY_PHASE_STRIP = NO; 564 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 565 | ENABLE_NS_ASSERTIONS = NO; 566 | ENABLE_STRICT_OBJC_MSGSEND = YES; 567 | GCC_C_LANGUAGE_STANDARD = gnu11; 568 | GCC_NO_COMMON_BLOCKS = YES; 569 | GCC_PREPROCESSOR_DEFINITIONS = ( 570 | "POD_CONFIGURATION_RELEASE=1", 571 | "$(inherited)", 572 | ); 573 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 574 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 575 | GCC_WARN_UNDECLARED_SELECTOR = YES; 576 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 577 | GCC_WARN_UNUSED_FUNCTION = YES; 578 | GCC_WARN_UNUSED_VARIABLE = YES; 579 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 580 | MTL_ENABLE_DEBUG_INFO = NO; 581 | MTL_FAST_MATH = YES; 582 | PRODUCT_NAME = "$(TARGET_NAME)"; 583 | STRIP_INSTALLED_PRODUCT = NO; 584 | SYMROOT = "${SRCROOT}/../build"; 585 | }; 586 | name = Release; 587 | }; 588 | /* End XCBuildConfiguration section */ 589 | 590 | /* Begin XCConfigurationList section */ 591 | 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { 592 | isa = XCConfigurationList; 593 | buildConfigurations = ( 594 | 8C3D32AC054F4DBEE82EB2FD6A303D73 /* Debug */, 595 | B751CA5B597BFC35A6C0287C65F9E2E1 /* Release */, 596 | ); 597 | defaultConfigurationIsVisible = 0; 598 | defaultConfigurationName = Release; 599 | }; 600 | 2E8832716ADA4270FFE10CDCD8D7F91A /* Build configuration list for PBXNativeTarget "Pods-Example" */ = { 601 | isa = XCConfigurationList; 602 | buildConfigurations = ( 603 | 20959D460C31BEC0E7AC73DE34AF0934 /* Debug */, 604 | 283C15C18A8A97EBCE5268C609BE0F6E /* Release */, 605 | ); 606 | defaultConfigurationIsVisible = 0; 607 | defaultConfigurationName = Release; 608 | }; 609 | CACE829F49C32025E7C6600CD5EA6AE8 /* Build configuration list for PBXNativeTarget "SliceControl" */ = { 610 | isa = XCConfigurationList; 611 | buildConfigurations = ( 612 | 2F120133884A025CE770700D3B3A8A2B /* Debug */, 613 | 1CBCD4E81A6CBF2E75C36ABDE71188DE /* Release */, 614 | ); 615 | defaultConfigurationIsVisible = 0; 616 | defaultConfigurationName = Release; 617 | }; 618 | /* End XCConfigurationList section */ 619 | }; 620 | rootObject = D41D8CD98F00B204E9800998ECF8427E /* Project object */; 621 | } 622 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Example/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 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Example/Pods-Example-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## SliceControl 5 | 6 | MIT License 7 | 8 | Copyright (c) 2019 Pedro Carrasco 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | 28 | Generated by CocoaPods - https://cocoapods.org 29 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Example/Pods-Example-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Example/Pods-Example-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_Example : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_Example 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Example/Pods-Example-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then 7 | # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy 8 | # frameworks to, so exit 0 (signalling the script phase was successful). 9 | exit 0 10 | fi 11 | 12 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 13 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 14 | 15 | COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" 16 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 17 | 18 | # Used as a return value for each invocation of `strip_invalid_archs` function. 19 | STRIP_BINARY_RETVAL=0 20 | 21 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 22 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 23 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 24 | 25 | # Copies and strips a vendored framework 26 | install_framework() 27 | { 28 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 29 | local source="${BUILT_PRODUCTS_DIR}/$1" 30 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 31 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 32 | elif [ -r "$1" ]; then 33 | local source="$1" 34 | fi 35 | 36 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 37 | 38 | if [ -L "${source}" ]; then 39 | echo "Symlinked..." 40 | source="$(readlink "${source}")" 41 | fi 42 | 43 | # Use filter instead of exclude so missing patterns don't throw errors. 44 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 45 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 46 | 47 | local basename 48 | basename="$(basename -s .framework "$1")" 49 | binary="${destination}/${basename}.framework/${basename}" 50 | if ! [ -r "$binary" ]; then 51 | binary="${destination}/${basename}" 52 | fi 53 | 54 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 55 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 56 | strip_invalid_archs "$binary" 57 | fi 58 | 59 | # Resign the code if required by the build settings to avoid unstable apps 60 | code_sign_if_enabled "${destination}/$(basename "$1")" 61 | 62 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 63 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 64 | local swift_runtime_libs 65 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 66 | for lib in $swift_runtime_libs; do 67 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 68 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 69 | code_sign_if_enabled "${destination}/${lib}" 70 | done 71 | fi 72 | } 73 | 74 | # Copies and strips a vendored dSYM 75 | install_dsym() { 76 | local source="$1" 77 | if [ -r "$source" ]; then 78 | # Copy the dSYM into a the targets temp dir. 79 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" 80 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" 81 | 82 | local basename 83 | basename="$(basename -s .framework.dSYM "$source")" 84 | binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" 85 | 86 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 87 | if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then 88 | strip_invalid_archs "$binary" 89 | fi 90 | 91 | if [[ $STRIP_BINARY_RETVAL == 1 ]]; then 92 | # Move the stripped file into its final destination. 93 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" 94 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}" 95 | else 96 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. 97 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" 98 | fi 99 | fi 100 | } 101 | 102 | # Signs a framework with the provided identity 103 | code_sign_if_enabled() { 104 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 105 | # Use the current code_sign_identitiy 106 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 107 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" 108 | 109 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 110 | code_sign_cmd="$code_sign_cmd &" 111 | fi 112 | echo "$code_sign_cmd" 113 | eval "$code_sign_cmd" 114 | fi 115 | } 116 | 117 | # Strip invalid architectures 118 | strip_invalid_archs() { 119 | binary="$1" 120 | # Get architectures for current target binary 121 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" 122 | # Intersect them with the architectures we are building for 123 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" 124 | # If there are no archs supported by this binary then warn the user 125 | if [[ -z "$intersected_archs" ]]; then 126 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." 127 | STRIP_BINARY_RETVAL=0 128 | return 129 | fi 130 | stripped="" 131 | for arch in $binary_archs; do 132 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 133 | # Strip non-valid architectures in-place 134 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 135 | stripped="$stripped $arch" 136 | fi 137 | done 138 | if [[ "$stripped" ]]; then 139 | echo "Stripped $binary of architectures:$stripped" 140 | fi 141 | STRIP_BINARY_RETVAL=1 142 | } 143 | 144 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 145 | wait 146 | fi 147 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Example/Pods-Example-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then 7 | # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy 8 | # resources to, so exit 0 (signalling the script phase was successful). 9 | exit 0 10 | fi 11 | 12 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 13 | 14 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 15 | > "$RESOURCES_TO_COPY" 16 | 17 | XCASSET_FILES=() 18 | 19 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 20 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 21 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 22 | 23 | case "${TARGETED_DEVICE_FAMILY:-}" in 24 | 1,2) 25 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 26 | ;; 27 | 1) 28 | TARGET_DEVICE_ARGS="--target-device iphone" 29 | ;; 30 | 2) 31 | TARGET_DEVICE_ARGS="--target-device ipad" 32 | ;; 33 | 3) 34 | TARGET_DEVICE_ARGS="--target-device tv" 35 | ;; 36 | 4) 37 | TARGET_DEVICE_ARGS="--target-device watch" 38 | ;; 39 | *) 40 | TARGET_DEVICE_ARGS="--target-device mac" 41 | ;; 42 | esac 43 | 44 | install_resource() 45 | { 46 | if [[ "$1" = /* ]] ; then 47 | RESOURCE_PATH="$1" 48 | else 49 | RESOURCE_PATH="${PODS_ROOT}/$1" 50 | fi 51 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 52 | cat << EOM 53 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 54 | EOM 55 | exit 1 56 | fi 57 | case $RESOURCE_PATH in 58 | *.storyboard) 59 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 60 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 61 | ;; 62 | *.xib) 63 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 64 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 65 | ;; 66 | *.framework) 67 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 68 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 69 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 70 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 71 | ;; 72 | *.xcdatamodel) 73 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true 74 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 75 | ;; 76 | *.xcdatamodeld) 77 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true 78 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 79 | ;; 80 | *.xcmappingmodel) 81 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true 82 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 83 | ;; 84 | *.xcassets) 85 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 86 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 87 | ;; 88 | *) 89 | echo "$RESOURCE_PATH" || true 90 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 91 | ;; 92 | esac 93 | } 94 | 95 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 96 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 97 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 98 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 99 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 100 | fi 101 | rm -f "$RESOURCES_TO_COPY" 102 | 103 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ] 104 | then 105 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 106 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 107 | while read line; do 108 | if [[ $line != "${PODS_ROOT}*" ]]; then 109 | XCASSET_FILES+=("$line") 110 | fi 111 | done <<<"$OTHER_XCASSETS" 112 | 113 | if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then 114 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 115 | else 116 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist" 117 | fi 118 | fi 119 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Example/Pods-Example-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_ExampleVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_ExampleVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SliceControl" 4 | OTHER_CFLAGS = $(inherited) -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/SliceControl/SliceControl.modulemap" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"SliceControl" 6 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -Xcc -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/SliceControl/SliceControl.modulemap" 7 | PODS_BUILD_DIR = ${BUILD_DIR} 8 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 10 | PODS_ROOT = ${SRCROOT}/Pods 11 | SWIFT_INCLUDE_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SliceControl" 12 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Example/Pods-Example.modulemap: -------------------------------------------------------------------------------- 1 | module Pods_Example { 2 | umbrella header "Pods-Example-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Example/Pods-Example.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SliceControl" 4 | OTHER_CFLAGS = $(inherited) -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/SliceControl/SliceControl.modulemap" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"SliceControl" 6 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -Xcc -fmodule-map-file="${PODS_CONFIGURATION_BUILD_DIR}/SliceControl/SliceControl.modulemap" 7 | PODS_BUILD_DIR = ${BUILD_DIR} 8 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 10 | PODS_ROOT = ${SRCROOT}/Pods 11 | SWIFT_INCLUDE_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SliceControl" 12 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/SliceControl/SliceControl-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_SliceControl : NSObject 3 | @end 4 | @implementation PodsDummy_SliceControl 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/SliceControl/SliceControl-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/SliceControl/SliceControl-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double SliceControlVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char SliceControlVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/SliceControl/SliceControl.modulemap: -------------------------------------------------------------------------------- 1 | module SliceControl { 2 | umbrella header "SliceControl-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/SliceControl/SliceControl.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/SliceControl 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -import-underlying-module -Xcc -fmodule-map-file="${SRCROOT}/${MODULEMAP_FILE}" 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Pedro Carrasco 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 | -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:5.1 2 | // The swift-tools-version declares the minimum version of Swift required to build this package. 3 | import PackageDescription 4 | 5 | let package = Package( 6 | name: "SliceControl", 7 | platforms: [ 8 | .iOS(.v11) 9 | ], 10 | products: [ 11 | .library( 12 | name: "SliceControl", 13 | targets: ["SliceControl"] 14 | ) 15 | ], 16 | dependencies: [], 17 | targets: [ 18 | .target( 19 | name: "SliceControl", 20 | dependencies: [], 21 | path: "SliceControl" 22 | ) 23 | ] 24 | ) 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 | 5 | > **Slice** *(/slɑɪs/)*, *noun* 6 | > 7 | > "A slice is any small part that has been separated from something larger" 8 | 9 | [![CocoaPods](https://img.shields.io/cocoapods/v/SliceControl.svg)](https://cocoapods.org/pods/SliceControl) 10 | [![apm](https://img.shields.io/apm/l/vim-mode.svg)](https://github.com/pedrommcarrasco/SliceControl/blob/master/LICENSE) 11 | 12 | # Usage Example ⌨️ 13 | 14 | After installing **SliceControl**, you should start by importing the framework: 15 | 16 | ```swift 17 | import SliceControl 18 | ``` 19 | 20 | Once imported, you can start using **SliceControl** like follows: 21 | 22 | ```swift 23 | sliceControl = SliceControl(with: ["All", "Liked", "Favourited"], 24 | primaryColor: .darkGray, 25 | secondaryColor: .white, 26 | padding: 12) 27 | 28 | // Implement SliceControlDelegate to intercept actions 29 | sliceControl.delegate = self 30 | 31 | view.addSubview(sliceControl) 32 | // ... Constrain it 33 | ``` 34 | You can also set its `UIFont` and starting option. 35 | 36 | ## RxSwift 37 | Would you like to subscribe to SliceControl's events using RxSwift? **[RxSliceControl](https://github.com/pedrommcarrasco/RxSliceControl)** is here to save you! 38 | 39 | # Instalation 📦 40 | 41 | **SliceControl** is available through [CocoaPods](https://cocoapods.org/pods/SliceControl). In order to install, add the following line to your Podfile: 42 | 43 | ```swift 44 | pod 'SliceControl' 45 | ``` 46 | And run the following command in terminal: 47 | 48 | ```swift 49 | pod install 50 | ``` 51 | 52 | # Sample Project 📲 53 | 54 | There's a sample project in this repository called [Example](https://github.com/pedrommcarrasco/SliceControl/tree/master/Example). 55 | 56 | # Support SliceControl ❤️ 57 | 58 | Hello there 👋 59 | 60 | I’m Pedro, a Portuguese iOS Engineer since February 2017. I’m an avid OSS enthusiast and contributor - help by sharing, learn by what’s shared. 61 | 62 | I've built and open-sourced multiple frameworks and applications, including **[Brooklyn](https://github.com/pedrommcarrasco/Brooklyn)** and **[CocoaHub](https://cocoahub.app)**. 63 | 64 | I'm also a conference and meetup organizer, being part of **[SwiftAveiro](https://swiftaveiro.xyz)** and **[CocoaHeads Porto](https://www.meetup.com/CocoaHeads-Porto/)**. 65 | 66 | If you enjoy my work and would like to help me continue it, please consider: 67 | * https://github.com/users/pedrommcarrasco/sponsorship 68 | * https://www.buymeacoffee.com/pedrommcarrasco 69 | * https://www.paypal.me/pedrommcarrasco 70 | 71 | # Contributing 🙌 72 | 73 | Feel free to contribute to this project by providing [ideas](https://github.com/pedrommcarrasco/SliceControl/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc) or opening [pull requests](https://github.com/pedrommcarrasco/SliceControl/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc). 74 | 75 | # License ⛔ 76 | 77 | SliceControl's available under the MIT license. See the [LICENSE](https://github.com/pedrommcarrasco/SliceControl/blob/master/LICENSE) file for more information. 78 | -------------------------------------------------------------------------------- /SliceControl.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.swift_version = "4.2" 3 | s.name = "SliceControl" 4 | s.version = "1.3.0" 5 | s.summary = "🍰 Simply a better & animated UISegmentedControl" 6 | s.description = "🍰 Simply a better & animated UISegmentedControl" 7 | 8 | s.homepage = "https://github.com/pedrommcarrasco/SliceControl" 9 | s.license = { :type => 'MIT', :file => 'LICENSE' } 10 | 11 | s.author = "Pedro Carrasco" 12 | s.social_media_url = "http://twitter.com/pedrommcarrasco" 13 | 14 | s.platform = :ios, "9.0" 15 | s.source = { :git => "https://github.com/pedrommcarrasco/SliceControl.git", :tag => s.version.to_s } 16 | 17 | s.source_files = "SliceControl/**/*" 18 | s.exclude_files = "SliceControl/*.plist" 19 | end 20 | -------------------------------------------------------------------------------- /SliceControl.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 202E803A21F1102A0086D4A3 /* SliceControl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 202E803921F1102A0086D4A3 /* SliceControl.swift */; }; 11 | 202E803C21F1104B0086D4A3 /* SliceControlDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 202E803B21F1104B0086D4A3 /* SliceControlDelegate.swift */; }; 12 | 202E804021F110E50086D4A3 /* NSObject+Create.swift in Sources */ = {isa = PBXBuildFile; fileRef = 202E803F21F110E50086D4A3 /* NSObject+Create.swift */; }; 13 | 202E804221F114EC0086D4A3 /* UILabel+Init.swift in Sources */ = {isa = PBXBuildFile; fileRef = 202E804121F114EC0086D4A3 /* UILabel+Init.swift */; }; 14 | 20F9C3C821F2942400889F7C /* UIView+Rounded.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20F9C3C721F2942400889F7C /* UIView+Rounded.swift */; }; 15 | 20F9C3CA21F2948600889F7C /* Collection+Clamp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20F9C3C921F2948600889F7C /* Collection+Clamp.swift */; }; 16 | 20F9C3CC21F2999F00889F7C /* UIView+Add.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20F9C3CB21F2999F00889F7C /* UIView+Add.swift */; }; 17 | 20F9C3CE21F29A1D00889F7C /* UIStackView+Add.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20F9C3CD21F29A1D00889F7C /* UIStackView+Add.swift */; }; 18 | 20F9C3D021F29B4B00889F7C /* Anchor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20F9C3CF21F29B4B00889F7C /* Anchor.swift */; }; 19 | 20F9C3D221F29C1800889F7C /* UIEdgeInsets+Init.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20F9C3D121F29C1800889F7C /* UIEdgeInsets+Init.swift */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXFileReference section */ 23 | 202E802E21F10EEE0086D4A3 /* SliceControl.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SliceControl.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 24 | 202E803221F10EEE0086D4A3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 25 | 202E803921F1102A0086D4A3 /* SliceControl.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SliceControl.swift; sourceTree = ""; }; 26 | 202E803B21F1104B0086D4A3 /* SliceControlDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SliceControlDelegate.swift; sourceTree = ""; }; 27 | 202E803F21F110E50086D4A3 /* NSObject+Create.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSObject+Create.swift"; sourceTree = ""; }; 28 | 202E804121F114EC0086D4A3 /* UILabel+Init.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UILabel+Init.swift"; sourceTree = ""; }; 29 | 20F9C3C721F2942400889F7C /* UIView+Rounded.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+Rounded.swift"; sourceTree = ""; }; 30 | 20F9C3C921F2948600889F7C /* Collection+Clamp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Collection+Clamp.swift"; sourceTree = ""; }; 31 | 20F9C3CB21F2999F00889F7C /* UIView+Add.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+Add.swift"; sourceTree = ""; }; 32 | 20F9C3CD21F29A1D00889F7C /* UIStackView+Add.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIStackView+Add.swift"; sourceTree = ""; }; 33 | 20F9C3CF21F29B4B00889F7C /* Anchor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Anchor.swift; sourceTree = ""; }; 34 | 20F9C3D121F29C1800889F7C /* UIEdgeInsets+Init.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIEdgeInsets+Init.swift"; sourceTree = ""; }; 35 | /* End PBXFileReference section */ 36 | 37 | /* Begin PBXFrameworksBuildPhase section */ 38 | 202E802B21F10EEE0086D4A3 /* Frameworks */ = { 39 | isa = PBXFrameworksBuildPhase; 40 | buildActionMask = 2147483647; 41 | files = ( 42 | ); 43 | runOnlyForDeploymentPostprocessing = 0; 44 | }; 45 | /* End PBXFrameworksBuildPhase section */ 46 | 47 | /* Begin PBXGroup section */ 48 | 202E802421F10EEE0086D4A3 = { 49 | isa = PBXGroup; 50 | children = ( 51 | 202E803021F10EEE0086D4A3 /* SliceControl */, 52 | 202E802F21F10EEE0086D4A3 /* Products */, 53 | ); 54 | sourceTree = ""; 55 | }; 56 | 202E802F21F10EEE0086D4A3 /* Products */ = { 57 | isa = PBXGroup; 58 | children = ( 59 | 202E802E21F10EEE0086D4A3 /* SliceControl.framework */, 60 | ); 61 | name = Products; 62 | sourceTree = ""; 63 | }; 64 | 202E803021F10EEE0086D4A3 /* SliceControl */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | 202E803D21F110C60086D4A3 /* Core */, 68 | 202E803E21F110D30086D4A3 /* Extensions */, 69 | 202E803221F10EEE0086D4A3 /* Info.plist */, 70 | ); 71 | path = SliceControl; 72 | sourceTree = ""; 73 | }; 74 | 202E803D21F110C60086D4A3 /* Core */ = { 75 | isa = PBXGroup; 76 | children = ( 77 | 202E803921F1102A0086D4A3 /* SliceControl.swift */, 78 | 202E803B21F1104B0086D4A3 /* SliceControlDelegate.swift */, 79 | ); 80 | path = Core; 81 | sourceTree = ""; 82 | }; 83 | 202E803E21F110D30086D4A3 /* Extensions */ = { 84 | isa = PBXGroup; 85 | children = ( 86 | 20F9C3CF21F29B4B00889F7C /* Anchor.swift */, 87 | 202E803F21F110E50086D4A3 /* NSObject+Create.swift */, 88 | 202E804121F114EC0086D4A3 /* UILabel+Init.swift */, 89 | 20F9C3C721F2942400889F7C /* UIView+Rounded.swift */, 90 | 20F9C3C921F2948600889F7C /* Collection+Clamp.swift */, 91 | 20F9C3CB21F2999F00889F7C /* UIView+Add.swift */, 92 | 20F9C3CD21F29A1D00889F7C /* UIStackView+Add.swift */, 93 | 20F9C3D121F29C1800889F7C /* UIEdgeInsets+Init.swift */, 94 | ); 95 | path = Extensions; 96 | sourceTree = ""; 97 | }; 98 | /* End PBXGroup section */ 99 | 100 | /* Begin PBXHeadersBuildPhase section */ 101 | 202E802921F10EEE0086D4A3 /* Headers */ = { 102 | isa = PBXHeadersBuildPhase; 103 | buildActionMask = 2147483647; 104 | files = ( 105 | ); 106 | runOnlyForDeploymentPostprocessing = 0; 107 | }; 108 | /* End PBXHeadersBuildPhase section */ 109 | 110 | /* Begin PBXNativeTarget section */ 111 | 202E802D21F10EEE0086D4A3 /* SliceControl */ = { 112 | isa = PBXNativeTarget; 113 | buildConfigurationList = 202E803621F10EEE0086D4A3 /* Build configuration list for PBXNativeTarget "SliceControl" */; 114 | buildPhases = ( 115 | 202E802921F10EEE0086D4A3 /* Headers */, 116 | 202E802A21F10EEE0086D4A3 /* Sources */, 117 | 202E802B21F10EEE0086D4A3 /* Frameworks */, 118 | 202E802C21F10EEE0086D4A3 /* Resources */, 119 | ); 120 | buildRules = ( 121 | ); 122 | dependencies = ( 123 | ); 124 | name = SliceControl; 125 | productName = SliceControl; 126 | productReference = 202E802E21F10EEE0086D4A3 /* SliceControl.framework */; 127 | productType = "com.apple.product-type.framework"; 128 | }; 129 | /* End PBXNativeTarget section */ 130 | 131 | /* Begin PBXProject section */ 132 | 202E802521F10EEE0086D4A3 /* Project object */ = { 133 | isa = PBXProject; 134 | attributes = { 135 | LastUpgradeCheck = 1010; 136 | ORGANIZATIONNAME = "Pedro Carrasco"; 137 | TargetAttributes = { 138 | 202E802D21F10EEE0086D4A3 = { 139 | CreatedOnToolsVersion = 10.1; 140 | LastSwiftMigration = 1010; 141 | }; 142 | }; 143 | }; 144 | buildConfigurationList = 202E802821F10EEE0086D4A3 /* Build configuration list for PBXProject "SliceControl" */; 145 | compatibilityVersion = "Xcode 9.3"; 146 | developmentRegion = en; 147 | hasScannedForEncodings = 0; 148 | knownRegions = ( 149 | en, 150 | ); 151 | mainGroup = 202E802421F10EEE0086D4A3; 152 | productRefGroup = 202E802F21F10EEE0086D4A3 /* Products */; 153 | projectDirPath = ""; 154 | projectRoot = ""; 155 | targets = ( 156 | 202E802D21F10EEE0086D4A3 /* SliceControl */, 157 | ); 158 | }; 159 | /* End PBXProject section */ 160 | 161 | /* Begin PBXResourcesBuildPhase section */ 162 | 202E802C21F10EEE0086D4A3 /* Resources */ = { 163 | isa = PBXResourcesBuildPhase; 164 | buildActionMask = 2147483647; 165 | files = ( 166 | ); 167 | runOnlyForDeploymentPostprocessing = 0; 168 | }; 169 | /* End PBXResourcesBuildPhase section */ 170 | 171 | /* Begin PBXSourcesBuildPhase section */ 172 | 202E802A21F10EEE0086D4A3 /* Sources */ = { 173 | isa = PBXSourcesBuildPhase; 174 | buildActionMask = 2147483647; 175 | files = ( 176 | 202E803A21F1102A0086D4A3 /* SliceControl.swift in Sources */, 177 | 20F9C3C821F2942400889F7C /* UIView+Rounded.swift in Sources */, 178 | 20F9C3D221F29C1800889F7C /* UIEdgeInsets+Init.swift in Sources */, 179 | 202E803C21F1104B0086D4A3 /* SliceControlDelegate.swift in Sources */, 180 | 20F9C3CE21F29A1D00889F7C /* UIStackView+Add.swift in Sources */, 181 | 20F9C3CC21F2999F00889F7C /* UIView+Add.swift in Sources */, 182 | 202E804221F114EC0086D4A3 /* UILabel+Init.swift in Sources */, 183 | 202E804021F110E50086D4A3 /* NSObject+Create.swift in Sources */, 184 | 20F9C3D021F29B4B00889F7C /* Anchor.swift in Sources */, 185 | 20F9C3CA21F2948600889F7C /* Collection+Clamp.swift in Sources */, 186 | ); 187 | runOnlyForDeploymentPostprocessing = 0; 188 | }; 189 | /* End PBXSourcesBuildPhase section */ 190 | 191 | /* Begin XCBuildConfiguration section */ 192 | 202E803421F10EEE0086D4A3 /* Debug */ = { 193 | isa = XCBuildConfiguration; 194 | buildSettings = { 195 | ALWAYS_SEARCH_USER_PATHS = NO; 196 | CLANG_ANALYZER_NONNULL = YES; 197 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 198 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 199 | CLANG_CXX_LIBRARY = "libc++"; 200 | CLANG_ENABLE_MODULES = YES; 201 | CLANG_ENABLE_OBJC_ARC = YES; 202 | CLANG_ENABLE_OBJC_WEAK = YES; 203 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 204 | CLANG_WARN_BOOL_CONVERSION = YES; 205 | CLANG_WARN_COMMA = YES; 206 | CLANG_WARN_CONSTANT_CONVERSION = YES; 207 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 208 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 209 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 210 | CLANG_WARN_EMPTY_BODY = YES; 211 | CLANG_WARN_ENUM_CONVERSION = YES; 212 | CLANG_WARN_INFINITE_RECURSION = YES; 213 | CLANG_WARN_INT_CONVERSION = YES; 214 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 215 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 216 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 217 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 218 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 219 | CLANG_WARN_STRICT_PROTOTYPES = YES; 220 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 221 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 222 | CLANG_WARN_UNREACHABLE_CODE = YES; 223 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 224 | CODE_SIGN_IDENTITY = "iPhone Developer"; 225 | COPY_PHASE_STRIP = NO; 226 | CURRENT_PROJECT_VERSION = 1; 227 | DEBUG_INFORMATION_FORMAT = dwarf; 228 | ENABLE_STRICT_OBJC_MSGSEND = YES; 229 | ENABLE_TESTABILITY = YES; 230 | GCC_C_LANGUAGE_STANDARD = gnu11; 231 | GCC_DYNAMIC_NO_PIC = NO; 232 | GCC_NO_COMMON_BLOCKS = YES; 233 | GCC_OPTIMIZATION_LEVEL = 0; 234 | GCC_PREPROCESSOR_DEFINITIONS = ( 235 | "DEBUG=1", 236 | "$(inherited)", 237 | ); 238 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 239 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 240 | GCC_WARN_UNDECLARED_SELECTOR = YES; 241 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 242 | GCC_WARN_UNUSED_FUNCTION = YES; 243 | GCC_WARN_UNUSED_VARIABLE = YES; 244 | IPHONEOS_DEPLOYMENT_TARGET = 12.1; 245 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 246 | MTL_FAST_MATH = YES; 247 | ONLY_ACTIVE_ARCH = YES; 248 | SDKROOT = iphoneos; 249 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 250 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 251 | VERSIONING_SYSTEM = "apple-generic"; 252 | VERSION_INFO_PREFIX = ""; 253 | }; 254 | name = Debug; 255 | }; 256 | 202E803521F10EEE0086D4A3 /* Release */ = { 257 | isa = XCBuildConfiguration; 258 | buildSettings = { 259 | ALWAYS_SEARCH_USER_PATHS = NO; 260 | CLANG_ANALYZER_NONNULL = YES; 261 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 262 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 263 | CLANG_CXX_LIBRARY = "libc++"; 264 | CLANG_ENABLE_MODULES = YES; 265 | CLANG_ENABLE_OBJC_ARC = YES; 266 | CLANG_ENABLE_OBJC_WEAK = YES; 267 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 268 | CLANG_WARN_BOOL_CONVERSION = YES; 269 | CLANG_WARN_COMMA = YES; 270 | CLANG_WARN_CONSTANT_CONVERSION = YES; 271 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 272 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 273 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 274 | CLANG_WARN_EMPTY_BODY = YES; 275 | CLANG_WARN_ENUM_CONVERSION = YES; 276 | CLANG_WARN_INFINITE_RECURSION = YES; 277 | CLANG_WARN_INT_CONVERSION = YES; 278 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 279 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 280 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 281 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 282 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 283 | CLANG_WARN_STRICT_PROTOTYPES = YES; 284 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 285 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 286 | CLANG_WARN_UNREACHABLE_CODE = YES; 287 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 288 | CODE_SIGN_IDENTITY = "iPhone Developer"; 289 | COPY_PHASE_STRIP = NO; 290 | CURRENT_PROJECT_VERSION = 1; 291 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 292 | ENABLE_NS_ASSERTIONS = NO; 293 | ENABLE_STRICT_OBJC_MSGSEND = YES; 294 | GCC_C_LANGUAGE_STANDARD = gnu11; 295 | GCC_NO_COMMON_BLOCKS = YES; 296 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 297 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 298 | GCC_WARN_UNDECLARED_SELECTOR = YES; 299 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 300 | GCC_WARN_UNUSED_FUNCTION = YES; 301 | GCC_WARN_UNUSED_VARIABLE = YES; 302 | IPHONEOS_DEPLOYMENT_TARGET = 12.1; 303 | MTL_ENABLE_DEBUG_INFO = NO; 304 | MTL_FAST_MATH = YES; 305 | SDKROOT = iphoneos; 306 | SWIFT_COMPILATION_MODE = wholemodule; 307 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 308 | VALIDATE_PRODUCT = YES; 309 | VERSIONING_SYSTEM = "apple-generic"; 310 | VERSION_INFO_PREFIX = ""; 311 | }; 312 | name = Release; 313 | }; 314 | 202E803721F10EEE0086D4A3 /* Debug */ = { 315 | isa = XCBuildConfiguration; 316 | buildSettings = { 317 | CLANG_ENABLE_MODULES = YES; 318 | CODE_SIGN_IDENTITY = ""; 319 | CODE_SIGN_STYLE = Automatic; 320 | DEFINES_MODULE = YES; 321 | DEVELOPMENT_TEAM = 7GE4Q65N57; 322 | DYLIB_COMPATIBILITY_VERSION = 1; 323 | DYLIB_CURRENT_VERSION = 1; 324 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 325 | INFOPLIST_FILE = SliceControl/Info.plist; 326 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 327 | LD_RUNPATH_SEARCH_PATHS = ( 328 | "$(inherited)", 329 | "@executable_path/Frameworks", 330 | "@loader_path/Frameworks", 331 | ); 332 | PRODUCT_BUNDLE_IDENTIFIER = pedrommcarrasco.SliceControl; 333 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 334 | SKIP_INSTALL = YES; 335 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 336 | SWIFT_VERSION = 4.2; 337 | TARGETED_DEVICE_FAMILY = "1,2"; 338 | }; 339 | name = Debug; 340 | }; 341 | 202E803821F10EEE0086D4A3 /* Release */ = { 342 | isa = XCBuildConfiguration; 343 | buildSettings = { 344 | CLANG_ENABLE_MODULES = YES; 345 | CODE_SIGN_IDENTITY = ""; 346 | CODE_SIGN_STYLE = Automatic; 347 | DEFINES_MODULE = YES; 348 | DEVELOPMENT_TEAM = 7GE4Q65N57; 349 | DYLIB_COMPATIBILITY_VERSION = 1; 350 | DYLIB_CURRENT_VERSION = 1; 351 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 352 | INFOPLIST_FILE = SliceControl/Info.plist; 353 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 354 | LD_RUNPATH_SEARCH_PATHS = ( 355 | "$(inherited)", 356 | "@executable_path/Frameworks", 357 | "@loader_path/Frameworks", 358 | ); 359 | PRODUCT_BUNDLE_IDENTIFIER = pedrommcarrasco.SliceControl; 360 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 361 | SKIP_INSTALL = YES; 362 | SWIFT_VERSION = 4.2; 363 | TARGETED_DEVICE_FAMILY = "1,2"; 364 | }; 365 | name = Release; 366 | }; 367 | /* End XCBuildConfiguration section */ 368 | 369 | /* Begin XCConfigurationList section */ 370 | 202E802821F10EEE0086D4A3 /* Build configuration list for PBXProject "SliceControl" */ = { 371 | isa = XCConfigurationList; 372 | buildConfigurations = ( 373 | 202E803421F10EEE0086D4A3 /* Debug */, 374 | 202E803521F10EEE0086D4A3 /* Release */, 375 | ); 376 | defaultConfigurationIsVisible = 0; 377 | defaultConfigurationName = Release; 378 | }; 379 | 202E803621F10EEE0086D4A3 /* Build configuration list for PBXNativeTarget "SliceControl" */ = { 380 | isa = XCConfigurationList; 381 | buildConfigurations = ( 382 | 202E803721F10EEE0086D4A3 /* Debug */, 383 | 202E803821F10EEE0086D4A3 /* Release */, 384 | ); 385 | defaultConfigurationIsVisible = 0; 386 | defaultConfigurationName = Release; 387 | }; 388 | /* End XCConfigurationList section */ 389 | }; 390 | rootObject = 202E802521F10EEE0086D4A3 /* Project object */; 391 | } 392 | -------------------------------------------------------------------------------- /SliceControl.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SliceControl.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /SliceControl/Core/SliceControl.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SliceControl.swift 3 | // SliceControl 4 | // 5 | // Created by Pedro Carrasco on 17/01/2019. 6 | // Copyright © 2019 Pedro Carrasco. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | // MARK: - SliceControl 12 | public final class SliceControl: UIControl { 13 | 14 | // MARK: Private Outlets 15 | private let optionLabels: [UILabel] 16 | private let selectedView = UIView() 17 | private let stackView: UIStackView = .create { 18 | $0.distribution = .fillEqually 19 | $0.alignment = .fill 20 | $0.isLayoutMarginsRelativeArrangement = true 21 | } 22 | 23 | private var selectedLeadingConstraint: NSLayoutConstraint? 24 | 25 | // MARK: Public Properties 26 | public var selectedIndex: Int { 27 | didSet { 28 | guard optionLabels.indices.contains(selectedIndex) else { return } 29 | animateSelection(for: optionLabels[selectedIndex]) 30 | } 31 | } 32 | public weak var delegate: SliceControlDelegate? 33 | 34 | // MARK: Private Properties 35 | private let primaryColor: UIColor 36 | private let secondaryColor: UIColor 37 | private let padding: CGFloat 38 | private let startIndex: Int 39 | 40 | // MARK: Lifecycle 41 | public init(with options: [String], 42 | primaryColor: UIColor, 43 | secondaryColor: UIColor, 44 | font: UIFont? = nil, 45 | padding: CGFloat, 46 | startAt index: Int = 0) { 47 | 48 | self.optionLabels = options.map { return UILabel(with: $0, textColor: secondaryColor, font: font) } 49 | self.primaryColor = primaryColor 50 | self.secondaryColor = secondaryColor 51 | self.padding = padding 52 | self.startIndex = index 53 | self.selectedIndex = index 54 | 55 | super.init(frame: .zero) 56 | 57 | configure(with: index) 58 | } 59 | 60 | required init?(coder aDecoder: NSCoder) { 61 | fatalError("init(coder:) has not been implemented") 62 | } 63 | 64 | override public func layoutSubviews() { 65 | super.layoutSubviews() 66 | selectedView.withRoundedCorners() 67 | } 68 | } 69 | 70 | // MARK: - Actions 71 | extension SliceControl { 72 | 73 | override public func beginTracking(_ touch: UITouch, with event: UIEvent?) -> Bool { 74 | let location = touch.location(in: self) 75 | guard let selectedLabel = optionLabels.first(where: { $0.frame.contains(location) }) else { return false } 76 | selected(item: selectedLabel) 77 | sendActions(for: .valueChanged) 78 | 79 | return false 80 | } 81 | } 82 | 83 | // MARK: - Configuration 84 | private extension SliceControl { 85 | 86 | func configure(with startingIndex: Int) { 87 | addSubviews() 88 | defineConstraints(with: startingIndex) 89 | setupSubviews(with: startingIndex) 90 | } 91 | 92 | func addSubviews() { 93 | stackView.addArrangedSubviews(optionLabels) 94 | addSubviews(selectedView, stackView) 95 | } 96 | 97 | func defineConstraints(with startingIndex: Int) { 98 | stackView.topAnchor.constrain(to: topAnchor) 99 | stackView.bottomAnchor.constrain(to: bottomAnchor) 100 | stackView.leadingAnchor.constrain(to: leadingAnchor) 101 | stackView.trailingAnchor.constrain(to: trailingAnchor) 102 | 103 | selectedView.topAnchor.constrain(to: stackView.layoutMarginsGuide.topAnchor) 104 | selectedView.bottomAnchor.constrain(to: stackView.layoutMarginsGuide.bottomAnchor) 105 | selectedView.widthAnchor.constrain(to: stackView.layoutMarginsGuide.widthAnchor, multiplyBy: 1 / CGFloat(optionLabels.count)) 106 | selectedLeadingConstraint = selectedView.leadingAnchor.constrain(to: optionLabels.element(forClamped: startingIndex).leadingAnchor) 107 | } 108 | 109 | func setupSubviews(with startingIndex: Int) { 110 | subviews.forEach { $0.isUserInteractionEnabled = false } 111 | backgroundColor = primaryColor 112 | selectedView.backgroundColor = secondaryColor 113 | optionLabels.element(forClamped: startingIndex).textColor = primaryColor 114 | stackView.layoutMargins = UIEdgeInsets(with: padding) 115 | } 116 | } 117 | 118 | // MARK: - Animation 119 | private extension SliceControl { 120 | 121 | enum Animation { 122 | static let duration = 0.33 123 | static let delay: TimeInterval = 0.0 124 | static let damping: CGFloat = 0.7 125 | static let velocity: CGFloat = 0.7 126 | } 127 | 128 | func selected(item: UILabel) { 129 | guard let index = optionLabels.index(of: item) else { return } 130 | selectedIndex = index 131 | delegate?.sliceControl(self, didSelectItemAt: index) 132 | } 133 | 134 | func animateSelection(for item: UILabel) { 135 | updateLeadingContraint(with: item) 136 | let animation: () -> Void = { [weak self] in self?.layoutIfNeeded() } 137 | UIView.animate(withDuration: Animation.duration, 138 | delay: Animation.delay, 139 | usingSpringWithDamping: Animation.damping, 140 | initialSpringVelocity: Animation.velocity, 141 | options: .curveEaseOut, 142 | animations: animation, 143 | completion: nil) 144 | 145 | optionLabels.forEach { $0.textColor = secondaryColor } 146 | let textAnimation = { [weak self] in item.textColor = self?.primaryColor } 147 | UIView.transition(with: item, 148 | duration: Animation.duration, 149 | options: .transitionCrossDissolve, 150 | animations: textAnimation, 151 | completion: nil) 152 | } 153 | 154 | func updateLeadingContraint(with item: UILabel) { 155 | selectedLeadingConstraint?.isActive = false 156 | selectedLeadingConstraint = selectedView.leadingAnchor.constrain(to: item.leadingAnchor) 157 | } 158 | } 159 | -------------------------------------------------------------------------------- /SliceControl/Core/SliceControlDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SliceControlDelegate.swift 3 | // SliceControl 4 | // 5 | // Created by Pedro Carrasco on 17/01/2019. 6 | // Copyright © 2019 Pedro Carrasco. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | // MARK: - SliceControlDelegate 12 | public protocol SliceControlDelegate: class { 13 | func sliceControl(_ sliceControl: SliceControl, didSelectItemAt index: Int) 14 | } 15 | -------------------------------------------------------------------------------- /SliceControl/Extensions/Anchor.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Anchor.swift 3 | // SliceControl 4 | // 5 | // Created by Pedro Carrasco on 07/10/2018. 6 | // Copyright © 2018 Pedro Carrasco. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @objc extension NSLayoutAnchor { 12 | 13 | @discardableResult 14 | func constrain(_ relation: NSLayoutConstraint.Relation = .equal, 15 | to anchor: NSLayoutAnchor, 16 | with constant: CGFloat = 0.0, 17 | prioritizeAs priority: UILayoutPriority = .required, 18 | isActive: Bool = true) -> NSLayoutConstraint { 19 | 20 | var constraint: NSLayoutConstraint 21 | 22 | switch relation { 23 | case .equal: 24 | constraint = self.constraint(equalTo: anchor, constant: constant) 25 | 26 | case .greaterThanOrEqual: 27 | constraint = self.constraint(greaterThanOrEqualTo: anchor, constant: constant) 28 | 29 | case .lessThanOrEqual: 30 | constraint = self.constraint(lessThanOrEqualTo: anchor, constant: constant) 31 | } 32 | 33 | constraint.set(priority: priority, isActive: isActive) 34 | 35 | return constraint 36 | } 37 | } 38 | 39 | extension NSLayoutDimension { 40 | 41 | @discardableResult 42 | func constrain(_ relation: NSLayoutConstraint.Relation = .equal, 43 | to constant: CGFloat = 0.0, 44 | prioritizeAs priority: UILayoutPriority = .required, 45 | isActive: Bool = true) -> NSLayoutConstraint { 46 | 47 | var constraint: NSLayoutConstraint 48 | 49 | switch relation { 50 | case .equal: 51 | constraint = self.constraint(equalToConstant: constant) 52 | 53 | case .greaterThanOrEqual: 54 | constraint = self.constraint(greaterThanOrEqualToConstant: constant) 55 | 56 | case .lessThanOrEqual: 57 | constraint = self.constraint(lessThanOrEqualToConstant: constant) 58 | } 59 | 60 | constraint.set(priority: priority, isActive: isActive) 61 | 62 | return constraint 63 | } 64 | 65 | @discardableResult 66 | func constrain(_ relation: NSLayoutConstraint.Relation = .equal, 67 | to anchor: NSLayoutDimension, 68 | with constant: CGFloat = 0.0, 69 | multiplyBy multiplier: CGFloat = 1.0, 70 | prioritizeAs priority: UILayoutPriority = .required, 71 | isActive: Bool = true) -> NSLayoutConstraint { 72 | 73 | var constraint: NSLayoutConstraint 74 | 75 | switch relation { 76 | case .equal: 77 | constraint = self.constraint(equalTo: anchor, multiplier: multiplier, constant: constant) 78 | 79 | case .greaterThanOrEqual: 80 | constraint = self.constraint(greaterThanOrEqualTo: anchor, multiplier: multiplier, constant: constant) 81 | 82 | case .lessThanOrEqual: 83 | constraint = self.constraint(lessThanOrEqualTo: anchor, multiplier: multiplier, constant: constant) 84 | } 85 | 86 | constraint.set(priority: priority, isActive: isActive) 87 | 88 | return constraint 89 | } 90 | } 91 | 92 | fileprivate extension NSLayoutConstraint { 93 | 94 | func set(priority: UILayoutPriority, isActive: Bool) { 95 | 96 | self.priority = priority 97 | self.isActive = isActive 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /SliceControl/Extensions/Collection+Clamp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Collection+Clamp.swift 3 | // SliceControl 4 | // 5 | // Created by Pedro Carrasco on 18/01/2019. 6 | // Copyright © 2019 Pedro Carrasco. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | // MARK: - Clamp 12 | extension Collection where Index == Int { 13 | 14 | func element(forClamped index: Index) -> Element { 15 | return self[Swift.min(Swift.max(index, 0), count - 1)] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /SliceControl/Extensions/NSObject+Create.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+Create.swift 3 | // SliceControl 4 | // 5 | // Created by Pedro Carrasco on 17/01/2019. 6 | // Copyright © 2019 Pedro Carrasco. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | // MARK: - Create 12 | extension NSObject { 13 | 14 | static func create(_ setup: ((T) -> Void)) -> T where T: NSObject { 15 | 16 | let obj = T() 17 | setup(obj) 18 | return obj 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /SliceControl/Extensions/UIEdgeInsets+Init.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIEdgeInsets+Init.swift 3 | // SliceControl 4 | // 5 | // Created by Pedro Carrasco on 18/01/2019. 6 | // Copyright © 2019 Pedro Carrasco. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | // MARK: - Init 12 | extension UIEdgeInsets { 13 | 14 | init(with padding: CGFloat) { 15 | self.init(top: padding, left: padding, bottom: padding, right: padding) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /SliceControl/Extensions/UILabel+Init.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UILabel+Init.swift 3 | // SliceControl 4 | // 5 | // Created by Pedro Carrasco on 17/01/2019. 6 | // Copyright © 2019 Pedro Carrasco. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | // MARK: - Init 12 | extension UILabel { 13 | 14 | convenience init(with text: String, textColor: UIColor, font: UIFont?) { 15 | self.init() 16 | self.text = text 17 | self.textColor = textColor 18 | self.textAlignment = .center 19 | self.adjustsFontSizeToFitWidth = true 20 | if let font = font { self.font = font } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /SliceControl/Extensions/UIStackView+Add.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIStackView+Add.swift 3 | // SliceControl 4 | // 5 | // Created by Pedro Carrasco on 18/01/2019. 6 | // Copyright © 2019 Pedro Carrasco. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | // MARK: - Add 12 | extension UIStackView { 13 | 14 | func addArrangedSubviews(_ views: [UIView]) { 15 | views.forEach { addArrangedSubview($0) } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /SliceControl/Extensions/UIView+Add.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Add.swift 3 | // SliceControl 4 | // 5 | // Created by Pedro Carrasco on 18/01/2019. 6 | // Copyright © 2019 Pedro Carrasco. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | // MARK: - Add 12 | extension UIView { 13 | 14 | func addSubviews(_ views: UIView...) { 15 | views.forEach { 16 | addSubview($0) 17 | $0.translatesAutoresizingMaskIntoConstraints = false 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /SliceControl/Extensions/UIView+Rounded.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Rounded.swift 3 | // SliceControl 4 | // 5 | // Created by Pedro Carrasco on 18/01/2019. 6 | // Copyright © 2019 Pedro Carrasco. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | // MARK: - Rounded 12 | extension UIView { 13 | 14 | func withRoundedCorners() { 15 | layer.cornerRadius = bounds.height / 2 16 | layer.masksToBounds = true 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /SliceControl/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 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 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | 22 | 23 | -------------------------------------------------------------------------------- /logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pedrommcarrasco/SliceControl/de2a54d25b85b13ae8c10730e4e58638803b0353/logo.gif --------------------------------------------------------------------------------