├── .gitignore ├── Example ├── MultipleSelectionPickerView.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── MultipleSelectionPickerView.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── MultipleSelectionPickerView │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ ├── Contents.json │ │ └── selectedCheckmark.imageset │ │ │ ├── Contents.json │ │ │ ├── selectedCheckmark-1.png │ │ │ ├── selectedCheckmark-2.png │ │ │ └── selectedCheckmark.png │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── DataForPicker.swift │ ├── Info.plist │ ├── Resources │ │ ├── State.swift │ │ ├── USState.swift │ │ └── USStates.json │ └── ViewController.swift ├── Podfile ├── Podfile.lock └── Pods │ ├── Manifest.lock │ ├── MultiPickerView │ ├── LICENSE │ ├── README.md │ ├── Resources │ │ ├── SelectionView.xib │ │ └── selectedCheckmark.png │ └── Sources │ │ ├── DatePickerViewHandler.swift │ │ ├── MultipleSelectionPickerScrollHelper.swift │ │ ├── MultipleSelectionPickerViewHandler.swift │ │ ├── PickerView.swift │ │ ├── PickerViewHandler.swift │ │ ├── SelectionView.swift │ │ └── UIView+Shake.swift │ ├── Pods.xcodeproj │ └── project.pbxproj │ ├── SwiftyJSON │ ├── LICENSE │ ├── README.md │ └── Source │ │ └── SwiftyJSON.swift │ └── Target Support Files │ ├── MultiPickerView │ ├── Info.plist │ ├── MultiPickerView-dummy.m │ ├── MultiPickerView-prefix.pch │ ├── MultiPickerView-umbrella.h │ ├── MultiPickerView.modulemap │ └── MultiPickerView.xcconfig │ ├── Pods-MultipleSelectionPickerView │ ├── Info.plist │ ├── Pods-MultipleSelectionPickerView-acknowledgements.markdown │ ├── Pods-MultipleSelectionPickerView-acknowledgements.plist │ ├── Pods-MultipleSelectionPickerView-dummy.m │ ├── Pods-MultipleSelectionPickerView-frameworks.sh │ ├── Pods-MultipleSelectionPickerView-resources.sh │ ├── Pods-MultipleSelectionPickerView-umbrella.h │ ├── Pods-MultipleSelectionPickerView.debug.xcconfig │ ├── Pods-MultipleSelectionPickerView.modulemap │ └── Pods-MultipleSelectionPickerView.release.xcconfig │ └── SwiftyJSON │ ├── Info.plist │ ├── SwiftyJSON-dummy.m │ ├── SwiftyJSON-prefix.pch │ ├── SwiftyJSON-umbrella.h │ ├── SwiftyJSON.modulemap │ └── SwiftyJSON.xcconfig ├── Info └── gif0.gif ├── LICENSE ├── MultiPickerView.podspec ├── README.md ├── Resources ├── SelectionView.xib └── selectedCheckmark.png └── Sources ├── DatePickerViewHandler.swift ├── MultipleSelectionPickerScrollHelper.swift ├── MultipleSelectionPickerViewHandler.swift ├── PickerView.swift ├── PickerViewHandler.swift ├── SelectionView.swift └── UIView+Shake.swift /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata 15 | *.xccheckout 16 | *.xcscmblueprint 17 | *.moved-aside 18 | *.xcuserstate 19 | *.xcuserdatad 20 | DerivedData 21 | *.hmap 22 | *.ipa 23 | *.gcno 24 | *.gcda 25 | -------------------------------------------------------------------------------- /Example/MultipleSelectionPickerView.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 53C282CB09CA2C6E3AB868E3 /* Pods_MultipleSelectionPickerView.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D9DD0B93C58117EB884A9735 /* Pods_MultipleSelectionPickerView.framework */; }; 11 | AEA6BCEA20F3BF4D009FAEE7 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEA6BCE920F3BF4D009FAEE7 /* AppDelegate.swift */; }; 12 | AEA6BCEC20F3BF4D009FAEE7 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEA6BCEB20F3BF4D009FAEE7 /* ViewController.swift */; }; 13 | AEA6BCEF20F3BF4D009FAEE7 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AEA6BCED20F3BF4D009FAEE7 /* Main.storyboard */; }; 14 | AEA6BCF120F3BF4F009FAEE7 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = AEA6BCF020F3BF4F009FAEE7 /* Assets.xcassets */; }; 15 | AEA6BCF420F3BF4F009FAEE7 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AEA6BCF220F3BF4F009FAEE7 /* LaunchScreen.storyboard */; }; 16 | AEA6BD0920F3C009009FAEE7 /* USState.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEA6BD0020F3C009009FAEE7 /* USState.swift */; }; 17 | AEA6BD1020F3C41B009FAEE7 /* USStates.json in Resources */ = {isa = PBXBuildFile; fileRef = AEA6BD0F20F3C41B009FAEE7 /* USStates.json */; }; 18 | AEA6BD1220F3C514009FAEE7 /* State.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEA6BD1120F3C514009FAEE7 /* State.swift */; }; 19 | AEA6BD1420F3C6F4009FAEE7 /* DataForPicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEA6BD1320F3C6F4009FAEE7 /* DataForPicker.swift */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXFileReference section */ 23 | 26A1CEF6A234278C35BA8198 /* Pods-MultipleSelectionPickerView.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MultipleSelectionPickerView.release.xcconfig"; path = "Pods/Target Support Files/Pods-MultipleSelectionPickerView/Pods-MultipleSelectionPickerView.release.xcconfig"; sourceTree = ""; }; 24 | AEA6BCE620F3BF4D009FAEE7 /* MultipleSelectionPickerView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MultipleSelectionPickerView.app; sourceTree = BUILT_PRODUCTS_DIR; }; 25 | AEA6BCE920F3BF4D009FAEE7 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 26 | AEA6BCEB20F3BF4D009FAEE7 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 27 | AEA6BCEE20F3BF4D009FAEE7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 28 | AEA6BCF020F3BF4F009FAEE7 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 29 | AEA6BCF320F3BF4F009FAEE7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 30 | AEA6BCF520F3BF4F009FAEE7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 31 | AEA6BD0020F3C009009FAEE7 /* USState.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = USState.swift; sourceTree = ""; }; 32 | AEA6BD0F20F3C41B009FAEE7 /* USStates.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = USStates.json; sourceTree = ""; }; 33 | AEA6BD1120F3C514009FAEE7 /* State.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = State.swift; sourceTree = ""; }; 34 | AEA6BD1320F3C6F4009FAEE7 /* DataForPicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataForPicker.swift; sourceTree = ""; }; 35 | C34A3A72ABCC49279DD7F634 /* Pods-MultipleSelectionPickerView.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MultipleSelectionPickerView.debug.xcconfig"; path = "Pods/Target Support Files/Pods-MultipleSelectionPickerView/Pods-MultipleSelectionPickerView.debug.xcconfig"; sourceTree = ""; }; 36 | D9DD0B93C58117EB884A9735 /* Pods_MultipleSelectionPickerView.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MultipleSelectionPickerView.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 37 | /* End PBXFileReference section */ 38 | 39 | /* Begin PBXFrameworksBuildPhase section */ 40 | AEA6BCE320F3BF4D009FAEE7 /* Frameworks */ = { 41 | isa = PBXFrameworksBuildPhase; 42 | buildActionMask = 2147483647; 43 | files = ( 44 | 53C282CB09CA2C6E3AB868E3 /* Pods_MultipleSelectionPickerView.framework in Frameworks */, 45 | ); 46 | runOnlyForDeploymentPostprocessing = 0; 47 | }; 48 | /* End PBXFrameworksBuildPhase section */ 49 | 50 | /* Begin PBXGroup section */ 51 | 20B9789B0EFB2F3CD79223A9 /* Frameworks */ = { 52 | isa = PBXGroup; 53 | children = ( 54 | D9DD0B93C58117EB884A9735 /* Pods_MultipleSelectionPickerView.framework */, 55 | ); 56 | name = Frameworks; 57 | sourceTree = ""; 58 | }; 59 | 79EF1856B775D6CE1FEC64A1 /* Pods */ = { 60 | isa = PBXGroup; 61 | children = ( 62 | C34A3A72ABCC49279DD7F634 /* Pods-MultipleSelectionPickerView.debug.xcconfig */, 63 | 26A1CEF6A234278C35BA8198 /* Pods-MultipleSelectionPickerView.release.xcconfig */, 64 | ); 65 | name = Pods; 66 | sourceTree = ""; 67 | }; 68 | AEA6BCDD20F3BF4D009FAEE7 = { 69 | isa = PBXGroup; 70 | children = ( 71 | AEA6BCE820F3BF4D009FAEE7 /* MultipleSelectionPickerView */, 72 | AEA6BCE720F3BF4D009FAEE7 /* Products */, 73 | 79EF1856B775D6CE1FEC64A1 /* Pods */, 74 | 20B9789B0EFB2F3CD79223A9 /* Frameworks */, 75 | ); 76 | sourceTree = ""; 77 | }; 78 | AEA6BCE720F3BF4D009FAEE7 /* Products */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | AEA6BCE620F3BF4D009FAEE7 /* MultipleSelectionPickerView.app */, 82 | ); 83 | name = Products; 84 | sourceTree = ""; 85 | }; 86 | AEA6BCE820F3BF4D009FAEE7 /* MultipleSelectionPickerView */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | AEA6BCFF20F3C009009FAEE7 /* Resources */, 90 | AEA6BCE920F3BF4D009FAEE7 /* AppDelegate.swift */, 91 | AEA6BD1320F3C6F4009FAEE7 /* DataForPicker.swift */, 92 | AEA6BCEB20F3BF4D009FAEE7 /* ViewController.swift */, 93 | AEA6BCED20F3BF4D009FAEE7 /* Main.storyboard */, 94 | AEA6BCF020F3BF4F009FAEE7 /* Assets.xcassets */, 95 | AEA6BCF220F3BF4F009FAEE7 /* LaunchScreen.storyboard */, 96 | AEA6BCF520F3BF4F009FAEE7 /* Info.plist */, 97 | ); 98 | path = MultipleSelectionPickerView; 99 | sourceTree = ""; 100 | }; 101 | AEA6BCFF20F3C009009FAEE7 /* Resources */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | AEA6BD0020F3C009009FAEE7 /* USState.swift */, 105 | AEA6BD0F20F3C41B009FAEE7 /* USStates.json */, 106 | AEA6BD1120F3C514009FAEE7 /* State.swift */, 107 | ); 108 | path = Resources; 109 | sourceTree = ""; 110 | }; 111 | /* End PBXGroup section */ 112 | 113 | /* Begin PBXNativeTarget section */ 114 | AEA6BCE520F3BF4D009FAEE7 /* MultipleSelectionPickerView */ = { 115 | isa = PBXNativeTarget; 116 | buildConfigurationList = AEA6BCF820F3BF4F009FAEE7 /* Build configuration list for PBXNativeTarget "MultipleSelectionPickerView" */; 117 | buildPhases = ( 118 | 24A7A6A2AD3E4E4676F2E2A8 /* [CP] Check Pods Manifest.lock */, 119 | AEA6BCE220F3BF4D009FAEE7 /* Sources */, 120 | AEA6BCE320F3BF4D009FAEE7 /* Frameworks */, 121 | AEA6BCE420F3BF4D009FAEE7 /* Resources */, 122 | 3E4D5646A9F57C0E166D7ED1 /* [CP] Embed Pods Frameworks */, 123 | ); 124 | buildRules = ( 125 | ); 126 | dependencies = ( 127 | ); 128 | name = MultipleSelectionPickerView; 129 | productName = MultipleSelectionPickerView; 130 | productReference = AEA6BCE620F3BF4D009FAEE7 /* MultipleSelectionPickerView.app */; 131 | productType = "com.apple.product-type.application"; 132 | }; 133 | /* End PBXNativeTarget section */ 134 | 135 | /* Begin PBXProject section */ 136 | AEA6BCDE20F3BF4D009FAEE7 /* Project object */ = { 137 | isa = PBXProject; 138 | attributes = { 139 | LastSwiftUpdateCheck = 0940; 140 | LastUpgradeCheck = 0940; 141 | ORGANIZATIONNAME = "Hayk Brsoyan"; 142 | TargetAttributes = { 143 | AEA6BCE520F3BF4D009FAEE7 = { 144 | CreatedOnToolsVersion = 9.4; 145 | }; 146 | }; 147 | }; 148 | buildConfigurationList = AEA6BCE120F3BF4D009FAEE7 /* Build configuration list for PBXProject "MultipleSelectionPickerView" */; 149 | compatibilityVersion = "Xcode 9.3"; 150 | developmentRegion = en; 151 | hasScannedForEncodings = 0; 152 | knownRegions = ( 153 | en, 154 | Base, 155 | ); 156 | mainGroup = AEA6BCDD20F3BF4D009FAEE7; 157 | productRefGroup = AEA6BCE720F3BF4D009FAEE7 /* Products */; 158 | projectDirPath = ""; 159 | projectRoot = ""; 160 | targets = ( 161 | AEA6BCE520F3BF4D009FAEE7 /* MultipleSelectionPickerView */, 162 | ); 163 | }; 164 | /* End PBXProject section */ 165 | 166 | /* Begin PBXResourcesBuildPhase section */ 167 | AEA6BCE420F3BF4D009FAEE7 /* Resources */ = { 168 | isa = PBXResourcesBuildPhase; 169 | buildActionMask = 2147483647; 170 | files = ( 171 | AEA6BCF420F3BF4F009FAEE7 /* LaunchScreen.storyboard in Resources */, 172 | AEA6BD1020F3C41B009FAEE7 /* USStates.json in Resources */, 173 | AEA6BCF120F3BF4F009FAEE7 /* Assets.xcassets in Resources */, 174 | AEA6BCEF20F3BF4D009FAEE7 /* Main.storyboard in Resources */, 175 | ); 176 | runOnlyForDeploymentPostprocessing = 0; 177 | }; 178 | /* End PBXResourcesBuildPhase section */ 179 | 180 | /* Begin PBXShellScriptBuildPhase section */ 181 | 24A7A6A2AD3E4E4676F2E2A8 /* [CP] Check Pods Manifest.lock */ = { 182 | isa = PBXShellScriptBuildPhase; 183 | buildActionMask = 2147483647; 184 | files = ( 185 | ); 186 | inputPaths = ( 187 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 188 | "${PODS_ROOT}/Manifest.lock", 189 | ); 190 | name = "[CP] Check Pods Manifest.lock"; 191 | outputPaths = ( 192 | "$(DERIVED_FILE_DIR)/Pods-MultipleSelectionPickerView-checkManifestLockResult.txt", 193 | ); 194 | runOnlyForDeploymentPostprocessing = 0; 195 | shellPath = /bin/sh; 196 | 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"; 197 | showEnvVarsInLog = 0; 198 | }; 199 | 3E4D5646A9F57C0E166D7ED1 /* [CP] Embed Pods Frameworks */ = { 200 | isa = PBXShellScriptBuildPhase; 201 | buildActionMask = 2147483647; 202 | files = ( 203 | ); 204 | inputPaths = ( 205 | "${SRCROOT}/Pods/Target Support Files/Pods-MultipleSelectionPickerView/Pods-MultipleSelectionPickerView-frameworks.sh", 206 | "${BUILT_PRODUCTS_DIR}/MultiPickerView/MultiPickerView.framework", 207 | "${BUILT_PRODUCTS_DIR}/SwiftyJSON/SwiftyJSON.framework", 208 | ); 209 | name = "[CP] Embed Pods Frameworks"; 210 | outputPaths = ( 211 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MultiPickerView.framework", 212 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyJSON.framework", 213 | ); 214 | runOnlyForDeploymentPostprocessing = 0; 215 | shellPath = /bin/sh; 216 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-MultipleSelectionPickerView/Pods-MultipleSelectionPickerView-frameworks.sh\"\n"; 217 | showEnvVarsInLog = 0; 218 | }; 219 | /* End PBXShellScriptBuildPhase section */ 220 | 221 | /* Begin PBXSourcesBuildPhase section */ 222 | AEA6BCE220F3BF4D009FAEE7 /* Sources */ = { 223 | isa = PBXSourcesBuildPhase; 224 | buildActionMask = 2147483647; 225 | files = ( 226 | AEA6BD1420F3C6F4009FAEE7 /* DataForPicker.swift in Sources */, 227 | AEA6BCEC20F3BF4D009FAEE7 /* ViewController.swift in Sources */, 228 | AEA6BD1220F3C514009FAEE7 /* State.swift in Sources */, 229 | AEA6BD0920F3C009009FAEE7 /* USState.swift in Sources */, 230 | AEA6BCEA20F3BF4D009FAEE7 /* AppDelegate.swift in Sources */, 231 | ); 232 | runOnlyForDeploymentPostprocessing = 0; 233 | }; 234 | /* End PBXSourcesBuildPhase section */ 235 | 236 | /* Begin PBXVariantGroup section */ 237 | AEA6BCED20F3BF4D009FAEE7 /* Main.storyboard */ = { 238 | isa = PBXVariantGroup; 239 | children = ( 240 | AEA6BCEE20F3BF4D009FAEE7 /* Base */, 241 | ); 242 | name = Main.storyboard; 243 | sourceTree = ""; 244 | }; 245 | AEA6BCF220F3BF4F009FAEE7 /* LaunchScreen.storyboard */ = { 246 | isa = PBXVariantGroup; 247 | children = ( 248 | AEA6BCF320F3BF4F009FAEE7 /* Base */, 249 | ); 250 | name = LaunchScreen.storyboard; 251 | sourceTree = ""; 252 | }; 253 | /* End PBXVariantGroup section */ 254 | 255 | /* Begin XCBuildConfiguration section */ 256 | AEA6BCF620F3BF4F009FAEE7 /* Debug */ = { 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 | DEBUG_INFORMATION_FORMAT = dwarf; 291 | ENABLE_STRICT_OBJC_MSGSEND = YES; 292 | ENABLE_TESTABILITY = YES; 293 | GCC_C_LANGUAGE_STANDARD = gnu11; 294 | GCC_DYNAMIC_NO_PIC = NO; 295 | GCC_NO_COMMON_BLOCKS = YES; 296 | GCC_OPTIMIZATION_LEVEL = 0; 297 | GCC_PREPROCESSOR_DEFINITIONS = ( 298 | "DEBUG=1", 299 | "$(inherited)", 300 | ); 301 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 302 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 303 | GCC_WARN_UNDECLARED_SELECTOR = YES; 304 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 305 | GCC_WARN_UNUSED_FUNCTION = YES; 306 | GCC_WARN_UNUSED_VARIABLE = YES; 307 | IPHONEOS_DEPLOYMENT_TARGET = 11.4; 308 | MTL_ENABLE_DEBUG_INFO = YES; 309 | ONLY_ACTIVE_ARCH = YES; 310 | SDKROOT = iphoneos; 311 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 312 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 313 | }; 314 | name = Debug; 315 | }; 316 | AEA6BCF720F3BF4F009FAEE7 /* Release */ = { 317 | isa = XCBuildConfiguration; 318 | buildSettings = { 319 | ALWAYS_SEARCH_USER_PATHS = NO; 320 | CLANG_ANALYZER_NONNULL = YES; 321 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 322 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 323 | CLANG_CXX_LIBRARY = "libc++"; 324 | CLANG_ENABLE_MODULES = YES; 325 | CLANG_ENABLE_OBJC_ARC = YES; 326 | CLANG_ENABLE_OBJC_WEAK = YES; 327 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 328 | CLANG_WARN_BOOL_CONVERSION = YES; 329 | CLANG_WARN_COMMA = YES; 330 | CLANG_WARN_CONSTANT_CONVERSION = YES; 331 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 332 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 333 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 334 | CLANG_WARN_EMPTY_BODY = YES; 335 | CLANG_WARN_ENUM_CONVERSION = YES; 336 | CLANG_WARN_INFINITE_RECURSION = YES; 337 | CLANG_WARN_INT_CONVERSION = YES; 338 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 339 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 340 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 341 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 342 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 343 | CLANG_WARN_STRICT_PROTOTYPES = YES; 344 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 345 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 346 | CLANG_WARN_UNREACHABLE_CODE = YES; 347 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 348 | CODE_SIGN_IDENTITY = "iPhone Developer"; 349 | COPY_PHASE_STRIP = NO; 350 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 351 | ENABLE_NS_ASSERTIONS = NO; 352 | ENABLE_STRICT_OBJC_MSGSEND = YES; 353 | GCC_C_LANGUAGE_STANDARD = gnu11; 354 | GCC_NO_COMMON_BLOCKS = YES; 355 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 356 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 357 | GCC_WARN_UNDECLARED_SELECTOR = YES; 358 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 359 | GCC_WARN_UNUSED_FUNCTION = YES; 360 | GCC_WARN_UNUSED_VARIABLE = YES; 361 | IPHONEOS_DEPLOYMENT_TARGET = 11.4; 362 | MTL_ENABLE_DEBUG_INFO = NO; 363 | SDKROOT = iphoneos; 364 | SWIFT_COMPILATION_MODE = wholemodule; 365 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 366 | VALIDATE_PRODUCT = YES; 367 | }; 368 | name = Release; 369 | }; 370 | AEA6BCF920F3BF4F009FAEE7 /* Debug */ = { 371 | isa = XCBuildConfiguration; 372 | baseConfigurationReference = C34A3A72ABCC49279DD7F634 /* Pods-MultipleSelectionPickerView.debug.xcconfig */; 373 | buildSettings = { 374 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 375 | CODE_SIGN_STYLE = Automatic; 376 | DEVELOPMENT_TEAM = 4Y57LJ5S9U; 377 | INFOPLIST_FILE = MultipleSelectionPickerView/Info.plist; 378 | LD_RUNPATH_SEARCH_PATHS = ( 379 | "$(inherited)", 380 | "@executable_path/Frameworks", 381 | ); 382 | PRODUCT_BUNDLE_IDENTIFIER = "Hayk-Brsoyan.MultipleSelectionPickerView"; 383 | PRODUCT_NAME = "$(TARGET_NAME)"; 384 | SWIFT_VERSION = 4.0; 385 | TARGETED_DEVICE_FAMILY = "1,2"; 386 | }; 387 | name = Debug; 388 | }; 389 | AEA6BCFA20F3BF4F009FAEE7 /* Release */ = { 390 | isa = XCBuildConfiguration; 391 | baseConfigurationReference = 26A1CEF6A234278C35BA8198 /* Pods-MultipleSelectionPickerView.release.xcconfig */; 392 | buildSettings = { 393 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 394 | CODE_SIGN_STYLE = Automatic; 395 | DEVELOPMENT_TEAM = 4Y57LJ5S9U; 396 | INFOPLIST_FILE = MultipleSelectionPickerView/Info.plist; 397 | LD_RUNPATH_SEARCH_PATHS = ( 398 | "$(inherited)", 399 | "@executable_path/Frameworks", 400 | ); 401 | PRODUCT_BUNDLE_IDENTIFIER = "Hayk-Brsoyan.MultipleSelectionPickerView"; 402 | PRODUCT_NAME = "$(TARGET_NAME)"; 403 | SWIFT_VERSION = 4.0; 404 | TARGETED_DEVICE_FAMILY = "1,2"; 405 | }; 406 | name = Release; 407 | }; 408 | /* End XCBuildConfiguration section */ 409 | 410 | /* Begin XCConfigurationList section */ 411 | AEA6BCE120F3BF4D009FAEE7 /* Build configuration list for PBXProject "MultipleSelectionPickerView" */ = { 412 | isa = XCConfigurationList; 413 | buildConfigurations = ( 414 | AEA6BCF620F3BF4F009FAEE7 /* Debug */, 415 | AEA6BCF720F3BF4F009FAEE7 /* Release */, 416 | ); 417 | defaultConfigurationIsVisible = 0; 418 | defaultConfigurationName = Release; 419 | }; 420 | AEA6BCF820F3BF4F009FAEE7 /* Build configuration list for PBXNativeTarget "MultipleSelectionPickerView" */ = { 421 | isa = XCConfigurationList; 422 | buildConfigurations = ( 423 | AEA6BCF920F3BF4F009FAEE7 /* Debug */, 424 | AEA6BCFA20F3BF4F009FAEE7 /* Release */, 425 | ); 426 | defaultConfigurationIsVisible = 0; 427 | defaultConfigurationName = Release; 428 | }; 429 | /* End XCConfigurationList section */ 430 | }; 431 | rootObject = AEA6BCDE20F3BF4D009FAEE7 /* Project object */; 432 | } 433 | -------------------------------------------------------------------------------- /Example/MultipleSelectionPickerView.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/MultipleSelectionPickerView.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/MultipleSelectionPickerView.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/MultipleSelectionPickerView.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/MultipleSelectionPickerView/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // MultipleSelectionPickerView 4 | // 5 | // Created by Hayk Brsoyan on 7/9/18. 6 | // Copyright © 2018 Hayk Brsoyan. 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/MultipleSelectionPickerView/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/MultipleSelectionPickerView/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Example/MultipleSelectionPickerView/Assets.xcassets/selectedCheckmark.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "selectedCheckmark.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "selectedCheckmark-1.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "selectedCheckmark-2.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Example/MultipleSelectionPickerView/Assets.xcassets/selectedCheckmark.imageset/selectedCheckmark-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Brsoyan/Multiple-Selection-Picker/fd0d416f0f27c3698cdda61e64ebbc3e9b7f13c1/Example/MultipleSelectionPickerView/Assets.xcassets/selectedCheckmark.imageset/selectedCheckmark-1.png -------------------------------------------------------------------------------- /Example/MultipleSelectionPickerView/Assets.xcassets/selectedCheckmark.imageset/selectedCheckmark-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Brsoyan/Multiple-Selection-Picker/fd0d416f0f27c3698cdda61e64ebbc3e9b7f13c1/Example/MultipleSelectionPickerView/Assets.xcassets/selectedCheckmark.imageset/selectedCheckmark-2.png -------------------------------------------------------------------------------- /Example/MultipleSelectionPickerView/Assets.xcassets/selectedCheckmark.imageset/selectedCheckmark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Brsoyan/Multiple-Selection-Picker/fd0d416f0f27c3698cdda61e64ebbc3e9b7f13c1/Example/MultipleSelectionPickerView/Assets.xcassets/selectedCheckmark.imageset/selectedCheckmark.png -------------------------------------------------------------------------------- /Example/MultipleSelectionPickerView/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/MultipleSelectionPickerView/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 | 28 | 34 | 41 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /Example/MultipleSelectionPickerView/DataForPicker.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DataForPicker.swift 3 | // MultipleSelectionPickerView 4 | // 5 | // Created by Hayk Brsoyan on 7/9/18. 6 | // Copyright © 2018 Hayk Brsoyan. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import MultiPickerView 11 | 12 | 13 | class DataForPicker: PickerData { 14 | private let data: [[String: Any]] = [["id": 0, "longName" : "ALL", "shortName": "ALL"], 15 | ["id": 1, "longName" : "Name 1", "shortName": "NA-1"], 16 | ["id": 2, "longName" : "Name 2", "shortName": "NA-2"], 17 | ["id": 3, "longName" : "Name 3", "shortName": "NA-3"]] 18 | 19 | func id(for row: Int) -> Int { 20 | return data[row]["id"] as! Int 21 | } 22 | 23 | func long(for row: Int) -> String { 24 | return data[row]["longName"] as! String 25 | } 26 | 27 | func short(for row: Int) -> String { 28 | return data[row]["shortName"] as! String 29 | } 30 | 31 | func count() -> Int { 32 | return data.count 33 | } 34 | } 35 | 36 | -------------------------------------------------------------------------------- /Example/MultipleSelectionPickerView/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/MultipleSelectionPickerView/Resources/State.swift: -------------------------------------------------------------------------------- 1 | // 2 | // State.swift 3 | // MultipleSelectionPickerView 4 | // 5 | // Created by Hayk Brsoyan on 7/9/18. 6 | // Copyright © 2018 Hayk Brsoyan. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import SwiftyJSON 11 | 12 | 13 | struct State { 14 | var id: Int = 0 15 | var names: [Int: String] 16 | var abbr: String 17 | 18 | init(json: JSON) { 19 | self.id = json["id"].intValue 20 | self.names = [Int:String]() 21 | self.abbr = json["abbr"].stringValue 22 | 23 | for name in json["names"] { 24 | if let id: Int = Int(name.0) { 25 | self.names[id] = name.1.stringValue 26 | } 27 | } 28 | } 29 | } 30 | 31 | private var stateList: [AnyHashable: State] = [AnyHashable: State]() 32 | 33 | var StateList: [AnyHashable: State] { 34 | get { 35 | if(stateList.count <= 0) { 36 | let json = JSON(USState.stateJson()) 37 | stateList = json.arrayValue.map { 38 | State(json: $0) 39 | }.reduce(into: [AnyHashable: State]()) { dict, state in 40 | dict[state.id] = state 41 | dict[state.abbr] = state 42 | } 43 | } 44 | return stateList 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Example/MultipleSelectionPickerView/Resources/USState.swift: -------------------------------------------------------------------------------- 1 | // 2 | // USStates.swift 3 | // freighthaul 4 | // 5 | // Created by Hayk Brsoyan on 6/26/18. 6 | // Copyright © 2018 Hayk Brsoyan. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import SwiftyJSON 11 | import MultiPickerView 12 | 13 | class USState: NSObject { 14 | 15 | static let shared = USState() 16 | 17 | lazy var states: [State] = { 18 | let states = JSON(USState.stateJson()).arrayValue.map { State.init(json: $0) } 19 | return states 20 | }() 21 | 22 | func long() -> [String] { 23 | let lng = 1 //LanguagesProvider().currentLanguage() 24 | 25 | var arr = [String]() 26 | states.forEach { state in 27 | if let name = state.names[lng] { 28 | arr.append(name) 29 | } 30 | } 31 | 32 | return arr 33 | } 34 | 35 | func short() -> [String] { 36 | return states.map { $0.abbr } 37 | } 38 | 39 | // data mocked from map/states 40 | // No need to get this at the runtime 41 | 42 | static func stateJson() -> JSON { 43 | if let path = Bundle.main.path(forResource: "USStates", ofType: "json") { 44 | do { 45 | let data = try Data(contentsOf: URL(fileURLWithPath: path), options: .alwaysMapped) 46 | let jsonObj = try JSON(data: data) 47 | return jsonObj 48 | } catch let error { 49 | print("parse error: \(error.localizedDescription)") 50 | } 51 | } else { 52 | print("Invalid filename/path.") 53 | } 54 | return JSON() 55 | } 56 | } 57 | 58 | extension USState: PickerData { 59 | func id(for row: Int) -> Int { 60 | return states[row].id 61 | } 62 | 63 | func long(for row: Int) -> String { 64 | return long()[row] 65 | } 66 | 67 | func short(for row: Int) -> String { 68 | return states[row].abbr 69 | } 70 | 71 | func count() -> Int { 72 | return states.count 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Example/MultipleSelectionPickerView/Resources/USStates.json: -------------------------------------------------------------------------------- 1 | [{ 2 | "id": 0, 3 | "names": { 4 | "1": "All", 5 | "2": "All" 6 | }, 7 | "abbr": "All" 8 | }, 9 | { 10 | "id": 1, 11 | "names": { 12 | "1": "Alabama", 13 | "2": "Alabama" 14 | }, 15 | "abbr": "AL" 16 | }, { 17 | "id": 2, 18 | "names": { 19 | "1": "Alaska", 20 | "2": "Alaska" 21 | }, 22 | "abbr": "AK" 23 | }, { 24 | "id": 3, 25 | "names": { 26 | "1": "Arizona", 27 | "2": "Arizona" 28 | }, 29 | "abbr": "AZ" 30 | }, { 31 | "id": 4, 32 | "names": { 33 | "1": "Arkansas", 34 | "2": "Arkansas" 35 | }, 36 | "abbr": "AR" 37 | }, { 38 | "id": 5, 39 | "names": { 40 | "1": "California", 41 | "2": "California" 42 | }, 43 | "abbr": "CA" 44 | }, { 45 | "id": 6, 46 | "names": { 47 | "1": "Colorado", 48 | "2": "Colorado" 49 | }, 50 | "abbr": "CO" 51 | }, { 52 | "id": 7, 53 | "names": { 54 | "1": "Connecticut", 55 | "2": "Connecticut" 56 | }, 57 | "abbr": "CT" 58 | }, { 59 | "id": 8, 60 | "names": { 61 | "1": "Delaware", 62 | "2": "Delaware" 63 | }, 64 | "abbr": "DE" 65 | }, { 66 | "id": 9, 67 | "names": { 68 | "1": "Florida", 69 | "2": "Florida" 70 | }, 71 | "abbr": "FL" 72 | }, { 73 | "id": 10, 74 | "names": { 75 | "1": "Georgia", 76 | "2": "Georgia" 77 | }, 78 | "abbr": "GA" 79 | }, { 80 | "id": 11, 81 | "names": { 82 | "1": "Hawaii", 83 | "2": "Hawai" 84 | }, 85 | "abbr": "HI" 86 | }, { 87 | "id": 12, 88 | "names": { 89 | "1": "Idaho", 90 | "2": "Idaho" 91 | }, 92 | "abbr": "ID" 93 | }, { 94 | "id": 13, 95 | "names": { 96 | "1": "Illinois", 97 | "2": "Illinois" 98 | }, 99 | "abbr": "IL" 100 | }, { 101 | "id": 14, 102 | "names": { 103 | "1": "Indiana", 104 | "2": "Indiana" 105 | }, 106 | "abbr": "IN" 107 | }, { 108 | "id": 15, 109 | "names": { 110 | "1": "Iowa", 111 | "2": "Iowa" 112 | }, 113 | "abbr": "IA" 114 | }, { 115 | "id": 16, 116 | "names": { 117 | "1": "Kansas", 118 | "2": "Kansas" 119 | }, 120 | "abbr": "KS" 121 | }, { 122 | "id": 17, 123 | "names": { 124 | "1": "Kentucky", 125 | "2": "Kentucky" 126 | }, 127 | "abbr": "KY" 128 | }, { 129 | "id": 18, 130 | "names": { 131 | "1": "Louisiana", 132 | "2": "Luisiana" 133 | }, 134 | "abbr": "LA" 135 | }, { 136 | "id": 19, 137 | "names": { 138 | "1": "Maine", 139 | "2": "Maine" 140 | }, 141 | "abbr": "ME" 142 | }, { 143 | "id": 20, 144 | "names": { 145 | "1": "Maryland", 146 | "2": "Maryland" 147 | }, 148 | "abbr": "MD" 149 | }, { 150 | "id": 21, 151 | "names": { 152 | "1": "Massachusetts", 153 | "2": "Massachusetts" 154 | }, 155 | "abbr": "MA" 156 | }, { 157 | "id": 22, 158 | "names": { 159 | "1": "Michigan", 160 | "2": "Michigan" 161 | }, 162 | "abbr": "MI" 163 | }, { 164 | "id": 23, 165 | "names": { 166 | "1": "Minnesota", 167 | "2": "Minnesota" 168 | }, 169 | "abbr": "MN" 170 | }, { 171 | "id": 24, 172 | "names": { 173 | "1": "Mississippi", 174 | "2": "Misisipí" 175 | }, 176 | "abbr": "MS" 177 | }, { 178 | "id": 25, 179 | "names": { 180 | "1": "Missouri", 181 | "2": "Misuri" 182 | }, 183 | "abbr": "MO" 184 | }, { 185 | "id": 26, 186 | "names": { 187 | "1": "Montana", 188 | "2": "Montana" 189 | }, 190 | "abbr": "MT" 191 | }, { 192 | "id": 27, 193 | "names": { 194 | "1": "Nebraska", 195 | "2": "Nebraska" 196 | }, 197 | "abbr": "NE" 198 | }, { 199 | "id": 28, 200 | "names": { 201 | "1": "Nevada", 202 | "2": "Nevada" 203 | }, 204 | "abbr": "NV" 205 | }, { 206 | "id": 29, 207 | "names": { 208 | "1": "New Hampshire", 209 | "2": "Nueva Hampshire" 210 | }, 211 | "abbr": "NH" 212 | }, { 213 | "id": 30, 214 | "names": { 215 | "1": "New Jersey", 216 | "2": "Nueva Jersey" 217 | }, 218 | "abbr": "NJ" 219 | }, { 220 | "id": 31, 221 | "names": { 222 | "1": "New Mexico", 223 | "2": "Nuevo Mexico" 224 | }, 225 | "abbr": "NM" 226 | }, { 227 | "id": 32, 228 | "names": { 229 | "1": "New York", 230 | "2": "Nueva York" 231 | }, 232 | "abbr": "NY" 233 | }, { 234 | "id": 33, 235 | "names": { 236 | "1": "North Carolina", 237 | "2": "Carolina del Norte" 238 | }, 239 | "abbr": "NC" 240 | }, { 241 | "id": 34, 242 | "names": { 243 | "1": "North Dakota", 244 | "2": "Dakota del Norte" 245 | }, 246 | "abbr": "ND" 247 | }, { 248 | "id": 35, 249 | "names": { 250 | "1": "Ohio", 251 | "2": "Ohio" 252 | }, 253 | "abbr": "OH" 254 | }, { 255 | "id": 36, 256 | "names": { 257 | "1": "Oklahoma", 258 | "2": "Oklahoma" 259 | }, 260 | "abbr": "OK" 261 | }, { 262 | "id": 37, 263 | "names": { 264 | "1": "Oregon", 265 | "2": "Oregón" 266 | }, 267 | "abbr": "OR" 268 | }, { 269 | "id": 38, 270 | "names": { 271 | "1": "Pennsylvania", 272 | "2": "Pensilvania" 273 | }, 274 | "abbr": "PA" 275 | }, { 276 | "id": 39, 277 | "names": { 278 | "1": "Rhode Island", 279 | "2": "Rhode Island" 280 | }, 281 | "abbr": "RI" 282 | }, { 283 | "id": 40, 284 | "names": { 285 | "1": "South Carolina", 286 | "2": "Carolina del Sur" 287 | }, 288 | "abbr": "SC" 289 | }, { 290 | "id": 41, 291 | "names": { 292 | "1": "South Dakota", 293 | "2": "Dakota del Sur" 294 | }, 295 | "abbr": "SD" 296 | }, { 297 | "id": 42, 298 | "names": { 299 | "1": "Tennessee", 300 | "2": "Tennesse" 301 | }, 302 | "abbr": "TN" 303 | }, { 304 | "id": 43, 305 | "names": { 306 | "1": "Texas", 307 | "2": "Texas" 308 | }, 309 | "abbr": "TX" 310 | }, { 311 | "id": 44, 312 | "names": { 313 | "1": "Utah", 314 | "2": "Utah" 315 | }, 316 | "abbr": "UT" 317 | }, { 318 | "id": 45, 319 | "names": { 320 | "1": "Vermont", 321 | "2": "Vermont" 322 | }, 323 | "abbr": "VT" 324 | }, { 325 | "id": 46, 326 | "names": { 327 | "1": "Virginia", 328 | "2": "Virginia" 329 | }, 330 | "abbr": "VA" 331 | }, { 332 | "id": 47, 333 | "names": { 334 | "1": "Washington", 335 | "2": "Washington" 336 | }, 337 | "abbr": "WA" 338 | }, { 339 | "id": 48, 340 | "names": { 341 | "1": "West Virginia", 342 | "2": "Virginia del Oeste" 343 | }, 344 | "abbr": "WV" 345 | }, { 346 | "id": 49, 347 | "names": { 348 | "1": "Wisconsin", 349 | "2": "Wisconsin" 350 | }, 351 | "abbr": "WI" 352 | }, { 353 | "id": 50, 354 | "names": { 355 | "1": "Wyoming", 356 | "2": "Wyoming" 357 | }, 358 | "abbr": "WY" 359 | }] 360 | -------------------------------------------------------------------------------- /Example/MultipleSelectionPickerView/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // Picker 4 | // 5 | // Created by Hayk Brsoyan on 6/29/18. 6 | // Copyright © 2018 Hayk Brsoyan. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import MultiPickerView 11 | 12 | class ViewController: UIViewController { 13 | 14 | @IBOutlet weak var titileLabel: UILabel! 15 | @IBOutlet weak var states: UILabel! 16 | 17 | private var pickerDate = DatePickerViewHandler(data: DataForPicker()) 18 | private var multiSelectionPicker = MultipleSelectionPickerViewHandler(data: USState.shared) 19 | 20 | lazy var onItemSelected: (String) -> Void = { [weak self] title in 21 | self?.titileLabel.text = title 22 | } 23 | 24 | lazy var onItemSelectedDate: (_ day: Int, _ month: String, _ year: Int) -> Void = { [weak self] day, month, year in 25 | print("day = \(day) , month = \(month) , year = \(year)") 26 | } 27 | 28 | 29 | @IBAction func date(_ sender: UIButton) { 30 | pickerDate.delegate = self 31 | pickerDate.configWith(parentVC: self, onSelectedTitle: nil) 32 | } 33 | 34 | @IBAction func multiSelection(_ sender: UIButton) { 35 | multiSelectionPicker.delegate = self 36 | multiSelectionPicker.configWith(parentVC: self, 37 | owner: sender, 38 | data: USState.shared, 39 | leftButtonText: "Select", 40 | rightButtonText: "Done", 41 | tintColor: nil, 42 | selectedRows: [1], 43 | onSelectedTitle: onItemSelected) 44 | } 45 | } 46 | 47 | 48 | extension ViewController: PickerDelegate { 49 | func pickerDidHide(text: String, owner: UIView?, ids: [Int]) { 50 | states.text = text 51 | print("ids == \(ids)") 52 | } 53 | 54 | func pickerTextIsEmpty(owner: UIView?) { 55 | owner?.shake(duration: 0.5, repeatCount: 6, shakeSize: 20) 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | target 'MultipleSelectionPickerView' do 5 | # Comment the next line if you're not using Swift and don't want to use dynamic frameworks 6 | use_frameworks! 7 | 8 | pod 'MultiPickerView', '0.0.7' 9 | 10 | end 11 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - MultiPickerView (0.0.7): 3 | - SwiftyJSON (= 4.1.0) 4 | - SwiftyJSON (4.1.0) 5 | 6 | DEPENDENCIES: 7 | - MultiPickerView (= 0.0.7) 8 | 9 | SPEC REPOS: 10 | https://github.com/cocoapods/specs.git: 11 | - MultiPickerView 12 | - SwiftyJSON 13 | 14 | SPEC CHECKSUMS: 15 | MultiPickerView: 427ce1de39dedbfe4faef57ee0df0de5724d62d9 16 | SwiftyJSON: c29297daf073d2aa016295d5809cdd68045c39b3 17 | 18 | PODFILE CHECKSUM: d4f25ad67290ba11d1c1e7248796f5993bed32d4 19 | 20 | COCOAPODS: 1.5.3 21 | -------------------------------------------------------------------------------- /Example/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - MultiPickerView (0.0.7): 3 | - SwiftyJSON (= 4.1.0) 4 | - SwiftyJSON (4.1.0) 5 | 6 | DEPENDENCIES: 7 | - MultiPickerView (= 0.0.7) 8 | 9 | SPEC REPOS: 10 | https://github.com/cocoapods/specs.git: 11 | - MultiPickerView 12 | - SwiftyJSON 13 | 14 | SPEC CHECKSUMS: 15 | MultiPickerView: 427ce1de39dedbfe4faef57ee0df0de5724d62d9 16 | SwiftyJSON: c29297daf073d2aa016295d5809cdd68045c39b3 17 | 18 | PODFILE CHECKSUM: d4f25ad67290ba11d1c1e7248796f5993bed32d4 19 | 20 | COCOAPODS: 1.5.3 21 | -------------------------------------------------------------------------------- /Example/Pods/MultiPickerView/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Hayk Brsoyan 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 | -------------------------------------------------------------------------------- /Example/Pods/MultiPickerView/README.md: -------------------------------------------------------------------------------- 1 | # MultiPickerView 2 | 3 | 4 | ## Integration 5 | 6 | 1. You can use [CocoaPods](https://www.google.com) to install MultiPickerView by adding it to your Podfile. 7 | 2. Add this line to your Podfile 8 | ``` pod 'MultiPickerView' ``` 9 | 10 | 3. Run the following command: 11 | ``` pod install ``` 12 | 13 | 4. Don't forget to use the `.xcworkspace` file to open your project in Xcode, instead of the `.xcodeproj` file, from here on out. 14 | 15 | 5. In the future, to update to the latest version of the SDK, just run: 16 | ``` pod update MultiPickerView ``` 17 | 18 | 19 | ## Examples 20 | 21 | There are 1 example app included in the repository: 22 | - [Example](https://github.com/Brsoyan/Multiple-Selection-Picker/tree/master/Example) 23 | 24 | Example app is a great place to start if you're evaluating whether you want to use our Standard Integration (Swift) or build your own Custom Integration (ObjC). 25 | 26 | Open ./Stripe.xcworkspace (not ./MultipleSelectionPickerView.xcworkspace) with Xcode 27 | run `pod install` in terminal. 28 | 29 | Build and run the "MultipleSelectionPickerView" scheme 30 | 31 | ![](https://github.com/Brsoyan/Multiple-Selection-Picker/blob/master/Info/gif0.gif) 32 | 33 | ## Contributing 34 | 35 | We welcome contributions of any kind including new features, bug fixes, and documentation improvements. Please first open an issue describing what you want to build if it is a major change so that we can discuss how to move forward. Otherwise, go ahead and open a pull request for minor changes such as typo fixes and one liners. 36 | 37 | ## Migrating from Older Versions 38 | 39 | See `MIGRATING.md` 40 | 41 | ### Features 42 | PickerViewHandler,DatePickerViewHandler and MultipleSelectionPickerViewHandler easy to use. 43 | Create data let data = DataObj() 44 | DataObj will need to confitm to protocol `PickerData` 45 | 46 | Create picker handeler `private var pickerHandler = PickerViewHandler(data: data)` 47 | 48 | ``` 49 | protocol PickerData: class { 50 | func id(for row: Int) -> Int 51 | func long(for row: Int) -> String 52 | func short(for row: Int) -> String 53 | func count() -> Int 54 | } 55 | ``` 56 | 57 | When should show picker call `config` function and pass parent View Controller, data if you don't pass in initializer and onSelectedTitle closure if we need to update our view dynamically. 58 | 59 | Create PickerDelegate listener if we need to listen show and close actions. 60 | 61 | ``` 62 | protocol PickerDelegate: class { 63 | func pickerDidHide(text: String, owner: UIView?, ids:[Int]) 64 | func pickerTextIsEmpty(owner: UIView?) 65 | } 66 | ``` 67 | 68 | In MultipleSelectionPickerViewHandler picker view is a custom view, you can override `SelectionView` 69 | 70 | 71 | -------------------------------------------------------------------------------- /Example/Pods/MultiPickerView/Resources/SelectionView.xib: -------------------------------------------------------------------------------- 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 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /Example/Pods/MultiPickerView/Resources/selectedCheckmark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Brsoyan/Multiple-Selection-Picker/fd0d416f0f27c3698cdda61e64ebbc3e9b7f13c1/Example/Pods/MultiPickerView/Resources/selectedCheckmark.png -------------------------------------------------------------------------------- /Example/Pods/MultiPickerView/Sources/DatePickerViewHandler.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DatePickerViewHandler.swift 3 | // freighthaul 4 | // 5 | // Created by Hayk Brsoyan on 6/8/18. 6 | // Copyright © 2018 Hayk Brsoyan. All rights reserved. 7 | // 8 | import UIKit 9 | 10 | public class DatePickerViewHandler: PickerViewHandler { 11 | private var months = [String]() 12 | private var years = [Int]() 13 | private var days = [Int]() 14 | 15 | var day: Int = 0 16 | var month: Int = 0 17 | var year: Int = 0 18 | 19 | var onSelectedDate: ((_ day: Int, _ month: String, _ year: Int) -> Void)? 20 | 21 | override public init(data: PickerData) { 22 | super.init(data: data) 23 | self.commonSetup() 24 | self.numberOfComponents = 3 25 | } 26 | 27 | func commonSetup() { 28 | self.years = getYears() 29 | self.months = getMonths() 30 | self.days = Array(1...31) 31 | } 32 | 33 | private func getYears() -> [Int] { 34 | var years = [Int]() 35 | let year = Calendar.current.component(.year, from: Date()) 36 | for year in RegistrationConstants.minYear...(year - RegistrationConstants.minAge) { 37 | years.append(year) 38 | } 39 | 40 | return years.reversed() 41 | } 42 | 43 | private func getMonths() -> [String] { 44 | var months = [String]() 45 | let dateFormatter = DateFormatter() 46 | for month in 0...11 { 47 | months.append(dateFormatter.monthSymbols[month]) 48 | } 49 | return months 50 | } 51 | 52 | override func updateData() { 53 | self.months = getMonths() 54 | onSelectedDate?(day, months[month - 1], year) 55 | } 56 | 57 | override func stopUpdate() { 58 | onSelectedDate = nil 59 | } 60 | 61 | override func title(for row: Int, component: Int?) -> String { 62 | switch component { 63 | case Column.first: 64 | return "\(days[row])" 65 | case Column.second: 66 | return months[row] 67 | case Column.third: 68 | return "\(years[row])" 69 | default: 70 | return "" 71 | } 72 | } 73 | 74 | public func pickerView(_ pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusing view: UIView?) -> UIView { 75 | let title = self.title(for: row, component: component) 76 | 77 | guard let reusingLabel = view as? UILabel else { 78 | let label = UILabel.init() 79 | label.attributedText = NSAttributedString(string: title) 80 | label.textAlignment = .center 81 | return label 82 | } 83 | 84 | reusingLabel.attributedText = NSAttributedString(string: title) 85 | 86 | return reusingLabel 87 | } 88 | 89 | override public func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int { 90 | switch component { 91 | case Column.first: 92 | return days.count 93 | case Column.second: 94 | return months.count 95 | case Column.third: 96 | return years.count 97 | default: 98 | return 0 99 | } 100 | } 101 | 102 | override public func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) { 103 | selectedRow = row 104 | let day = self.picker.selectedRow(inComponent: Column.first) + 1 105 | let month = self.picker.selectedRow(inComponent: Column.second) + 1 106 | let year = years[self.picker.selectedRow(inComponent: Column.third)] 107 | 108 | onSelectedDate?(day, months[month - 1], year) 109 | 110 | self.day = day 111 | self.month = month 112 | self.year = year 113 | } 114 | 115 | override func dismiss() { 116 | if selectedRow == 0 { 117 | onSelectedDate?(1, months[0], years[0]) 118 | } 119 | 120 | self.parentVC?.view.endEditing(true) 121 | } 122 | 123 | private struct Column { 124 | static let first = 0 125 | static let second = 1 126 | static let third = 2 127 | } 128 | } 129 | 130 | 131 | struct RegistrationConstants { 132 | static let minAge = 18 133 | static let minAgeForCasino = 21 134 | static let minYear = 1901 135 | } 136 | -------------------------------------------------------------------------------- /Example/Pods/MultiPickerView/Sources/MultipleSelectionPickerScrollHelper.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MultipleSelectionPickerScrollHelper.swift 3 | // freighthaul 4 | // 5 | // Created by Hayk Brsoyan on 7/7/18. 6 | // Copyright © 2018 Hayk Brsoyan. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | protocol MultipleSelectionPickerScrollDelegate: class { 12 | func select() 13 | } 14 | 15 | public class MultipleSelectionPickerScrollHelper: NSObject, UIGestureRecognizerDelegate { 16 | 17 | weak var delegate: MultipleSelectionPickerScrollDelegate? 18 | weak var owner: MultipleSelectionPickerViewHandler? 19 | private var shouldRecognizeSimultaneously = 0 20 | private var isSelectInRow = false 21 | 22 | init(owner: MultipleSelectionPickerViewHandler) { 23 | self.owner = owner 24 | } 25 | 26 | public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRequireFailureOf otherGestureRecognizer: UIGestureRecognizer) -> Bool { 27 | if otherGestureRecognizer is UITapGestureRecognizer && gestureRecognizer is UITapGestureRecognizer { 28 | shouldRecognizeSimultaneously = 0 29 | 30 | if owner?.isSelectInRow(gestureRecognizer: otherGestureRecognizer) == true { 31 | isSelectInRow = true 32 | } 33 | } 34 | 35 | return false 36 | } 37 | 38 | public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool { 39 | 40 | if otherGestureRecognizer is UITapGestureRecognizer && shouldRecognizeSimultaneously == 0 && isSelectInRow == true { 41 | delegate?.select() 42 | } 43 | 44 | isSelectInRow = false 45 | shouldRecognizeSimultaneously += 1 46 | 47 | return false 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Example/Pods/MultiPickerView/Sources/MultipleSelectionPickerViewHandler.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MultipleSelectionPickerViewHandler.swift 3 | // freighthaul 4 | // 5 | // Created by Hayk Brsoyan on 6/27/18. 6 | // Copyright © 2018 Hayk Brsoyan. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public class MultipleSelectionPickerViewHandler: PickerViewHandler, MultipleSelectionPickerScrollDelegate { 12 | private struct MultipleSelectionConstants { 13 | static let rowHeight: CGFloat = 44 14 | } 15 | 16 | private var itemCount = 0 17 | private var scrollHelper: MultipleSelectionPickerScrollHelper? 18 | 19 | override var data: PickerData { 20 | didSet { 21 | itemCount = data.count() 22 | } 23 | } 24 | 25 | override public init(data: PickerData) { 26 | super.init(data: data) 27 | let tap = UITapGestureRecognizer.init(target: self, action: nil) 28 | picker.addGestureRecognizer(tap) 29 | 30 | scrollHelper = MultipleSelectionPickerScrollHelper(owner: self) 31 | scrollHelper?.delegate = self 32 | tap.delegate = self.scrollHelper 33 | } 34 | 35 | public func pickerView(_ pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusing view: UIView?) -> UIView { 36 | guard let reusingView = view as? SelectionView else { 37 | let view = SelectionView.init(frame: CGRect(x: 0, y: 0, width: pickerView.bounds.width * 0.8, height: MultipleSelectionConstants.rowHeight)) 38 | setData(view: view, row: row) 39 | return view 40 | } 41 | 42 | setData(view: reusingView, row: row) 43 | return reusingView 44 | } 45 | 46 | private func setData(view: SelectionView, row: Int) { 47 | let title = data.long(for: row) 48 | 49 | var type = view.type 50 | if selectedRows.contains(row) { 51 | type = .selected 52 | } 53 | view.config(type: type, text: title) 54 | } 55 | 56 | override func toolBar() -> CGFloat { 57 | let toolBar = UIToolbar() 58 | toolBar.barStyle = .default 59 | toolBar.isTranslucent = true 60 | 61 | var color = UIColor.blue 62 | if let tintColor = self.tintColor { 63 | color = tintColor 64 | } 65 | 66 | toolBar.tintColor = color 67 | toolBar.sizeToFit() 68 | 69 | var leftText = "Select" 70 | if let txt = self.leftButtonText { 71 | leftText = txt 72 | } 73 | 74 | var rightText = "Done" 75 | if let txt = self.rightButtonText { 76 | rightText = txt 77 | } 78 | 79 | let closeButton = UIBarButtonItem(title: rightText, style: .plain, target: self, action: #selector(dismiss)) 80 | let doneButton = UIBarButtonItem(title: leftText, style: .plain, target: self, action: #selector(select)) 81 | let spaceButton = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil) 82 | toolBar.setItems([closeButton, spaceButton, doneButton], animated: false) 83 | toolBar.isUserInteractionEnabled = true 84 | textField.inputAccessoryView = toolBar 85 | 86 | return toolBar.frame.height + picker.frame.height 87 | } 88 | 89 | @objc func select() { 90 | let row = picker.selectedRow(inComponent: 0) 91 | selectRow(row: row) 92 | } 93 | 94 | private func selectRow(row: Int) { 95 | let view = picker.view(forRow: row, forComponent: 0) 96 | guard let selectedView = view as? SelectionView else { return } 97 | 98 | if row == 0 && !selectedRows.contains(row) { 99 | selectedRows = Set(0 ..< data.count()) 100 | } else if row == 0 && selectedRows.contains(row) { 101 | selectedRows.removeAll() 102 | } 103 | 104 | let selected = selectedView.select() 105 | if selected == true { 106 | selectedRows.insert(row) 107 | if selectedRows.count + 1 == itemCount { 108 | selectedRows.insert(0) 109 | } 110 | } else { 111 | selectedRows.remove(row) 112 | selectedRows.remove(0) 113 | } 114 | 115 | DispatchQueue.main.async { 116 | self.picker.reloadAllComponents() 117 | } 118 | } 119 | 120 | override func selectedRowData() -> (title: String, ids: [Int]) { 121 | var str = "" 122 | var ids = [Int]() 123 | 124 | let selected = selectedRows.sorted() 125 | 126 | if selected.contains(0) { 127 | str = data.short(for: 0) 128 | } else if selectedRows.count > 0 { 129 | 130 | let first = selected.first! 131 | str = data.short(for: first) 132 | ids.append(data.id(for: first)) 133 | 134 | for idx in selected.dropFirst() { 135 | str = str + ", " + data.short(for: idx) 136 | ids.append(data.id(for: idx)) 137 | } 138 | } 139 | 140 | if str.isEmpty == true { 141 | str = data.short(for: 0) 142 | selectRow(row: 0) 143 | self.delegate?.pickerTextIsEmpty(owner: owner) 144 | } 145 | 146 | return (str, ids) 147 | } 148 | 149 | public func isSelectInRow(gestureRecognizer: UIGestureRecognizer) -> Bool { 150 | let selectedView = picker.view(forRow: selectedRow, forComponent: 0) 151 | if selectedView?.frame.contains(gestureRecognizer.location(in: selectedView)) == true { 152 | return true 153 | } 154 | return false 155 | } 156 | } 157 | 158 | 159 | 160 | -------------------------------------------------------------------------------- /Example/Pods/MultiPickerView/Sources/PickerView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PickerView.swift 3 | // Picker 4 | // 5 | // Created by Hayk Brsoyan on 6/29/18. 6 | // Copyright © 2018 Hayk Brsoyan. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public protocol PickerData: class { 12 | func id(for row: Int) -> Int 13 | func long(for row: Int) -> String 14 | func short(for row: Int) -> String 15 | func count() -> Int 16 | } 17 | 18 | public class PickerView: UIPickerView { 19 | 20 | var pickerDidHide: (() -> Void)? 21 | 22 | override public func removeFromSuperview() { 23 | super.removeFromSuperview() 24 | self.pickerDidHide?() 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Example/Pods/MultiPickerView/Sources/PickerViewHandler.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PickerViewHandler.swift 3 | // freighthaul 4 | // 5 | // Created by Hayk Brsoyan on 6/8/18. 6 | // Copyright © 2018 Hayk Brsoyan. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public protocol PickerDelegate: class { 12 | func pickerDidHide(text: String, owner: UIView?, ids:[Int]) 13 | func pickerTextIsEmpty(owner: UIView?) 14 | } 15 | 16 | public class PickerViewHandler: NSObject, UIPickerViewDelegate, UIPickerViewDataSource { 17 | 18 | public weak var delegate: PickerDelegate? 19 | 20 | private(set) var textField: UITextField 21 | 22 | internal var data: (Any & PickerData) 23 | internal var picker = PickerView.init() 24 | internal var numberOfComponents = 1 25 | internal var selectedRow: Int = 0 26 | 27 | internal var leftButtonText: String? 28 | internal var rightButtonText: String? 29 | internal var tintColor: UIColor? 30 | 31 | weak var owner: UIView? 32 | private var pickerViewHeight: CGFloat = 0.0 33 | 34 | var onSelectedTitle: ((_ text : String) -> Void)? 35 | weak var parentVC: UIViewController? { 36 | didSet { 37 | configPicker() 38 | } 39 | } 40 | 41 | internal lazy var selectedRows: Set = { 42 | return Set(0 ..< data.count()) 43 | }() 44 | 45 | lazy var pickerDidHide: () -> Void = { [weak self] in 46 | guard let `self` = self else { return } 47 | 48 | let data = self.selectedRowData() 49 | let title = data.title 50 | let ids = data.ids 51 | 52 | self.delegate?.pickerDidHide(text: title, owner: self.owner, ids: ids) 53 | } 54 | 55 | public init(data: PickerData) { 56 | self.textField = UITextField.init(frame: .zero) 57 | self.data = data 58 | } 59 | 60 | public func configWith(parentVC: UIViewController, onSelectedTitle: ((_ text : String) -> Void)?) { 61 | presentPicker(parentVC: parentVC, onSelectedTitle: onSelectedTitle) 62 | } 63 | 64 | public func configWith(parentVC: UIViewController, owner: UIView?, data: PickerData?, leftButtonText: String?, rightButtonText: String?, tintColor: UIColor?, selectedRows: Set?, onSelectedTitle: ((_ text : String) -> Void)?) { 65 | 66 | self.leftButtonText = leftButtonText 67 | self.rightButtonText = rightButtonText 68 | self.tintColor = tintColor 69 | if let rows = selectedRows { 70 | if rows.count > 0 { 71 | self.selectedRows = rows 72 | } 73 | } 74 | 75 | configWith(parentVC: parentVC, onSelectedTitle: onSelectedTitle) 76 | self.owner = owner 77 | if let data = data { 78 | self.data = data 79 | } 80 | } 81 | 82 | internal func presentPicker(parentVC: UIViewController, onSelectedTitle: ((_ text : String) -> Void)?) { 83 | self.parentVC = parentVC 84 | self.textField.becomeFirstResponder() 85 | self.onSelectedTitle = onSelectedTitle 86 | } 87 | 88 | private func configPicker() { 89 | self.parentVC?.view.addSubview(textField) 90 | picker.showsSelectionIndicator = true 91 | picker.delegate = self 92 | picker.dataSource = self 93 | picker.selectRow(0, inComponent: 0, animated: false) 94 | picker.pickerDidHide = pickerDidHide 95 | 96 | textField.inputView = picker 97 | pickerViewHeight = self.toolBar() 98 | 99 | selectedRow = 0 100 | } 101 | 102 | internal func toolBar() -> CGFloat { 103 | let toolBar = UIToolbar() 104 | toolBar.barStyle = .default 105 | toolBar.isTranslucent = true 106 | var color = UIColor.blue 107 | if let tintColor = self.tintColor { 108 | color = tintColor 109 | } 110 | toolBar.tintColor = color 111 | toolBar.sizeToFit() 112 | 113 | var rightText = "Done" 114 | if let txt = self.rightButtonText { 115 | rightText = txt 116 | } 117 | let doneButton = UIBarButtonItem(title: rightText, style: .plain, target: self, action: #selector(dismiss)) 118 | let spaceButton = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil) 119 | toolBar.setItems([spaceButton, doneButton], animated: false) 120 | toolBar.isUserInteractionEnabled = true 121 | textField.inputAccessoryView = toolBar 122 | 123 | return toolBar.frame.height + picker.frame.height 124 | } 125 | 126 | func title(for row: Int, component: Int?) -> String { 127 | return data.long(for: row) 128 | } 129 | 130 | func updateData() { 131 | // override if needed in child class 132 | } 133 | 134 | func stopUpdate() { 135 | // override if needed in child class 136 | } 137 | 138 | func count() -> Int { 139 | return data.count() 140 | } 141 | 142 | 143 | // MARK: UIPickerViewDelegate, UIPickerViewDataSource 144 | public func numberOfComponents(in pickerView: UIPickerView) -> Int { 145 | return numberOfComponents 146 | } 147 | 148 | public func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int { 149 | return count() 150 | } 151 | 152 | public func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? { 153 | return title(for: row, component: component) 154 | } 155 | 156 | public func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) { 157 | selectedRow = row 158 | setTextOnCurrentView(row: row, component: component) 159 | } 160 | 161 | internal func setTextOnCurrentView(row: Int, component: Int?) { 162 | onSelectedTitle?(title(for: row, component: component)) 163 | } 164 | 165 | internal func selectedRowData() -> (title: String, ids: [Int]) { 166 | return (title(for: self.selectedRow, component: 0), [Int]()) 167 | } 168 | 169 | @objc func dismiss() { 170 | if selectedRow == 0 { 171 | setTextOnCurrentView(row: 0, component: nil) 172 | } 173 | self.parentVC?.view.endEditing(true) 174 | } 175 | } 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | -------------------------------------------------------------------------------- /Example/Pods/MultiPickerView/Sources/SelectionView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SelectionView.swift 3 | // freighthaul 4 | // 5 | // Created by Hayk Brsoyan on 6/27/18. 6 | // Copyright © 2018 Hayk Brsoyan. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class SelectionView: UIView { 12 | @IBOutlet weak var imgView: UIImageView! 13 | @IBOutlet weak var titleLabel: UILabel! 14 | 15 | enum SelectionViewType { 16 | case selected 17 | case deSelected 18 | } 19 | 20 | var type: SelectionViewType = SelectionViewType.deSelected { 21 | didSet { 22 | if type == .deSelected { 23 | imgView?.isHidden = true 24 | } else { 25 | imgView?.isHidden = false 26 | } 27 | } 28 | } 29 | 30 | override init(frame: CGRect) { 31 | super.init(frame: frame) 32 | commonInit() 33 | } 34 | 35 | required init?(coder aDecoder: NSCoder) { 36 | super.init(coder: aDecoder) 37 | } 38 | 39 | private func commonInit() { 40 | let view = loadNib() 41 | view.frame = bounds 42 | view.backgroundColor = .clear 43 | addSubview(view) 44 | } 45 | 46 | func config(type: SelectionViewType, text: String) { 47 | self.type = type 48 | self.titleLabel?.text = text 49 | } 50 | 51 | func select() -> Bool { 52 | if type == .selected { 53 | type = .deSelected 54 | return false 55 | } else { 56 | type = .selected 57 | return true 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Example/Pods/MultiPickerView/Sources/UIView+Shake.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Shake.swift 3 | // Picker 4 | // 5 | // Created by Hayk Brsoyan on 6/29/18. 6 | // Copyright © 2018 Hayk Brsoyan. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | extension UIView { 12 | 13 | /** Loads instance from nib with the same name. */ 14 | public func loadNib() -> UIView { 15 | let bundle = Bundle(for: type(of: self)) 16 | let nibName = type(of: self).description().components(separatedBy: ".").last! 17 | let nib = UINib(nibName: nibName, bundle: bundle) 18 | return nib.instantiate(withOwner: self, options: nil).first as! UIView 19 | } 20 | 21 | public func shake(duration: Double, repeatCount: Float, shakeSize: CGFloat) { 22 | let keyPath = "position" 23 | let shake = CABasicAnimation(keyPath: keyPath) 24 | shake.duration = duration 25 | shake.repeatCount = repeatCount 26 | shake.autoreverses = true 27 | shake.fromValue = NSValue(cgPoint: CGPoint(x: center.x - shakeSize, y: center.y)) 28 | shake.toValue = NSValue(cgPoint: CGPoint(x: center.x + shakeSize, y: center.y)) 29 | 30 | layer.add(shake, forKey: keyPath) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /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 | 016E1C227A5BD9D2BCFCA036DC1F965A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A4E8B98BB862EFECF5F41ACECA0555BB /* Foundation.framework */; }; 11 | 01D9031766CC0FECB6C55857F2089B82 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A4E8B98BB862EFECF5F41ACECA0555BB /* Foundation.framework */; }; 12 | 020AA134C4858F97299DC68B04FFBA59 /* MultipleSelectionPickerViewHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1685792802C4D07DA684400524EF4C3B /* MultipleSelectionPickerViewHandler.swift */; }; 13 | 087760440A0232124FB7339AD8C6616C /* SwiftyJSON.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F05A2DDA9058082E37FAAA448F008219 /* SwiftyJSON.framework */; }; 14 | 0DAC8BAA8516306167222B8E48120A19 /* MultipleSelectionPickerScrollHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A0428F266F027A5401C11E81F10AED4 /* MultipleSelectionPickerScrollHelper.swift */; }; 15 | 2D4377374297EA7CCBF248C123254789 /* SelectionView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 84665C4C3E432DEFF567B57DA1600075 /* SelectionView.xib */; }; 16 | 321BF96095114BF18FAA4A6ABB3BDAA7 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A4E8B98BB862EFECF5F41ACECA0555BB /* Foundation.framework */; }; 17 | 34FF3A68D6287BA0C22A7EE45035750E /* selectedCheckmark.png in Resources */ = {isa = PBXBuildFile; fileRef = 0D099899C52D15E903694E8D931C201B /* selectedCheckmark.png */; }; 18 | 74B34407C60FC532F2B10BAF91F33AB8 /* UIView+Shake.swift in Sources */ = {isa = PBXBuildFile; fileRef = 570901E8301C28A75EC9B5CD594118F2 /* UIView+Shake.swift */; }; 19 | 807FA39EFB48BD68C6C37B29C3DF49BE /* MultiPickerView-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 40540E97E35C8D667F97CB77A805DCFB /* MultiPickerView-dummy.m */; }; 20 | 814AF59D015427DB3A66AB7D95DB471A /* PickerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0AC6919508467AF94AEE456138A657C /* PickerView.swift */; }; 21 | 9229DC1E38A3A311F4D6BA9421138AC7 /* PickerViewHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 71B42A9849CD4777ED48DED212062483 /* PickerViewHandler.swift */; }; 22 | 92F7F38F71DE999234E18100DAC68F64 /* Pods-MultipleSelectionPickerView-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 0794FFF6A9614F064EC897DF17355CF8 /* Pods-MultipleSelectionPickerView-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; 23 | A07E919A3C4AE395D2783F437B86179A /* SwiftyJSON-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = AE6C525FD00A15D308BD568728F7BEE4 /* SwiftyJSON-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; 24 | A98E24402A2534D600FE1EAFF0764B6F /* SwiftyJSON-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = B7E2DC4D6B973A9B726D67140BBEFF34 /* SwiftyJSON-dummy.m */; }; 25 | B692D9DEFFCC8147901F326D0E2AB27C /* Pods-MultipleSelectionPickerView-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = FD0BCC70D3AF085002A3045EE739A65F /* Pods-MultipleSelectionPickerView-dummy.m */; }; 26 | D7384896F38F0EF7806DE8F28E8B4F34 /* MultiPickerView-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 5999D5A585AE327C8E090298274E395E /* MultiPickerView-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; 27 | DD4538BFE14CD7FF2308C1AAC2F23F32 /* DatePickerViewHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBB2A3324FFB389345EA5A336F9CA09F /* DatePickerViewHandler.swift */; }; 28 | EB12A7C93A9C58FD959DD8944A181B6A /* SelectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68F48E60656A87F40044B7C56D72098B /* SelectionView.swift */; }; 29 | F0F1BE67EE64928F272D1E57C87D7377 /* SwiftyJSON.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D7FF325AE5DD08DB6B692B571164F20 /* SwiftyJSON.swift */; }; 30 | /* End PBXBuildFile section */ 31 | 32 | /* Begin PBXContainerItemProxy section */ 33 | 03E737BDA3F9E72A08665B8B67ACF686 /* PBXContainerItemProxy */ = { 34 | isa = PBXContainerItemProxy; 35 | containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; 36 | proxyType = 1; 37 | remoteGlobalIDString = 217506683FECCE3608E32FDE9D75BFEE; 38 | remoteInfo = SwiftyJSON; 39 | }; 40 | 4E865E59006446D2FB798774AB838FBD /* PBXContainerItemProxy */ = { 41 | isa = PBXContainerItemProxy; 42 | containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; 43 | proxyType = 1; 44 | remoteGlobalIDString = 217506683FECCE3608E32FDE9D75BFEE; 45 | remoteInfo = SwiftyJSON; 46 | }; 47 | 62CDC0C5ACCB8C0A3B224666D476C1CF /* PBXContainerItemProxy */ = { 48 | isa = PBXContainerItemProxy; 49 | containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; 50 | proxyType = 1; 51 | remoteGlobalIDString = AB4754B7DF53FF3ECAF0D49E93A2BB63; 52 | remoteInfo = MultiPickerView; 53 | }; 54 | /* End PBXContainerItemProxy section */ 55 | 56 | /* Begin PBXFileReference section */ 57 | 0794FFF6A9614F064EC897DF17355CF8 /* Pods-MultipleSelectionPickerView-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-MultipleSelectionPickerView-umbrella.h"; sourceTree = ""; }; 58 | 0D099899C52D15E903694E8D931C201B /* selectedCheckmark.png */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = image.png; name = selectedCheckmark.png; path = Resources/selectedCheckmark.png; sourceTree = ""; }; 59 | 10D4275C013189127D1F200405339BD6 /* Pods_MultipleSelectionPickerView.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_MultipleSelectionPickerView.framework; path = "Pods-MultipleSelectionPickerView.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; 60 | 114E8257B8B929FCD89EEA0F2BA60540 /* Pods-MultipleSelectionPickerView-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-MultipleSelectionPickerView-frameworks.sh"; sourceTree = ""; }; 61 | 11DE625CCC06D2FBAEEFF336546AEA44 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 62 | 1685792802C4D07DA684400524EF4C3B /* MultipleSelectionPickerViewHandler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MultipleSelectionPickerViewHandler.swift; path = Sources/MultipleSelectionPickerViewHandler.swift; sourceTree = ""; }; 63 | 1A6E65CF8703114805F1E4B91BA47564 /* Pods-MultipleSelectionPickerView.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-MultipleSelectionPickerView.modulemap"; sourceTree = ""; }; 64 | 1D7FF325AE5DD08DB6B692B571164F20 /* SwiftyJSON.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SwiftyJSON.swift; path = Source/SwiftyJSON.swift; sourceTree = ""; }; 65 | 236526DDB697270C4B25EE342AAF45B5 /* Pods-MultipleSelectionPickerView.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-MultipleSelectionPickerView.release.xcconfig"; sourceTree = ""; }; 66 | 2A0428F266F027A5401C11E81F10AED4 /* MultipleSelectionPickerScrollHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MultipleSelectionPickerScrollHelper.swift; path = Sources/MultipleSelectionPickerScrollHelper.swift; sourceTree = ""; }; 67 | 3D952415E8A9BC990B05DD2D2943BE96 /* MultiPickerView.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = MultiPickerView.framework; path = MultiPickerView.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 68 | 40540E97E35C8D667F97CB77A805DCFB /* MultiPickerView-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "MultiPickerView-dummy.m"; sourceTree = ""; }; 69 | 4588EBA85C45A294A4AEFB8B42604395 /* MultiPickerView-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "MultiPickerView-prefix.pch"; sourceTree = ""; }; 70 | 570901E8301C28A75EC9B5CD594118F2 /* UIView+Shake.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "UIView+Shake.swift"; path = "Sources/UIView+Shake.swift"; sourceTree = ""; }; 71 | 5999D5A585AE327C8E090298274E395E /* MultiPickerView-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "MultiPickerView-umbrella.h"; sourceTree = ""; }; 72 | 6481D1016B47DBB011459389058BD47D /* MultiPickerView.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = MultiPickerView.xcconfig; sourceTree = ""; }; 73 | 68F48E60656A87F40044B7C56D72098B /* SelectionView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SelectionView.swift; path = Sources/SelectionView.swift; sourceTree = ""; }; 74 | 6B64BB08FF69E2B7D93638FE86C071AF /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 75 | 71B42A9849CD4777ED48DED212062483 /* PickerViewHandler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PickerViewHandler.swift; path = Sources/PickerViewHandler.swift; sourceTree = ""; }; 76 | 7DC02E1A804655BAA311CF8DFC122EEC /* MultiPickerView.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = MultiPickerView.modulemap; sourceTree = ""; }; 77 | 84665C4C3E432DEFF567B57DA1600075 /* SelectionView.xib */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = file.xib; name = SelectionView.xib; path = Resources/SelectionView.xib; sourceTree = ""; }; 78 | 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 79 | 958B62E86C92EE33BED96419FD2C27CF /* SwiftyJSON.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = SwiftyJSON.framework; path = SwiftyJSON.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 80 | 9B90DFDD78F5197ADC4904324F1A5C26 /* SwiftyJSON.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = SwiftyJSON.xcconfig; sourceTree = ""; }; 81 | A4E8B98BB862EFECF5F41ACECA0555BB /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; 82 | A68C00D360E69CFC6B23FEA9B75F89B6 /* SwiftyJSON.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = SwiftyJSON.modulemap; sourceTree = ""; }; 83 | A7F0371542FF5BFCE14EFA69B70DDDB9 /* Pods-MultipleSelectionPickerView-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-MultipleSelectionPickerView-acknowledgements.plist"; sourceTree = ""; }; 84 | AE6C525FD00A15D308BD568728F7BEE4 /* SwiftyJSON-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "SwiftyJSON-umbrella.h"; sourceTree = ""; }; 85 | B7E2DC4D6B973A9B726D67140BBEFF34 /* SwiftyJSON-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "SwiftyJSON-dummy.m"; sourceTree = ""; }; 86 | BBB2A3324FFB389345EA5A336F9CA09F /* DatePickerViewHandler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DatePickerViewHandler.swift; path = Sources/DatePickerViewHandler.swift; sourceTree = ""; }; 87 | C0AC6919508467AF94AEE456138A657C /* PickerView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PickerView.swift; path = Sources/PickerView.swift; sourceTree = ""; }; 88 | C3A5931B733CF42FD9CD6C95C0D31657 /* SwiftyJSON-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "SwiftyJSON-prefix.pch"; sourceTree = ""; }; 89 | D494707228C34AA884EC18A0C8F48421 /* Pods-MultipleSelectionPickerView-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-MultipleSelectionPickerView-resources.sh"; sourceTree = ""; }; 90 | DBE222987C73212FB967345B04C8DA84 /* Pods-MultipleSelectionPickerView.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-MultipleSelectionPickerView.debug.xcconfig"; sourceTree = ""; }; 91 | E37DF269EB8EF913A3962853369EE369 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 92 | F044FD797C1EC28C8C847633F578D199 /* Pods-MultipleSelectionPickerView-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-MultipleSelectionPickerView-acknowledgements.markdown"; sourceTree = ""; }; 93 | F05A2DDA9058082E37FAAA448F008219 /* SwiftyJSON.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwiftyJSON.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 94 | FD0BCC70D3AF085002A3045EE739A65F /* Pods-MultipleSelectionPickerView-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-MultipleSelectionPickerView-dummy.m"; sourceTree = ""; }; 95 | /* End PBXFileReference section */ 96 | 97 | /* Begin PBXFrameworksBuildPhase section */ 98 | 75230C84ADF1D5C906CB1692A3224949 /* Frameworks */ = { 99 | isa = PBXFrameworksBuildPhase; 100 | buildActionMask = 2147483647; 101 | files = ( 102 | 321BF96095114BF18FAA4A6ABB3BDAA7 /* Foundation.framework in Frameworks */, 103 | 087760440A0232124FB7339AD8C6616C /* SwiftyJSON.framework in Frameworks */, 104 | ); 105 | runOnlyForDeploymentPostprocessing = 0; 106 | }; 107 | B7B50162C3CD7D08764FF0635829AE0E /* Frameworks */ = { 108 | isa = PBXFrameworksBuildPhase; 109 | buildActionMask = 2147483647; 110 | files = ( 111 | 016E1C227A5BD9D2BCFCA036DC1F965A /* Foundation.framework in Frameworks */, 112 | ); 113 | runOnlyForDeploymentPostprocessing = 0; 114 | }; 115 | FBF2EC2EE5AA3CCCBAD13E949DD57111 /* Frameworks */ = { 116 | isa = PBXFrameworksBuildPhase; 117 | buildActionMask = 2147483647; 118 | files = ( 119 | 01D9031766CC0FECB6C55857F2089B82 /* Foundation.framework in Frameworks */, 120 | ); 121 | runOnlyForDeploymentPostprocessing = 0; 122 | }; 123 | /* End PBXFrameworksBuildPhase section */ 124 | 125 | /* Begin PBXGroup section */ 126 | 00AB18029CDE6900CC81C3C8B0762F8E /* Products */ = { 127 | isa = PBXGroup; 128 | children = ( 129 | 3D952415E8A9BC990B05DD2D2943BE96 /* MultiPickerView.framework */, 130 | 10D4275C013189127D1F200405339BD6 /* Pods_MultipleSelectionPickerView.framework */, 131 | 958B62E86C92EE33BED96419FD2C27CF /* SwiftyJSON.framework */, 132 | ); 133 | name = Products; 134 | sourceTree = ""; 135 | }; 136 | 0EFBF981796CF93B3542D7A097636424 /* Targets Support Files */ = { 137 | isa = PBXGroup; 138 | children = ( 139 | E2579D49E625AD5F990E2A9DD4C53F98 /* Pods-MultipleSelectionPickerView */, 140 | ); 141 | name = "Targets Support Files"; 142 | sourceTree = ""; 143 | }; 144 | 1D033DF83E5CE080D4F77DDB4B402495 /* Support Files */ = { 145 | isa = PBXGroup; 146 | children = ( 147 | E37DF269EB8EF913A3962853369EE369 /* Info.plist */, 148 | A68C00D360E69CFC6B23FEA9B75F89B6 /* SwiftyJSON.modulemap */, 149 | 9B90DFDD78F5197ADC4904324F1A5C26 /* SwiftyJSON.xcconfig */, 150 | B7E2DC4D6B973A9B726D67140BBEFF34 /* SwiftyJSON-dummy.m */, 151 | C3A5931B733CF42FD9CD6C95C0D31657 /* SwiftyJSON-prefix.pch */, 152 | AE6C525FD00A15D308BD568728F7BEE4 /* SwiftyJSON-umbrella.h */, 153 | ); 154 | name = "Support Files"; 155 | path = "../Target Support Files/SwiftyJSON"; 156 | sourceTree = ""; 157 | }; 158 | 3DDA9A10D650CBA74D180C158DA66A1D /* MultiPickerView */ = { 159 | isa = PBXGroup; 160 | children = ( 161 | BBB2A3324FFB389345EA5A336F9CA09F /* DatePickerViewHandler.swift */, 162 | 2A0428F266F027A5401C11E81F10AED4 /* MultipleSelectionPickerScrollHelper.swift */, 163 | 1685792802C4D07DA684400524EF4C3B /* MultipleSelectionPickerViewHandler.swift */, 164 | C0AC6919508467AF94AEE456138A657C /* PickerView.swift */, 165 | 71B42A9849CD4777ED48DED212062483 /* PickerViewHandler.swift */, 166 | 68F48E60656A87F40044B7C56D72098B /* SelectionView.swift */, 167 | 570901E8301C28A75EC9B5CD594118F2 /* UIView+Shake.swift */, 168 | B771634972DFC39DF0AC88B483ED55FE /* Resources */, 169 | 8B0BDC090BADECF0502ACA6B0732B822 /* Support Files */, 170 | ); 171 | name = MultiPickerView; 172 | path = MultiPickerView; 173 | sourceTree = ""; 174 | }; 175 | 465D54E2029F6ACF993AA9CA266D24ED /* Pods */ = { 176 | isa = PBXGroup; 177 | children = ( 178 | 3DDA9A10D650CBA74D180C158DA66A1D /* MultiPickerView */, 179 | 68EEA4BE6C730AD86706E660108DC801 /* SwiftyJSON */, 180 | ); 181 | name = Pods; 182 | sourceTree = ""; 183 | }; 184 | 65B35BF8E63AD31F1FDAD1F7E7313A21 /* Frameworks */ = { 185 | isa = PBXGroup; 186 | children = ( 187 | F05A2DDA9058082E37FAAA448F008219 /* SwiftyJSON.framework */, 188 | D6D29D12F21851571AC40C4783126110 /* iOS */, 189 | ); 190 | name = Frameworks; 191 | sourceTree = ""; 192 | }; 193 | 68EEA4BE6C730AD86706E660108DC801 /* SwiftyJSON */ = { 194 | isa = PBXGroup; 195 | children = ( 196 | 1D7FF325AE5DD08DB6B692B571164F20 /* SwiftyJSON.swift */, 197 | 1D033DF83E5CE080D4F77DDB4B402495 /* Support Files */, 198 | ); 199 | name = SwiftyJSON; 200 | path = SwiftyJSON; 201 | sourceTree = ""; 202 | }; 203 | 7DB346D0F39D3F0E887471402A8071AB = { 204 | isa = PBXGroup; 205 | children = ( 206 | 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */, 207 | 65B35BF8E63AD31F1FDAD1F7E7313A21 /* Frameworks */, 208 | 465D54E2029F6ACF993AA9CA266D24ED /* Pods */, 209 | 00AB18029CDE6900CC81C3C8B0762F8E /* Products */, 210 | 0EFBF981796CF93B3542D7A097636424 /* Targets Support Files */, 211 | ); 212 | sourceTree = ""; 213 | }; 214 | 8B0BDC090BADECF0502ACA6B0732B822 /* Support Files */ = { 215 | isa = PBXGroup; 216 | children = ( 217 | 11DE625CCC06D2FBAEEFF336546AEA44 /* Info.plist */, 218 | 7DC02E1A804655BAA311CF8DFC122EEC /* MultiPickerView.modulemap */, 219 | 6481D1016B47DBB011459389058BD47D /* MultiPickerView.xcconfig */, 220 | 40540E97E35C8D667F97CB77A805DCFB /* MultiPickerView-dummy.m */, 221 | 4588EBA85C45A294A4AEFB8B42604395 /* MultiPickerView-prefix.pch */, 222 | 5999D5A585AE327C8E090298274E395E /* MultiPickerView-umbrella.h */, 223 | ); 224 | name = "Support Files"; 225 | path = "../Target Support Files/MultiPickerView"; 226 | sourceTree = ""; 227 | }; 228 | B771634972DFC39DF0AC88B483ED55FE /* Resources */ = { 229 | isa = PBXGroup; 230 | children = ( 231 | 0D099899C52D15E903694E8D931C201B /* selectedCheckmark.png */, 232 | 84665C4C3E432DEFF567B57DA1600075 /* SelectionView.xib */, 233 | ); 234 | name = Resources; 235 | sourceTree = ""; 236 | }; 237 | D6D29D12F21851571AC40C4783126110 /* iOS */ = { 238 | isa = PBXGroup; 239 | children = ( 240 | A4E8B98BB862EFECF5F41ACECA0555BB /* Foundation.framework */, 241 | ); 242 | name = iOS; 243 | sourceTree = ""; 244 | }; 245 | E2579D49E625AD5F990E2A9DD4C53F98 /* Pods-MultipleSelectionPickerView */ = { 246 | isa = PBXGroup; 247 | children = ( 248 | 6B64BB08FF69E2B7D93638FE86C071AF /* Info.plist */, 249 | 1A6E65CF8703114805F1E4B91BA47564 /* Pods-MultipleSelectionPickerView.modulemap */, 250 | F044FD797C1EC28C8C847633F578D199 /* Pods-MultipleSelectionPickerView-acknowledgements.markdown */, 251 | A7F0371542FF5BFCE14EFA69B70DDDB9 /* Pods-MultipleSelectionPickerView-acknowledgements.plist */, 252 | FD0BCC70D3AF085002A3045EE739A65F /* Pods-MultipleSelectionPickerView-dummy.m */, 253 | 114E8257B8B929FCD89EEA0F2BA60540 /* Pods-MultipleSelectionPickerView-frameworks.sh */, 254 | D494707228C34AA884EC18A0C8F48421 /* Pods-MultipleSelectionPickerView-resources.sh */, 255 | 0794FFF6A9614F064EC897DF17355CF8 /* Pods-MultipleSelectionPickerView-umbrella.h */, 256 | DBE222987C73212FB967345B04C8DA84 /* Pods-MultipleSelectionPickerView.debug.xcconfig */, 257 | 236526DDB697270C4B25EE342AAF45B5 /* Pods-MultipleSelectionPickerView.release.xcconfig */, 258 | ); 259 | name = "Pods-MultipleSelectionPickerView"; 260 | path = "Target Support Files/Pods-MultipleSelectionPickerView"; 261 | sourceTree = ""; 262 | }; 263 | /* End PBXGroup section */ 264 | 265 | /* Begin PBXHeadersBuildPhase section */ 266 | 951646B21614497E0C6A469EFC42090F /* Headers */ = { 267 | isa = PBXHeadersBuildPhase; 268 | buildActionMask = 2147483647; 269 | files = ( 270 | A07E919A3C4AE395D2783F437B86179A /* SwiftyJSON-umbrella.h in Headers */, 271 | ); 272 | runOnlyForDeploymentPostprocessing = 0; 273 | }; 274 | C2D5569E17E217D66641312BD19057BE /* Headers */ = { 275 | isa = PBXHeadersBuildPhase; 276 | buildActionMask = 2147483647; 277 | files = ( 278 | 92F7F38F71DE999234E18100DAC68F64 /* Pods-MultipleSelectionPickerView-umbrella.h in Headers */, 279 | ); 280 | runOnlyForDeploymentPostprocessing = 0; 281 | }; 282 | C57E1A7EEA4BD5C7F4668479295797AD /* Headers */ = { 283 | isa = PBXHeadersBuildPhase; 284 | buildActionMask = 2147483647; 285 | files = ( 286 | D7384896F38F0EF7806DE8F28E8B4F34 /* MultiPickerView-umbrella.h in Headers */, 287 | ); 288 | runOnlyForDeploymentPostprocessing = 0; 289 | }; 290 | /* End PBXHeadersBuildPhase section */ 291 | 292 | /* Begin PBXNativeTarget section */ 293 | 217506683FECCE3608E32FDE9D75BFEE /* SwiftyJSON */ = { 294 | isa = PBXNativeTarget; 295 | buildConfigurationList = 59D82FB3825F3A5214C5EB8A78AED45E /* Build configuration list for PBXNativeTarget "SwiftyJSON" */; 296 | buildPhases = ( 297 | 6DBE0F914F7004C65405B3FDF27F327B /* Sources */, 298 | FBF2EC2EE5AA3CCCBAD13E949DD57111 /* Frameworks */, 299 | 951646B21614497E0C6A469EFC42090F /* Headers */, 300 | ); 301 | buildRules = ( 302 | ); 303 | dependencies = ( 304 | ); 305 | name = SwiftyJSON; 306 | productName = SwiftyJSON; 307 | productReference = 958B62E86C92EE33BED96419FD2C27CF /* SwiftyJSON.framework */; 308 | productType = "com.apple.product-type.framework"; 309 | }; 310 | 3E70696D2F1A61A5D47B8DAD82957606 /* Pods-MultipleSelectionPickerView */ = { 311 | isa = PBXNativeTarget; 312 | buildConfigurationList = F84FAE43B46085172B23C6EE7DCFCA16 /* Build configuration list for PBXNativeTarget "Pods-MultipleSelectionPickerView" */; 313 | buildPhases = ( 314 | EBD90E0855901D6F5C468597DC869167 /* Sources */, 315 | B7B50162C3CD7D08764FF0635829AE0E /* Frameworks */, 316 | C2D5569E17E217D66641312BD19057BE /* Headers */, 317 | ); 318 | buildRules = ( 319 | ); 320 | dependencies = ( 321 | 0BA453489EE1A1CA0D8F578B06C14A38 /* PBXTargetDependency */, 322 | 0FFA6BBCFE6D0B0E6F16E35BC2E49625 /* PBXTargetDependency */, 323 | ); 324 | name = "Pods-MultipleSelectionPickerView"; 325 | productName = "Pods-MultipleSelectionPickerView"; 326 | productReference = 10D4275C013189127D1F200405339BD6 /* Pods_MultipleSelectionPickerView.framework */; 327 | productType = "com.apple.product-type.framework"; 328 | }; 329 | AB4754B7DF53FF3ECAF0D49E93A2BB63 /* MultiPickerView */ = { 330 | isa = PBXNativeTarget; 331 | buildConfigurationList = 5A289C63A9FB9539C4587CE5B576FCD5 /* Build configuration list for PBXNativeTarget "MultiPickerView" */; 332 | buildPhases = ( 333 | 9FA1DE32C1D5B2404CE2988CE0EED99A /* Sources */, 334 | 75230C84ADF1D5C906CB1692A3224949 /* Frameworks */, 335 | 5E9D8108D7657021911E29BC106F552E /* Resources */, 336 | C57E1A7EEA4BD5C7F4668479295797AD /* Headers */, 337 | ); 338 | buildRules = ( 339 | ); 340 | dependencies = ( 341 | 49D04230056866EA77F83B40D26F8A3A /* PBXTargetDependency */, 342 | ); 343 | name = MultiPickerView; 344 | productName = MultiPickerView; 345 | productReference = 3D952415E8A9BC990B05DD2D2943BE96 /* MultiPickerView.framework */; 346 | productType = "com.apple.product-type.framework"; 347 | }; 348 | /* End PBXNativeTarget section */ 349 | 350 | /* Begin PBXProject section */ 351 | D41D8CD98F00B204E9800998ECF8427E /* Project object */ = { 352 | isa = PBXProject; 353 | attributes = { 354 | LastSwiftUpdateCheck = 0930; 355 | LastUpgradeCheck = 0930; 356 | }; 357 | buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; 358 | compatibilityVersion = "Xcode 3.2"; 359 | developmentRegion = English; 360 | hasScannedForEncodings = 0; 361 | knownRegions = ( 362 | en, 363 | ); 364 | mainGroup = 7DB346D0F39D3F0E887471402A8071AB; 365 | productRefGroup = 00AB18029CDE6900CC81C3C8B0762F8E /* Products */; 366 | projectDirPath = ""; 367 | projectRoot = ""; 368 | targets = ( 369 | AB4754B7DF53FF3ECAF0D49E93A2BB63 /* MultiPickerView */, 370 | 3E70696D2F1A61A5D47B8DAD82957606 /* Pods-MultipleSelectionPickerView */, 371 | 217506683FECCE3608E32FDE9D75BFEE /* SwiftyJSON */, 372 | ); 373 | }; 374 | /* End PBXProject section */ 375 | 376 | /* Begin PBXResourcesBuildPhase section */ 377 | 5E9D8108D7657021911E29BC106F552E /* Resources */ = { 378 | isa = PBXResourcesBuildPhase; 379 | buildActionMask = 2147483647; 380 | files = ( 381 | 34FF3A68D6287BA0C22A7EE45035750E /* selectedCheckmark.png in Resources */, 382 | 2D4377374297EA7CCBF248C123254789 /* SelectionView.xib in Resources */, 383 | ); 384 | runOnlyForDeploymentPostprocessing = 0; 385 | }; 386 | /* End PBXResourcesBuildPhase section */ 387 | 388 | /* Begin PBXSourcesBuildPhase section */ 389 | 6DBE0F914F7004C65405B3FDF27F327B /* Sources */ = { 390 | isa = PBXSourcesBuildPhase; 391 | buildActionMask = 2147483647; 392 | files = ( 393 | A98E24402A2534D600FE1EAFF0764B6F /* SwiftyJSON-dummy.m in Sources */, 394 | F0F1BE67EE64928F272D1E57C87D7377 /* SwiftyJSON.swift in Sources */, 395 | ); 396 | runOnlyForDeploymentPostprocessing = 0; 397 | }; 398 | 9FA1DE32C1D5B2404CE2988CE0EED99A /* Sources */ = { 399 | isa = PBXSourcesBuildPhase; 400 | buildActionMask = 2147483647; 401 | files = ( 402 | DD4538BFE14CD7FF2308C1AAC2F23F32 /* DatePickerViewHandler.swift in Sources */, 403 | 807FA39EFB48BD68C6C37B29C3DF49BE /* MultiPickerView-dummy.m in Sources */, 404 | 0DAC8BAA8516306167222B8E48120A19 /* MultipleSelectionPickerScrollHelper.swift in Sources */, 405 | 020AA134C4858F97299DC68B04FFBA59 /* MultipleSelectionPickerViewHandler.swift in Sources */, 406 | 814AF59D015427DB3A66AB7D95DB471A /* PickerView.swift in Sources */, 407 | 9229DC1E38A3A311F4D6BA9421138AC7 /* PickerViewHandler.swift in Sources */, 408 | EB12A7C93A9C58FD959DD8944A181B6A /* SelectionView.swift in Sources */, 409 | 74B34407C60FC532F2B10BAF91F33AB8 /* UIView+Shake.swift in Sources */, 410 | ); 411 | runOnlyForDeploymentPostprocessing = 0; 412 | }; 413 | EBD90E0855901D6F5C468597DC869167 /* Sources */ = { 414 | isa = PBXSourcesBuildPhase; 415 | buildActionMask = 2147483647; 416 | files = ( 417 | B692D9DEFFCC8147901F326D0E2AB27C /* Pods-MultipleSelectionPickerView-dummy.m in Sources */, 418 | ); 419 | runOnlyForDeploymentPostprocessing = 0; 420 | }; 421 | /* End PBXSourcesBuildPhase section */ 422 | 423 | /* Begin PBXTargetDependency section */ 424 | 0BA453489EE1A1CA0D8F578B06C14A38 /* PBXTargetDependency */ = { 425 | isa = PBXTargetDependency; 426 | name = MultiPickerView; 427 | target = AB4754B7DF53FF3ECAF0D49E93A2BB63 /* MultiPickerView */; 428 | targetProxy = 62CDC0C5ACCB8C0A3B224666D476C1CF /* PBXContainerItemProxy */; 429 | }; 430 | 0FFA6BBCFE6D0B0E6F16E35BC2E49625 /* PBXTargetDependency */ = { 431 | isa = PBXTargetDependency; 432 | name = SwiftyJSON; 433 | target = 217506683FECCE3608E32FDE9D75BFEE /* SwiftyJSON */; 434 | targetProxy = 03E737BDA3F9E72A08665B8B67ACF686 /* PBXContainerItemProxy */; 435 | }; 436 | 49D04230056866EA77F83B40D26F8A3A /* PBXTargetDependency */ = { 437 | isa = PBXTargetDependency; 438 | name = SwiftyJSON; 439 | target = 217506683FECCE3608E32FDE9D75BFEE /* SwiftyJSON */; 440 | targetProxy = 4E865E59006446D2FB798774AB838FBD /* PBXContainerItemProxy */; 441 | }; 442 | /* End PBXTargetDependency section */ 443 | 444 | /* Begin XCBuildConfiguration section */ 445 | 2D790A345962984307BB5175FC4A182D /* Release */ = { 446 | isa = XCBuildConfiguration; 447 | baseConfigurationReference = 6481D1016B47DBB011459389058BD47D /* MultiPickerView.xcconfig */; 448 | buildSettings = { 449 | CODE_SIGN_IDENTITY = ""; 450 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 451 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 452 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 453 | CURRENT_PROJECT_VERSION = 1; 454 | DEFINES_MODULE = YES; 455 | DYLIB_COMPATIBILITY_VERSION = 1; 456 | DYLIB_CURRENT_VERSION = 1; 457 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 458 | GCC_PREFIX_HEADER = "Target Support Files/MultiPickerView/MultiPickerView-prefix.pch"; 459 | INFOPLIST_FILE = "Target Support Files/MultiPickerView/Info.plist"; 460 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 461 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 462 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 463 | MODULEMAP_FILE = "Target Support Files/MultiPickerView/MultiPickerView.modulemap"; 464 | PRODUCT_MODULE_NAME = MultiPickerView; 465 | PRODUCT_NAME = MultiPickerView; 466 | SDKROOT = iphoneos; 467 | SKIP_INSTALL = YES; 468 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; 469 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 470 | SWIFT_VERSION = 4.1; 471 | TARGETED_DEVICE_FAMILY = "1,2"; 472 | VALIDATE_PRODUCT = YES; 473 | VERSIONING_SYSTEM = "apple-generic"; 474 | VERSION_INFO_PREFIX = ""; 475 | }; 476 | name = Release; 477 | }; 478 | 39076896E88EE9E21C5EA537A610FC0C /* Debug */ = { 479 | isa = XCBuildConfiguration; 480 | baseConfigurationReference = 6481D1016B47DBB011459389058BD47D /* MultiPickerView.xcconfig */; 481 | buildSettings = { 482 | CODE_SIGN_IDENTITY = ""; 483 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 484 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 485 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 486 | CURRENT_PROJECT_VERSION = 1; 487 | DEFINES_MODULE = YES; 488 | DYLIB_COMPATIBILITY_VERSION = 1; 489 | DYLIB_CURRENT_VERSION = 1; 490 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 491 | GCC_PREFIX_HEADER = "Target Support Files/MultiPickerView/MultiPickerView-prefix.pch"; 492 | INFOPLIST_FILE = "Target Support Files/MultiPickerView/Info.plist"; 493 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 494 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 495 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 496 | MODULEMAP_FILE = "Target Support Files/MultiPickerView/MultiPickerView.modulemap"; 497 | PRODUCT_MODULE_NAME = MultiPickerView; 498 | PRODUCT_NAME = MultiPickerView; 499 | SDKROOT = iphoneos; 500 | SKIP_INSTALL = YES; 501 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; 502 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 503 | SWIFT_VERSION = 4.1; 504 | TARGETED_DEVICE_FAMILY = "1,2"; 505 | VERSIONING_SYSTEM = "apple-generic"; 506 | VERSION_INFO_PREFIX = ""; 507 | }; 508 | name = Debug; 509 | }; 510 | 5DC0083F57E9AB706B46C5B5D73B38D8 /* Debug */ = { 511 | isa = XCBuildConfiguration; 512 | buildSettings = { 513 | ALWAYS_SEARCH_USER_PATHS = NO; 514 | CLANG_ANALYZER_NONNULL = YES; 515 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 516 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 517 | CLANG_CXX_LIBRARY = "libc++"; 518 | CLANG_ENABLE_MODULES = YES; 519 | CLANG_ENABLE_OBJC_ARC = YES; 520 | CLANG_ENABLE_OBJC_WEAK = YES; 521 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 522 | CLANG_WARN_BOOL_CONVERSION = YES; 523 | CLANG_WARN_COMMA = YES; 524 | CLANG_WARN_CONSTANT_CONVERSION = YES; 525 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 526 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 527 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 528 | CLANG_WARN_EMPTY_BODY = YES; 529 | CLANG_WARN_ENUM_CONVERSION = YES; 530 | CLANG_WARN_INFINITE_RECURSION = YES; 531 | CLANG_WARN_INT_CONVERSION = YES; 532 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 533 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 534 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 535 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 536 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 537 | CLANG_WARN_STRICT_PROTOTYPES = YES; 538 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 539 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 540 | CLANG_WARN_UNREACHABLE_CODE = YES; 541 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 542 | CODE_SIGNING_ALLOWED = NO; 543 | CODE_SIGNING_REQUIRED = NO; 544 | COPY_PHASE_STRIP = NO; 545 | DEBUG_INFORMATION_FORMAT = dwarf; 546 | ENABLE_STRICT_OBJC_MSGSEND = YES; 547 | ENABLE_TESTABILITY = YES; 548 | GCC_C_LANGUAGE_STANDARD = gnu11; 549 | GCC_DYNAMIC_NO_PIC = NO; 550 | GCC_NO_COMMON_BLOCKS = YES; 551 | GCC_OPTIMIZATION_LEVEL = 0; 552 | GCC_PREPROCESSOR_DEFINITIONS = ( 553 | "POD_CONFIGURATION_DEBUG=1", 554 | "DEBUG=1", 555 | "$(inherited)", 556 | ); 557 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 558 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 559 | GCC_WARN_UNDECLARED_SELECTOR = YES; 560 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 561 | GCC_WARN_UNUSED_FUNCTION = YES; 562 | GCC_WARN_UNUSED_VARIABLE = YES; 563 | IPHONEOS_DEPLOYMENT_TARGET = 11.4; 564 | MTL_ENABLE_DEBUG_INFO = YES; 565 | ONLY_ACTIVE_ARCH = YES; 566 | PRODUCT_NAME = "$(TARGET_NAME)"; 567 | STRIP_INSTALLED_PRODUCT = NO; 568 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 569 | SYMROOT = "${SRCROOT}/../build"; 570 | }; 571 | name = Debug; 572 | }; 573 | 60C84522780F78A58E8C564973D84810 /* Debug */ = { 574 | isa = XCBuildConfiguration; 575 | baseConfigurationReference = 9B90DFDD78F5197ADC4904324F1A5C26 /* SwiftyJSON.xcconfig */; 576 | buildSettings = { 577 | CODE_SIGN_IDENTITY = ""; 578 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 579 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 580 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 581 | CURRENT_PROJECT_VERSION = 1; 582 | DEFINES_MODULE = YES; 583 | DYLIB_COMPATIBILITY_VERSION = 1; 584 | DYLIB_CURRENT_VERSION = 1; 585 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 586 | GCC_PREFIX_HEADER = "Target Support Files/SwiftyJSON/SwiftyJSON-prefix.pch"; 587 | INFOPLIST_FILE = "Target Support Files/SwiftyJSON/Info.plist"; 588 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 589 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 590 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 591 | MODULEMAP_FILE = "Target Support Files/SwiftyJSON/SwiftyJSON.modulemap"; 592 | PRODUCT_MODULE_NAME = SwiftyJSON; 593 | PRODUCT_NAME = SwiftyJSON; 594 | SDKROOT = iphoneos; 595 | SKIP_INSTALL = YES; 596 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; 597 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 598 | SWIFT_VERSION = 4.0; 599 | TARGETED_DEVICE_FAMILY = "1,2"; 600 | VERSIONING_SYSTEM = "apple-generic"; 601 | VERSION_INFO_PREFIX = ""; 602 | }; 603 | name = Debug; 604 | }; 605 | 9261E2C4C1ABF33173FBEA07DF824E20 /* Release */ = { 606 | isa = XCBuildConfiguration; 607 | baseConfigurationReference = 9B90DFDD78F5197ADC4904324F1A5C26 /* SwiftyJSON.xcconfig */; 608 | buildSettings = { 609 | CODE_SIGN_IDENTITY = ""; 610 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 611 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 612 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 613 | CURRENT_PROJECT_VERSION = 1; 614 | DEFINES_MODULE = YES; 615 | DYLIB_COMPATIBILITY_VERSION = 1; 616 | DYLIB_CURRENT_VERSION = 1; 617 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 618 | GCC_PREFIX_HEADER = "Target Support Files/SwiftyJSON/SwiftyJSON-prefix.pch"; 619 | INFOPLIST_FILE = "Target Support Files/SwiftyJSON/Info.plist"; 620 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 621 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 622 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 623 | MODULEMAP_FILE = "Target Support Files/SwiftyJSON/SwiftyJSON.modulemap"; 624 | PRODUCT_MODULE_NAME = SwiftyJSON; 625 | PRODUCT_NAME = SwiftyJSON; 626 | SDKROOT = iphoneos; 627 | SKIP_INSTALL = YES; 628 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; 629 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 630 | SWIFT_VERSION = 4.0; 631 | TARGETED_DEVICE_FAMILY = "1,2"; 632 | VALIDATE_PRODUCT = YES; 633 | VERSIONING_SYSTEM = "apple-generic"; 634 | VERSION_INFO_PREFIX = ""; 635 | }; 636 | name = Release; 637 | }; 638 | AEEA80476F98EB645C4DD53EB2BB6D88 /* Release */ = { 639 | isa = XCBuildConfiguration; 640 | buildSettings = { 641 | ALWAYS_SEARCH_USER_PATHS = NO; 642 | CLANG_ANALYZER_NONNULL = YES; 643 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 644 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 645 | CLANG_CXX_LIBRARY = "libc++"; 646 | CLANG_ENABLE_MODULES = YES; 647 | CLANG_ENABLE_OBJC_ARC = YES; 648 | CLANG_ENABLE_OBJC_WEAK = YES; 649 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 650 | CLANG_WARN_BOOL_CONVERSION = YES; 651 | CLANG_WARN_COMMA = YES; 652 | CLANG_WARN_CONSTANT_CONVERSION = YES; 653 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 654 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 655 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 656 | CLANG_WARN_EMPTY_BODY = YES; 657 | CLANG_WARN_ENUM_CONVERSION = YES; 658 | CLANG_WARN_INFINITE_RECURSION = YES; 659 | CLANG_WARN_INT_CONVERSION = YES; 660 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 661 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 662 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 663 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 664 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 665 | CLANG_WARN_STRICT_PROTOTYPES = YES; 666 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 667 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 668 | CLANG_WARN_UNREACHABLE_CODE = YES; 669 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 670 | CODE_SIGNING_ALLOWED = NO; 671 | CODE_SIGNING_REQUIRED = NO; 672 | COPY_PHASE_STRIP = NO; 673 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 674 | ENABLE_NS_ASSERTIONS = NO; 675 | ENABLE_STRICT_OBJC_MSGSEND = YES; 676 | GCC_C_LANGUAGE_STANDARD = gnu11; 677 | GCC_NO_COMMON_BLOCKS = YES; 678 | GCC_PREPROCESSOR_DEFINITIONS = ( 679 | "POD_CONFIGURATION_RELEASE=1", 680 | "$(inherited)", 681 | ); 682 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 683 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 684 | GCC_WARN_UNDECLARED_SELECTOR = YES; 685 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 686 | GCC_WARN_UNUSED_FUNCTION = YES; 687 | GCC_WARN_UNUSED_VARIABLE = YES; 688 | IPHONEOS_DEPLOYMENT_TARGET = 11.4; 689 | MTL_ENABLE_DEBUG_INFO = NO; 690 | PRODUCT_NAME = "$(TARGET_NAME)"; 691 | STRIP_INSTALLED_PRODUCT = NO; 692 | SYMROOT = "${SRCROOT}/../build"; 693 | }; 694 | name = Release; 695 | }; 696 | CBD6645FA9D861CDD3DB4669C5F18C6C /* Release */ = { 697 | isa = XCBuildConfiguration; 698 | baseConfigurationReference = 236526DDB697270C4B25EE342AAF45B5 /* Pods-MultipleSelectionPickerView.release.xcconfig */; 699 | buildSettings = { 700 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; 701 | CLANG_ENABLE_OBJC_WEAK = NO; 702 | CODE_SIGN_IDENTITY = ""; 703 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 704 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 705 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 706 | CURRENT_PROJECT_VERSION = 1; 707 | DEFINES_MODULE = YES; 708 | DYLIB_COMPATIBILITY_VERSION = 1; 709 | DYLIB_CURRENT_VERSION = 1; 710 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 711 | INFOPLIST_FILE = "Target Support Files/Pods-MultipleSelectionPickerView/Info.plist"; 712 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 713 | IPHONEOS_DEPLOYMENT_TARGET = 11.4; 714 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 715 | MACH_O_TYPE = staticlib; 716 | MODULEMAP_FILE = "Target Support Files/Pods-MultipleSelectionPickerView/Pods-MultipleSelectionPickerView.modulemap"; 717 | OTHER_LDFLAGS = ""; 718 | OTHER_LIBTOOLFLAGS = ""; 719 | PODS_ROOT = "$(SRCROOT)"; 720 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; 721 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 722 | SDKROOT = iphoneos; 723 | SKIP_INSTALL = YES; 724 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 725 | TARGETED_DEVICE_FAMILY = "1,2"; 726 | VALIDATE_PRODUCT = YES; 727 | VERSIONING_SYSTEM = "apple-generic"; 728 | VERSION_INFO_PREFIX = ""; 729 | }; 730 | name = Release; 731 | }; 732 | D206E9654F1DEBD1C0D2A13858B6D481 /* Debug */ = { 733 | isa = XCBuildConfiguration; 734 | baseConfigurationReference = DBE222987C73212FB967345B04C8DA84 /* Pods-MultipleSelectionPickerView.debug.xcconfig */; 735 | buildSettings = { 736 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; 737 | CLANG_ENABLE_OBJC_WEAK = NO; 738 | CODE_SIGN_IDENTITY = ""; 739 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 740 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 741 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 742 | CURRENT_PROJECT_VERSION = 1; 743 | DEFINES_MODULE = YES; 744 | DYLIB_COMPATIBILITY_VERSION = 1; 745 | DYLIB_CURRENT_VERSION = 1; 746 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 747 | INFOPLIST_FILE = "Target Support Files/Pods-MultipleSelectionPickerView/Info.plist"; 748 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 749 | IPHONEOS_DEPLOYMENT_TARGET = 11.4; 750 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 751 | MACH_O_TYPE = staticlib; 752 | MODULEMAP_FILE = "Target Support Files/Pods-MultipleSelectionPickerView/Pods-MultipleSelectionPickerView.modulemap"; 753 | OTHER_LDFLAGS = ""; 754 | OTHER_LIBTOOLFLAGS = ""; 755 | PODS_ROOT = "$(SRCROOT)"; 756 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; 757 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 758 | SDKROOT = iphoneos; 759 | SKIP_INSTALL = YES; 760 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 761 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 762 | TARGETED_DEVICE_FAMILY = "1,2"; 763 | VERSIONING_SYSTEM = "apple-generic"; 764 | VERSION_INFO_PREFIX = ""; 765 | }; 766 | name = Debug; 767 | }; 768 | /* End XCBuildConfiguration section */ 769 | 770 | /* Begin XCConfigurationList section */ 771 | 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { 772 | isa = XCConfigurationList; 773 | buildConfigurations = ( 774 | 5DC0083F57E9AB706B46C5B5D73B38D8 /* Debug */, 775 | AEEA80476F98EB645C4DD53EB2BB6D88 /* Release */, 776 | ); 777 | defaultConfigurationIsVisible = 0; 778 | defaultConfigurationName = Release; 779 | }; 780 | 59D82FB3825F3A5214C5EB8A78AED45E /* Build configuration list for PBXNativeTarget "SwiftyJSON" */ = { 781 | isa = XCConfigurationList; 782 | buildConfigurations = ( 783 | 60C84522780F78A58E8C564973D84810 /* Debug */, 784 | 9261E2C4C1ABF33173FBEA07DF824E20 /* Release */, 785 | ); 786 | defaultConfigurationIsVisible = 0; 787 | defaultConfigurationName = Release; 788 | }; 789 | 5A289C63A9FB9539C4587CE5B576FCD5 /* Build configuration list for PBXNativeTarget "MultiPickerView" */ = { 790 | isa = XCConfigurationList; 791 | buildConfigurations = ( 792 | 39076896E88EE9E21C5EA537A610FC0C /* Debug */, 793 | 2D790A345962984307BB5175FC4A182D /* Release */, 794 | ); 795 | defaultConfigurationIsVisible = 0; 796 | defaultConfigurationName = Release; 797 | }; 798 | F84FAE43B46085172B23C6EE7DCFCA16 /* Build configuration list for PBXNativeTarget "Pods-MultipleSelectionPickerView" */ = { 799 | isa = XCConfigurationList; 800 | buildConfigurations = ( 801 | D206E9654F1DEBD1C0D2A13858B6D481 /* Debug */, 802 | CBD6645FA9D861CDD3DB4669C5F18C6C /* Release */, 803 | ); 804 | defaultConfigurationIsVisible = 0; 805 | defaultConfigurationName = Release; 806 | }; 807 | /* End XCConfigurationList section */ 808 | }; 809 | rootObject = D41D8CD98F00B204E9800998ECF8427E /* Project object */; 810 | } 811 | -------------------------------------------------------------------------------- /Example/Pods/SwiftyJSON/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 Ruoyu Fu 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 13 | all 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 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /Example/Pods/SwiftyJSON/README.md: -------------------------------------------------------------------------------- 1 | # SwiftyJSON 2 | 3 | [![Travis CI](https://travis-ci.org/SwiftyJSON/SwiftyJSON.svg?branch=master)](https://travis-ci.org/SwiftyJSON/SwiftyJSON) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) ![CocoaPods](https://img.shields.io/cocoapods/v/SwiftyJSON.svg) ![Platform](https://img.shields.io/badge/platforms-iOS%208.0+%20%7C%20macOS%2010.10+%20%7C%20tvOS%209.0+%20%7C%20watchOS%202.0+-333333.svg) 4 | 5 | SwiftyJSON makes it easy to deal with JSON data in Swift. 6 | 7 | 1. [Why is the typical JSON handling in Swift NOT good](#why-is-the-typical-json-handling-in-swift-not-good) 8 | 2. [Requirements](#requirements) 9 | 3. [Integration](#integration) 10 | 4. [Usage](#usage) 11 | - [Initialization](#initialization) 12 | - [Subscript](#subscript) 13 | - [Loop](#loop) 14 | - [Error](#error) 15 | - [Optional getter](#optional-getter) 16 | - [Non-optional getter](#non-optional-getter) 17 | - [Setter](#setter) 18 | - [Raw object](#raw-object) 19 | - [Literal convertibles](#literal-convertibles) 20 | - [Merging](#merging) 21 | 5. [Work with Alamofire](#work-with-alamofire) 22 | 6. [Work with Moya](#work-with-moya) 23 | 24 | > [中文介绍](http://tangplin.github.io/swiftyjson/) 25 | 26 | 27 | ## Why is the typical JSON handling in Swift NOT good? 28 | 29 | Swift is very strict about types. But although explicit typing is good for saving us from mistakes, it becomes painful when dealing with JSON and other areas that are, by nature, implicit about types. 30 | 31 | Take the Twitter API for example. Say we want to retrieve a user's "name" value of some tweet in Swift (according to [Twitter's API](https://developer.twitter.com/en/docs/tweets/timelines/api-reference/get-statuses-home_timeline)). 32 | 33 | The code would look like this: 34 | 35 | ```swift 36 | if let statusesArray = try? JSONSerialization.jsonObject(with: data, options: .allowFragments) as? [[String: Any]], 37 | let user = statusesArray[0]["user"] as? [String: Any], 38 | let username = user["name"] as? String { 39 | // Finally we got the username 40 | } 41 | ``` 42 | 43 | It's not good. 44 | 45 | Even if we use optional chaining, it would be messy: 46 | 47 | ```swift 48 | if let JSONObject = try JSONSerialization.jsonObject(with: data, options: .allowFragments) as? [[String: Any]], 49 | let username = (JSONObject[0]["user"] as? [String: Any])?["name"] as? String { 50 | // There's our username 51 | } 52 | ``` 53 | 54 | An unreadable mess--for something that should really be simple! 55 | 56 | With SwiftyJSON all you have to do is: 57 | 58 | ```swift 59 | let json = JSON(data: dataFromNetworking) 60 | if let userName = json[0]["user"]["name"].string { 61 | //Now you got your value 62 | } 63 | ``` 64 | 65 | And don't worry about the Optional Wrapping thing. It's done for you automatically. 66 | 67 | ```swift 68 | let json = JSON(data: dataFromNetworking) 69 | if let userName = json[999999]["wrong_key"]["wrong_name"].string { 70 | //Calm down, take it easy, the ".string" property still produces the correct Optional String type with safety 71 | } else { 72 | //Print the error 73 | print(json[999999]["wrong_key"]["wrong_name"]) 74 | } 75 | ``` 76 | 77 | ## Requirements 78 | 79 | - iOS 8.0+ | macOS 10.10+ | tvOS 9.0+ | watchOS 2.0+ 80 | - Xcode 8 81 | 82 | ## Integration 83 | 84 | #### CocoaPods (iOS 8+, OS X 10.9+) 85 | 86 | You can use [CocoaPods](http://cocoapods.org/) to install `SwiftyJSON` by adding it to your `Podfile`: 87 | 88 | ```ruby 89 | platform :ios, '8.0' 90 | use_frameworks! 91 | 92 | target 'MyApp' do 93 | pod 'SwiftyJSON', '~> 4.0' 94 | end 95 | ``` 96 | 97 | #### Carthage (iOS 8+, OS X 10.9+) 98 | 99 | You can use [Carthage](https://github.com/Carthage/Carthage) to install `SwiftyJSON` by adding it to your `Cartfile`: 100 | 101 | ``` 102 | github "SwiftyJSON/SwiftyJSON" ~> 4.0 103 | ``` 104 | 105 | If you use Carthage to build your dependencies, make sure you have added `SwiftyJSON.framework` to the "Linked Frameworks and Libraries" section of your target, and have included them in your Carthage framework copying build phase. 106 | 107 | #### Swift Package Manager 108 | 109 | You can use [The Swift Package Manager](https://swift.org/package-manager) to install `SwiftyJSON` by adding the proper description to your `Package.swift` file: 110 | 111 | ```swift 112 | // swift-tools-version:4.0 113 | import PackageDescription 114 | 115 | let package = Package( 116 | name: "YOUR_PROJECT_NAME", 117 | dependencies: [ 118 | .package(url: "https://github.com/SwiftyJSON/SwiftyJSON.git", from: "4.0.0"), 119 | ] 120 | ) 121 | ``` 122 | Then run `swift build` whenever you get prepared. 123 | 124 | #### Manually (iOS 7+, OS X 10.9+) 125 | 126 | To use this library in your project manually you may: 127 | 128 | 1. for Projects, just drag SwiftyJSON.swift to the project tree 129 | 2. for Workspaces, include the whole SwiftyJSON.xcodeproj 130 | 131 | ## Usage 132 | 133 | #### Initialization 134 | 135 | ```swift 136 | import SwiftyJSON 137 | ``` 138 | 139 | ```swift 140 | let json = JSON(data: dataFromNetworking) 141 | ``` 142 | Or 143 | 144 | ```swift 145 | let json = JSON(jsonObject) 146 | ``` 147 | Or 148 | 149 | ```swift 150 | if let dataFromString = jsonString.data(using: .utf8, allowLossyConversion: false) { 151 | let json = JSON(data: dataFromString) 152 | } 153 | ``` 154 | 155 | #### Subscript 156 | 157 | ```swift 158 | // Getting a double from a JSON Array 159 | let name = json[0].double 160 | ``` 161 | 162 | ```swift 163 | // Getting an array of string from a JSON Array 164 | let arrayNames = json["users"].arrayValue.map({$0["name"].stringValue}) 165 | ``` 166 | 167 | ```swift 168 | // Getting a string from a JSON Dictionary 169 | let name = json["name"].stringValue 170 | ``` 171 | 172 | ```swift 173 | // Getting a string using a path to the element 174 | let path: [JSONSubscriptType] = [1,"list",2,"name"] 175 | let name = json[path].string 176 | // Just the same 177 | let name = json[1]["list"][2]["name"].string 178 | // Alternatively 179 | let name = json[1,"list",2,"name"].string 180 | ``` 181 | 182 | ```swift 183 | // With a hard way 184 | let name = json[].string 185 | ``` 186 | 187 | ```swift 188 | // With a custom way 189 | let keys:[JSONSubscriptType] = [1,"list",2,"name"] 190 | let name = json[keys].string 191 | ``` 192 | 193 | #### Loop 194 | 195 | ```swift 196 | // If json is .Dictionary 197 | for (key,subJson):(String, JSON) in json { 198 | // Do something you want 199 | } 200 | ``` 201 | 202 | *The first element is always a String, even if the JSON is an Array* 203 | 204 | ```swift 205 | // If json is .Array 206 | // The `index` is 0.. = json["list"].arrayValue 325 | ``` 326 | 327 | ```swift 328 | // If not a Dictionary or nil, return [:] 329 | let user: Dictionary = json["user"].dictionaryValue 330 | ``` 331 | 332 | #### Setter 333 | 334 | ```swift 335 | json["name"] = JSON("new-name") 336 | json[0] = JSON(1) 337 | ``` 338 | 339 | ```swift 340 | json["id"].int = 1234567890 341 | json["coordinate"].double = 8766.766 342 | json["name"].string = "Jack" 343 | json.arrayObject = [1,2,3,4] 344 | json.dictionaryObject = ["name":"Jack", "age":25] 345 | ``` 346 | 347 | #### Raw object 348 | 349 | ```swift 350 | let rawObject: Any = json.object 351 | ``` 352 | 353 | ```swift 354 | let rawValue: Any = json.rawValue 355 | ``` 356 | 357 | ```swift 358 | //convert the JSON to raw NSData 359 | do { 360 | let rawData = try json.rawData() 361 | //Do something you want 362 | } catch { 363 | print("Error \(error)") 364 | } 365 | ``` 366 | 367 | ```swift 368 | //convert the JSON to a raw String 369 | if let rawString = json.rawString() { 370 | //Do something you want 371 | } else { 372 | print("json.rawString is nil") 373 | } 374 | ``` 375 | 376 | #### Existence 377 | 378 | ```swift 379 | // shows you whether value specified in JSON or not 380 | if json["name"].exists() 381 | ``` 382 | 383 | #### Literal convertibles 384 | 385 | For more info about literal convertibles: [Swift Literal Convertibles](http://nshipster.com/swift-literal-convertible/) 386 | 387 | ```swift 388 | // StringLiteralConvertible 389 | let json: JSON = "I'm a json" 390 | ``` 391 | 392 | ```swift 393 | / /IntegerLiteralConvertible 394 | let json: JSON = 12345 395 | ``` 396 | 397 | ```swift 398 | // BooleanLiteralConvertible 399 | let json: JSON = true 400 | ``` 401 | 402 | ```swift 403 | // FloatLiteralConvertible 404 | let json: JSON = 2.8765 405 | ``` 406 | 407 | ```swift 408 | // DictionaryLiteralConvertible 409 | let json: JSON = ["I":"am", "a":"json"] 410 | ``` 411 | 412 | ```swift 413 | // ArrayLiteralConvertible 414 | let json: JSON = ["I", "am", "a", "json"] 415 | ``` 416 | 417 | ```swift 418 | // With subscript in array 419 | var json: JSON = [1,2,3] 420 | json[0] = 100 421 | json[1] = 200 422 | json[2] = 300 423 | json[999] = 300 // Don't worry, nothing will happen 424 | ``` 425 | 426 | ```swift 427 | // With subscript in dictionary 428 | var json: JSON = ["name": "Jack", "age": 25] 429 | json["name"] = "Mike" 430 | json["age"] = "25" // It's OK to set String 431 | json["address"] = "L.A." // Add the "address": "L.A." in json 432 | ``` 433 | 434 | ```swift 435 | // Array & Dictionary 436 | var json: JSON = ["name": "Jack", "age": 25, "list": ["a", "b", "c", ["what": "this"]]] 437 | json["list"][3]["what"] = "that" 438 | json["list",3,"what"] = "that" 439 | let path: [JSONSubscriptType] = ["list",3,"what"] 440 | json[path] = "that" 441 | ``` 442 | 443 | ```swift 444 | // With other JSON objects 445 | let user: JSON = ["username" : "Steve", "password": "supersecurepassword"] 446 | let auth: JSON = [ 447 | "user": user.object, // use user.object instead of just user 448 | "apikey": "supersecretapitoken" 449 | ] 450 | ``` 451 | 452 | #### Merging 453 | 454 | It is possible to merge one JSON into another JSON. Merging a JSON into another JSON adds all non existing values to the original JSON which are only present in the `other` JSON. 455 | 456 | If both JSONs contain a value for the same key, _mostly_ this value gets overwritten in the original JSON, but there are two cases where it provides some special treatment: 457 | 458 | - In case of both values being a `JSON.Type.array` the values form the array found in the `other` JSON getting appended to the original JSON's array value. 459 | - In case of both values being a `JSON.Type.dictionary` both JSON-values are getting merged the same way the encapsulating JSON is merged. 460 | 461 | In case, where two fields in a JSON have a different types, the value will get always overwritten. 462 | 463 | There are two different fashions for merging: `merge` modifies the original JSON, whereas `merged` works non-destructively on a copy. 464 | 465 | ```swift 466 | let original: JSON = [ 467 | "first_name": "John", 468 | "age": 20, 469 | "skills": ["Coding", "Reading"], 470 | "address": [ 471 | "street": "Front St", 472 | "zip": "12345", 473 | ] 474 | ] 475 | 476 | let update: JSON = [ 477 | "last_name": "Doe", 478 | "age": 21, 479 | "skills": ["Writing"], 480 | "address": [ 481 | "zip": "12342", 482 | "city": "New York City" 483 | ] 484 | ] 485 | 486 | let updated = original.merge(with: update) 487 | // [ 488 | // "first_name": "John", 489 | // "last_name": "Doe", 490 | // "age": 21, 491 | // "skills": ["Coding", "Reading", "Writing"], 492 | // "address": [ 493 | // "street": "Front St", 494 | // "zip": "12342", 495 | // "city": "New York City" 496 | // ] 497 | // ] 498 | ``` 499 | 500 | ## String representation 501 | There are two options available: 502 | - use the default Swift one 503 | - use a custom one that will handle optionals well and represent `nil` as `"null"`: 504 | ```swift 505 | let dict = ["1":2, "2":"two", "3": nil] as [String: Any?] 506 | let json = JSON(dict) 507 | let representation = json.rawString(options: [.castNilToNSNull: true]) 508 | // representation is "{\"1\":2,\"2\":\"two\",\"3\":null}", which represents {"1":2,"2":"two","3":null} 509 | ``` 510 | 511 | ## Work with [Alamofire](https://github.com/Alamofire/Alamofire) 512 | 513 | SwiftyJSON nicely wraps the result of the Alamofire JSON response handler: 514 | 515 | ```swift 516 | Alamofire.request(url, method: .get).validate().responseJSON { response in 517 | switch response.result { 518 | case .success(let value): 519 | let json = JSON(value) 520 | print("JSON: \(json)") 521 | case .failure(let error): 522 | print(error) 523 | } 524 | } 525 | ``` 526 | 527 | We also provide an extension of Alamofire for serializing NSData to SwiftyJSON's JSON. 528 | 529 | See: [Alamofire-SwiftyJSON](https://github.com/SwiftyJSON/Alamofire-SwiftyJSON) 530 | 531 | 532 | ## Work with [Moya](https://github.com/Moya/Moya) 533 | 534 | SwiftyJSON parse data to JSON: 535 | 536 | ```swift 537 | let provider = MoyaProvider() 538 | provider.request(.showProducts) { result in 539 | switch result { 540 | case let .success(moyaResponse): 541 | let data = moyaResponse.data 542 | let json = JSON(data: data) // convert network data to json 543 | print(json) 544 | case let .failure(error): 545 | print("error: \(error)") 546 | } 547 | } 548 | 549 | ``` 550 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MultiPickerView/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 0.0.7 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MultiPickerView/MultiPickerView-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_MultiPickerView : NSObject 3 | @end 4 | @implementation PodsDummy_MultiPickerView 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MultiPickerView/MultiPickerView-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/MultiPickerView/MultiPickerView-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 MultiPickerViewVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char MultiPickerViewVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MultiPickerView/MultiPickerView.modulemap: -------------------------------------------------------------------------------- 1 | framework module MultiPickerView { 2 | umbrella header "MultiPickerView-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MultiPickerView/MultiPickerView.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/MultiPickerView 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/SwiftyJSON" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/MultiPickerView 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MultipleSelectionPickerView/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-MultipleSelectionPickerView/Pods-MultipleSelectionPickerView-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## MultiPickerView 5 | 6 | MIT License 7 | 8 | Copyright (c) 2018 Hayk Brsoyan 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 | 29 | ## SwiftyJSON 30 | 31 | The MIT License (MIT) 32 | 33 | Copyright (c) 2017 Ruoyu Fu 34 | 35 | Permission is hereby granted, free of charge, to any person obtaining a copy 36 | of this software and associated documentation files (the "Software"), to deal 37 | in the Software without restriction, including without limitation the rights 38 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 39 | copies of the Software, and to permit persons to whom the Software is 40 | furnished to do so, subject to the following conditions: 41 | 42 | The above copyright notice and this permission notice shall be included in 43 | all copies or substantial portions of the Software. 44 | 45 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 46 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 47 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 48 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 49 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 50 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 51 | THE SOFTWARE. 52 | 53 | Generated by CocoaPods - https://cocoapods.org 54 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MultipleSelectionPickerView/Pods-MultipleSelectionPickerView-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | MIT License 18 | 19 | Copyright (c) 2018 Hayk Brsoyan 20 | 21 | Permission is hereby granted, free of charge, to any person obtaining a copy 22 | of this software and associated documentation files (the "Software"), to deal 23 | in the Software without restriction, including without limitation the rights 24 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 25 | copies of the Software, and to permit persons to whom the Software is 26 | furnished to do so, subject to the following conditions: 27 | 28 | The above copyright notice and this permission notice shall be included in all 29 | copies or substantial portions of the Software. 30 | 31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 34 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 35 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 36 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 37 | SOFTWARE. 38 | 39 | License 40 | MIT 41 | Title 42 | MultiPickerView 43 | Type 44 | PSGroupSpecifier 45 | 46 | 47 | FooterText 48 | The MIT License (MIT) 49 | 50 | Copyright (c) 2017 Ruoyu Fu 51 | 52 | Permission is hereby granted, free of charge, to any person obtaining a copy 53 | of this software and associated documentation files (the "Software"), to deal 54 | in the Software without restriction, including without limitation the rights 55 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 56 | copies of the Software, and to permit persons to whom the Software is 57 | furnished to do so, subject to the following conditions: 58 | 59 | The above copyright notice and this permission notice shall be included in 60 | all copies or substantial portions of the Software. 61 | 62 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 63 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 64 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 65 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 66 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 67 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 68 | THE SOFTWARE. 69 | 70 | License 71 | MIT 72 | Title 73 | SwiftyJSON 74 | Type 75 | PSGroupSpecifier 76 | 77 | 78 | FooterText 79 | Generated by CocoaPods - https://cocoapods.org 80 | Title 81 | 82 | Type 83 | PSGroupSpecifier 84 | 85 | 86 | StringsTable 87 | Acknowledgements 88 | Title 89 | Acknowledgements 90 | 91 | 92 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MultipleSelectionPickerView/Pods-MultipleSelectionPickerView-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_MultipleSelectionPickerView : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_MultipleSelectionPickerView 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MultipleSelectionPickerView/Pods-MultipleSelectionPickerView-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 | 145 | if [[ "$CONFIGURATION" == "Debug" ]]; then 146 | install_framework "${BUILT_PRODUCTS_DIR}/MultiPickerView/MultiPickerView.framework" 147 | install_framework "${BUILT_PRODUCTS_DIR}/SwiftyJSON/SwiftyJSON.framework" 148 | fi 149 | if [[ "$CONFIGURATION" == "Release" ]]; then 150 | install_framework "${BUILT_PRODUCTS_DIR}/MultiPickerView/MultiPickerView.framework" 151 | install_framework "${BUILT_PRODUCTS_DIR}/SwiftyJSON/SwiftyJSON.framework" 152 | fi 153 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 154 | wait 155 | fi 156 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MultipleSelectionPickerView/Pods-MultipleSelectionPickerView-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-MultipleSelectionPickerView/Pods-MultipleSelectionPickerView-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_MultipleSelectionPickerViewVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_MultipleSelectionPickerViewVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MultipleSelectionPickerView/Pods-MultipleSelectionPickerView.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MultiPickerView" "${PODS_CONFIGURATION_BUILD_DIR}/SwiftyJSON" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/MultiPickerView/MultiPickerView.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/SwiftyJSON/SwiftyJSON.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "MultiPickerView" -framework "SwiftyJSON" 7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MultipleSelectionPickerView/Pods-MultipleSelectionPickerView.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_MultipleSelectionPickerView { 2 | umbrella header "Pods-MultipleSelectionPickerView-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-MultipleSelectionPickerView/Pods-MultipleSelectionPickerView.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MultiPickerView" "${PODS_CONFIGURATION_BUILD_DIR}/SwiftyJSON" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/MultiPickerView/MultiPickerView.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/SwiftyJSON/SwiftyJSON.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "MultiPickerView" -framework "SwiftyJSON" 7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/SwiftyJSON/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 | 4.1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/SwiftyJSON/SwiftyJSON-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_SwiftyJSON : NSObject 3 | @end 4 | @implementation PodsDummy_SwiftyJSON 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/SwiftyJSON/SwiftyJSON-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/SwiftyJSON/SwiftyJSON-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 SwiftyJSONVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char SwiftyJSONVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/SwiftyJSON/SwiftyJSON.modulemap: -------------------------------------------------------------------------------- 1 | framework module SwiftyJSON { 2 | umbrella header "SwiftyJSON-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/SwiftyJSON/SwiftyJSON.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/SwiftyJSON 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 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}/SwiftyJSON 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /Info/gif0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Brsoyan/Multiple-Selection-Picker/fd0d416f0f27c3698cdda61e64ebbc3e9b7f13c1/Info/gif0.gif -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Hayk Brsoyan 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 | -------------------------------------------------------------------------------- /MultiPickerView.podspec: -------------------------------------------------------------------------------- 1 | 2 | Pod::Spec.new do |s| 3 | 4 | s.name = "MultiPickerView" 5 | s.version = "0.0.7" 6 | s.summary = "Picker View with multi row selection." 7 | s.homepage = "https://github.com/Brsoyan/Multiple-Selection-Picker" 8 | s.license = 'MIT' 9 | s.author = { "Brsoyan" => "haykbrsoyan@gmail.com" } 10 | s.source = { :git => 'https://github.com/Brsoyan/Multiple-Selection-Picker', :tag => s.version } 11 | s.social_media_url = "https://www.linkedin.com/in/hayk-brsoyan-33889871/" 12 | s.platform = :ios, "9.0" 13 | s.source_files = "Sources/*.swift" 14 | s.exclude_files = "Sources/Exclude" 15 | s.resources = "Resources/*.png", "Resources/*.xib", 16 | s.swift_version = "4.1" 17 | 18 | s.dependency 'SwiftyJSON', '4.1.0' 19 | 20 | 21 | end 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MultiPickerView 2 | 3 | 4 | 5 | ## Integration 6 | 7 | 1. You can use [CocoaPods](https://www.google.com) to install MultiPickerView by adding it to your Podfile. 8 | 2. Add this line to your Podfile 9 | ``` pod 'MultiPickerView' ``` 10 | 11 | 3. Run the following command: 12 | ``` pod install ``` 13 | 14 | 4. Don't forget to use the `.xcworkspace` file to open your project in Xcode, instead of the `.xcodeproj` file, from here on out. 15 | 16 | 5. In the future, to update to the latest version of the SDK, just run: 17 | ``` pod update MultiPickerView ``` 18 | 19 | 20 | ## Examples 21 | 22 | There are 1 example app included in the repository: 23 | - [Example](https://github.com/Brsoyan/Multiple-Selection-Picker/tree/master/Example) 24 | 25 | Example app is a great place to start if you're evaluating whether you want to use our Standard Integration (Swift) or build your own Custom Integration (ObjC). 26 | 27 | Open ./Stripe.xcworkspace (not ./MultipleSelectionPickerView.xcworkspace) with Xcode 28 | run `pod install` in terminal. 29 | 30 | Build and run the "MultipleSelectionPickerView" scheme 31 | 32 | ![](https://github.com/Brsoyan/Multiple-Selection-Picker/blob/master/Info/gif0.gif) 33 | 34 | ## Contributing 35 | 36 | We welcome contributions of any kind including new features, bug fixes, and documentation improvements. Please first open an issue describing what you want to build if it is a major change so that we can discuss how to move forward. Otherwise, go ahead and open a pull request for minor changes such as typo fixes and one liners. 37 | 38 | ### Features 39 | PickerViewHandler,DatePickerViewHandler and MultipleSelectionPickerViewHandler easy to use. 40 | Create data let data = DataObj() 41 | DataObj will need to confitm to protocol `PickerData` 42 | 43 | Create picker handeler `private var pickerHandler = PickerViewHandler(data: data)` 44 | 45 | ``` 46 | protocol PickerData: class { 47 | func id(for row: Int) -> Int 48 | func long(for row: Int) -> String 49 | func short(for row: Int) -> String 50 | func count() -> Int 51 | } 52 | ``` 53 | 54 | When should show picker call `config` function and pass parent View Controller, data if you don't pass in initializer and onSelectedTitle closure if we need to update our view dynamically. 55 | 56 | Create PickerDelegate listener if we need to listen show and close actions. 57 | 58 | ``` 59 | protocol PickerDelegate: class { 60 | func pickerDidHide(text: String, owner: UIView?, ids:[Int]) 61 | func pickerTextIsEmpty(owner: UIView?) 62 | } 63 | ``` 64 | 65 | In MultipleSelectionPickerViewHandler picker view is a custom view, you can override `SelectionView` 66 | 67 | 68 | -------------------------------------------------------------------------------- /Resources/SelectionView.xib: -------------------------------------------------------------------------------- 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 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /Resources/selectedCheckmark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Brsoyan/Multiple-Selection-Picker/fd0d416f0f27c3698cdda61e64ebbc3e9b7f13c1/Resources/selectedCheckmark.png -------------------------------------------------------------------------------- /Sources/DatePickerViewHandler.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DatePickerViewHandler.swift 3 | // freighthaul 4 | // 5 | // Created by Hayk Brsoyan on 6/8/18. 6 | // Copyright © 2018 Hayk Brsoyan. All rights reserved. 7 | // 8 | import UIKit 9 | 10 | public class DatePickerViewHandler: PickerViewHandler { 11 | private var months = [String]() 12 | private var years = [Int]() 13 | private var days = [Int]() 14 | 15 | var day: Int = 0 16 | var month: Int = 0 17 | var year: Int = 0 18 | 19 | var onSelectedDate: ((_ day: Int, _ month: String, _ year: Int) -> Void)? 20 | 21 | override public init(data: PickerData) { 22 | super.init(data: data) 23 | self.commonSetup() 24 | self.numberOfComponents = 3 25 | } 26 | 27 | func commonSetup() { 28 | self.years = getYears() 29 | self.months = getMonths() 30 | self.days = Array(1...31) 31 | } 32 | 33 | private func getYears() -> [Int] { 34 | var years = [Int]() 35 | let year = Calendar.current.component(.year, from: Date()) 36 | for year in RegistrationConstants.minYear...(year - RegistrationConstants.minAge) { 37 | years.append(year) 38 | } 39 | 40 | return years.reversed() 41 | } 42 | 43 | private func getMonths() -> [String] { 44 | var months = [String]() 45 | let dateFormatter = DateFormatter() 46 | for month in 0...11 { 47 | months.append(dateFormatter.monthSymbols[month]) 48 | } 49 | return months 50 | } 51 | 52 | override func updateData() { 53 | self.months = getMonths() 54 | onSelectedDate?(day, months[month - 1], year) 55 | } 56 | 57 | override func stopUpdate() { 58 | onSelectedDate = nil 59 | } 60 | 61 | override func title(for row: Int, component: Int?) -> String { 62 | switch component { 63 | case Column.first: 64 | return "\(days[row])" 65 | case Column.second: 66 | return months[row] 67 | case Column.third: 68 | return "\(years[row])" 69 | default: 70 | return "" 71 | } 72 | } 73 | 74 | public func pickerView(_ pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusing view: UIView?) -> UIView { 75 | let title = self.title(for: row, component: component) 76 | 77 | guard let reusingLabel = view as? UILabel else { 78 | let label = UILabel.init() 79 | label.attributedText = NSAttributedString(string: title) 80 | label.textAlignment = .center 81 | return label 82 | } 83 | 84 | reusingLabel.attributedText = NSAttributedString(string: title) 85 | 86 | return reusingLabel 87 | } 88 | 89 | override public func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int { 90 | switch component { 91 | case Column.first: 92 | return days.count 93 | case Column.second: 94 | return months.count 95 | case Column.third: 96 | return years.count 97 | default: 98 | return 0 99 | } 100 | } 101 | 102 | override public func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) { 103 | selectedRow = row 104 | let day = self.picker.selectedRow(inComponent: Column.first) + 1 105 | let month = self.picker.selectedRow(inComponent: Column.second) + 1 106 | let year = years[self.picker.selectedRow(inComponent: Column.third)] 107 | 108 | onSelectedDate?(day, months[month - 1], year) 109 | 110 | self.day = day 111 | self.month = month 112 | self.year = year 113 | } 114 | 115 | override func dismiss() { 116 | if selectedRow == 0 { 117 | onSelectedDate?(1, months[0], years[0]) 118 | } 119 | 120 | self.parentVC?.view.endEditing(true) 121 | } 122 | 123 | private struct Column { 124 | static let first = 0 125 | static let second = 1 126 | static let third = 2 127 | } 128 | } 129 | 130 | 131 | struct RegistrationConstants { 132 | static let minAge = 18 133 | static let minAgeForCasino = 21 134 | static let minYear = 1901 135 | } 136 | -------------------------------------------------------------------------------- /Sources/MultipleSelectionPickerScrollHelper.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MultipleSelectionPickerScrollHelper.swift 3 | // freighthaul 4 | // 5 | // Created by Hayk Brsoyan on 7/7/18. 6 | // Copyright © 2018 Hayk Brsoyan. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | protocol MultipleSelectionPickerScrollDelegate: class { 12 | func select() 13 | } 14 | 15 | public class MultipleSelectionPickerScrollHelper: NSObject, UIGestureRecognizerDelegate { 16 | 17 | weak var delegate: MultipleSelectionPickerScrollDelegate? 18 | weak var owner: MultipleSelectionPickerViewHandler? 19 | private var shouldRecognizeSimultaneously = 0 20 | private var isSelectInRow = false 21 | 22 | init(owner: MultipleSelectionPickerViewHandler) { 23 | self.owner = owner 24 | } 25 | 26 | public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRequireFailureOf otherGestureRecognizer: UIGestureRecognizer) -> Bool { 27 | if otherGestureRecognizer is UITapGestureRecognizer && gestureRecognizer is UITapGestureRecognizer { 28 | shouldRecognizeSimultaneously = 0 29 | 30 | if owner?.isSelectInRow(gestureRecognizer: otherGestureRecognizer) == true { 31 | isSelectInRow = true 32 | } 33 | } 34 | 35 | return false 36 | } 37 | 38 | public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool { 39 | 40 | if otherGestureRecognizer is UITapGestureRecognizer && shouldRecognizeSimultaneously == 0 && isSelectInRow == true { 41 | delegate?.select() 42 | } 43 | 44 | isSelectInRow = false 45 | shouldRecognizeSimultaneously += 1 46 | 47 | return false 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Sources/MultipleSelectionPickerViewHandler.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MultipleSelectionPickerViewHandler.swift 3 | // freighthaul 4 | // 5 | // Created by Hayk Brsoyan on 6/27/18. 6 | // Copyright © 2018 Hayk Brsoyan. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public class MultipleSelectionPickerViewHandler: PickerViewHandler, MultipleSelectionPickerScrollDelegate { 12 | private struct MultipleSelectionConstants { 13 | static let rowHeight: CGFloat = 44 14 | } 15 | 16 | private var itemCount = 0 17 | private var scrollHelper: MultipleSelectionPickerScrollHelper? 18 | 19 | override var data: PickerData { 20 | didSet { 21 | itemCount = data.count() 22 | } 23 | } 24 | 25 | override public init(data: PickerData) { 26 | super.init(data: data) 27 | let tap = UITapGestureRecognizer.init(target: self, action: nil) 28 | picker.addGestureRecognizer(tap) 29 | 30 | scrollHelper = MultipleSelectionPickerScrollHelper(owner: self) 31 | scrollHelper?.delegate = self 32 | tap.delegate = self.scrollHelper 33 | } 34 | 35 | public func pickerView(_ pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusing view: UIView?) -> UIView { 36 | guard let reusingView = view as? SelectionView else { 37 | let view = SelectionView.init(frame: CGRect(x: 0, y: 0, width: pickerView.bounds.width * 0.8, height: MultipleSelectionConstants.rowHeight)) 38 | setData(view: view, row: row) 39 | return view 40 | } 41 | 42 | setData(view: reusingView, row: row) 43 | return reusingView 44 | } 45 | 46 | private func setData(view: SelectionView, row: Int) { 47 | let title = data.long(for: row) 48 | 49 | var type = view.type 50 | if selectedRows.contains(row) { 51 | type = .selected 52 | } 53 | view.config(type: type, text: title) 54 | } 55 | 56 | override func toolBar() -> CGFloat { 57 | let toolBar = UIToolbar() 58 | toolBar.barStyle = .default 59 | toolBar.isTranslucent = true 60 | 61 | var color = UIColor.blue 62 | if let tintColor = self.tintColor { 63 | color = tintColor 64 | } 65 | 66 | toolBar.tintColor = color 67 | toolBar.sizeToFit() 68 | 69 | var leftText = "Select" 70 | if let txt = self.leftButtonText { 71 | leftText = txt 72 | } 73 | 74 | var rightText = "Done" 75 | if let txt = self.rightButtonText { 76 | rightText = txt 77 | } 78 | 79 | let closeButton = UIBarButtonItem(title: rightText, style: .plain, target: self, action: #selector(dismiss)) 80 | let doneButton = UIBarButtonItem(title: leftText, style: .plain, target: self, action: #selector(select)) 81 | let spaceButton = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil) 82 | toolBar.setItems([closeButton, spaceButton, doneButton], animated: false) 83 | toolBar.isUserInteractionEnabled = true 84 | textField.inputAccessoryView = toolBar 85 | 86 | return toolBar.frame.height + picker.frame.height 87 | } 88 | 89 | @objc func select() { 90 | let row = picker.selectedRow(inComponent: 0) 91 | selectRow(row: row) 92 | } 93 | 94 | private func selectRow(row: Int) { 95 | let view = picker.view(forRow: row, forComponent: 0) 96 | guard let selectedView = view as? SelectionView else { return } 97 | 98 | if row == 0 && !selectedRows.contains(row) { 99 | selectedRows = Set(0 ..< data.count()) 100 | } else if row == 0 && selectedRows.contains(row) { 101 | selectedRows.removeAll() 102 | } 103 | 104 | let selected = selectedView.select() 105 | if selected == true { 106 | selectedRows.insert(row) 107 | if selectedRows.count + 1 == itemCount { 108 | selectedRows.insert(0) 109 | } 110 | } else { 111 | selectedRows.remove(row) 112 | selectedRows.remove(0) 113 | } 114 | 115 | DispatchQueue.main.async { 116 | self.picker.reloadAllComponents() 117 | } 118 | } 119 | 120 | override func selectedRowData() -> (title: String, ids: [Int]) { 121 | var str = "" 122 | var ids = [Int]() 123 | 124 | let selected = selectedRows.sorted() 125 | 126 | if selected.contains(0) { 127 | str = data.short(for: 0) 128 | } else if selectedRows.count > 0 { 129 | 130 | let first = selected.first! 131 | str = data.short(for: first) 132 | ids.append(data.id(for: first)) 133 | 134 | for idx in selected.dropFirst() { 135 | str = str + ", " + data.short(for: idx) 136 | ids.append(data.id(for: idx)) 137 | } 138 | } 139 | 140 | if str.isEmpty == true { 141 | str = data.short(for: 0) 142 | selectRow(row: 0) 143 | self.delegate?.pickerTextIsEmpty(owner: owner) 144 | } 145 | 146 | return (str, ids) 147 | } 148 | 149 | public func isSelectInRow(gestureRecognizer: UIGestureRecognizer) -> Bool { 150 | let selectedView = picker.view(forRow: selectedRow, forComponent: 0) 151 | if selectedView?.frame.contains(gestureRecognizer.location(in: selectedView)) == true { 152 | return true 153 | } 154 | return false 155 | } 156 | } 157 | 158 | 159 | 160 | -------------------------------------------------------------------------------- /Sources/PickerView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PickerView.swift 3 | // Picker 4 | // 5 | // Created by Hayk Brsoyan on 6/29/18. 6 | // Copyright © 2018 Hayk Brsoyan. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public protocol PickerData: class { 12 | func id(for row: Int) -> Int 13 | func long(for row: Int) -> String 14 | func short(for row: Int) -> String 15 | func count() -> Int 16 | } 17 | 18 | public class PickerView: UIPickerView { 19 | 20 | var pickerDidHide: (() -> Void)? 21 | 22 | override public func removeFromSuperview() { 23 | super.removeFromSuperview() 24 | self.pickerDidHide?() 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Sources/PickerViewHandler.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PickerViewHandler.swift 3 | // freighthaul 4 | // 5 | // Created by Hayk Brsoyan on 6/8/18. 6 | // Copyright © 2018 Hayk Brsoyan. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public protocol PickerDelegate: class { 12 | func pickerDidHide(text: String, owner: UIView?, ids:[Int]) 13 | func pickerTextIsEmpty(owner: UIView?) 14 | } 15 | 16 | public class PickerViewHandler: NSObject, UIPickerViewDelegate, UIPickerViewDataSource { 17 | 18 | public weak var delegate: PickerDelegate? 19 | 20 | private(set) var textField: UITextField 21 | 22 | internal var data: (Any & PickerData) 23 | internal var picker = PickerView.init() 24 | internal var numberOfComponents = 1 25 | internal var selectedRow: Int = 0 26 | 27 | internal var leftButtonText: String? 28 | internal var rightButtonText: String? 29 | internal var tintColor: UIColor? 30 | 31 | weak var owner: UIView? 32 | private var pickerViewHeight: CGFloat = 0.0 33 | 34 | var onSelectedTitle: ((_ text : String) -> Void)? 35 | weak var parentVC: UIViewController? { 36 | didSet { 37 | configPicker() 38 | } 39 | } 40 | 41 | internal lazy var selectedRows: Set = { 42 | return Set(0 ..< data.count()) 43 | }() 44 | 45 | lazy var pickerDidHide: () -> Void = { [weak self] in 46 | guard let `self` = self else { return } 47 | 48 | let data = self.selectedRowData() 49 | let title = data.title 50 | let ids = data.ids 51 | 52 | self.delegate?.pickerDidHide(text: title, owner: self.owner, ids: ids) 53 | } 54 | 55 | public init(data: PickerData) { 56 | self.textField = UITextField.init(frame: .zero) 57 | self.data = data 58 | } 59 | 60 | public func configWith(parentVC: UIViewController, onSelectedTitle: ((_ text : String) -> Void)?) { 61 | presentPicker(parentVC: parentVC, onSelectedTitle: onSelectedTitle) 62 | } 63 | 64 | public func configWith(parentVC: UIViewController, owner: UIView?, data: PickerData?, leftButtonText: String?, rightButtonText: String?, tintColor: UIColor?, selectedRows: Set?, onSelectedTitle: ((_ text : String) -> Void)?) { 65 | 66 | self.leftButtonText = leftButtonText 67 | self.rightButtonText = rightButtonText 68 | self.tintColor = tintColor 69 | if let rows = selectedRows { 70 | if rows.count > 0 { 71 | self.selectedRows = rows 72 | } 73 | } 74 | 75 | configWith(parentVC: parentVC, onSelectedTitle: onSelectedTitle) 76 | self.owner = owner 77 | if let data = data { 78 | self.data = data 79 | } 80 | } 81 | 82 | internal func presentPicker(parentVC: UIViewController, onSelectedTitle: ((_ text : String) -> Void)?) { 83 | self.parentVC = parentVC 84 | self.textField.becomeFirstResponder() 85 | self.onSelectedTitle = onSelectedTitle 86 | } 87 | 88 | private func configPicker() { 89 | self.parentVC?.view.addSubview(textField) 90 | picker.showsSelectionIndicator = true 91 | picker.delegate = self 92 | picker.dataSource = self 93 | picker.selectRow(0, inComponent: 0, animated: false) 94 | picker.pickerDidHide = pickerDidHide 95 | 96 | textField.inputView = picker 97 | pickerViewHeight = self.toolBar() 98 | 99 | selectedRow = 0 100 | } 101 | 102 | internal func toolBar() -> CGFloat { 103 | let toolBar = UIToolbar() 104 | toolBar.barStyle = .default 105 | toolBar.isTranslucent = true 106 | var color = UIColor.blue 107 | if let tintColor = self.tintColor { 108 | color = tintColor 109 | } 110 | toolBar.tintColor = color 111 | toolBar.sizeToFit() 112 | 113 | var rightText = "Done" 114 | if let txt = self.rightButtonText { 115 | rightText = txt 116 | } 117 | let doneButton = UIBarButtonItem(title: rightText, style: .plain, target: self, action: #selector(dismiss)) 118 | let spaceButton = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil) 119 | toolBar.setItems([spaceButton, doneButton], animated: false) 120 | toolBar.isUserInteractionEnabled = true 121 | textField.inputAccessoryView = toolBar 122 | 123 | return toolBar.frame.height + picker.frame.height 124 | } 125 | 126 | func title(for row: Int, component: Int?) -> String { 127 | return data.long(for: row) 128 | } 129 | 130 | func updateData() { 131 | // override if needed in child class 132 | } 133 | 134 | func stopUpdate() { 135 | // override if needed in child class 136 | } 137 | 138 | func count() -> Int { 139 | return data.count() 140 | } 141 | 142 | 143 | // MARK: UIPickerViewDelegate, UIPickerViewDataSource 144 | public func numberOfComponents(in pickerView: UIPickerView) -> Int { 145 | return numberOfComponents 146 | } 147 | 148 | public func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int { 149 | return count() 150 | } 151 | 152 | public func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? { 153 | return title(for: row, component: component) 154 | } 155 | 156 | public func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) { 157 | selectedRow = row 158 | setTextOnCurrentView(row: row, component: component) 159 | } 160 | 161 | internal func setTextOnCurrentView(row: Int, component: Int?) { 162 | onSelectedTitle?(title(for: row, component: component)) 163 | } 164 | 165 | internal func selectedRowData() -> (title: String, ids: [Int]) { 166 | return (title(for: self.selectedRow, component: 0), [Int]()) 167 | } 168 | 169 | @objc func dismiss() { 170 | if selectedRow == 0 { 171 | setTextOnCurrentView(row: 0, component: nil) 172 | } 173 | self.parentVC?.view.endEditing(true) 174 | } 175 | } 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | -------------------------------------------------------------------------------- /Sources/SelectionView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SelectionView.swift 3 | // freighthaul 4 | // 5 | // Created by Hayk Brsoyan on 6/27/18. 6 | // Copyright © 2018 Hayk Brsoyan. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class SelectionView: UIView { 12 | @IBOutlet weak var imgView: UIImageView! 13 | @IBOutlet weak var titleLabel: UILabel! 14 | 15 | enum SelectionViewType { 16 | case selected 17 | case deSelected 18 | } 19 | 20 | var type: SelectionViewType = SelectionViewType.deSelected { 21 | didSet { 22 | if type == .deSelected { 23 | imgView?.isHidden = true 24 | } else { 25 | imgView?.isHidden = false 26 | } 27 | } 28 | } 29 | 30 | override init(frame: CGRect) { 31 | super.init(frame: frame) 32 | commonInit() 33 | } 34 | 35 | required init?(coder aDecoder: NSCoder) { 36 | super.init(coder: aDecoder) 37 | } 38 | 39 | private func commonInit() { 40 | let view = loadNib() 41 | view.frame = bounds 42 | view.backgroundColor = .clear 43 | addSubview(view) 44 | } 45 | 46 | func config(type: SelectionViewType, text: String) { 47 | self.type = type 48 | self.titleLabel?.text = text 49 | } 50 | 51 | func select() -> Bool { 52 | if type == .selected { 53 | type = .deSelected 54 | return false 55 | } else { 56 | type = .selected 57 | return true 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Sources/UIView+Shake.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Shake.swift 3 | // Picker 4 | // 5 | // Created by Hayk Brsoyan on 6/29/18. 6 | // Copyright © 2018 Hayk Brsoyan. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | extension UIView { 12 | 13 | /** Loads instance from nib with the same name. */ 14 | public func loadNib() -> UIView { 15 | let bundle = Bundle(for: type(of: self)) 16 | let nibName = type(of: self).description().components(separatedBy: ".").last! 17 | let nib = UINib(nibName: nibName, bundle: bundle) 18 | return nib.instantiate(withOwner: self, options: nil).first as! UIView 19 | } 20 | 21 | public func shake(duration: Double, repeatCount: Float, shakeSize: CGFloat) { 22 | let keyPath = "position" 23 | let shake = CABasicAnimation(keyPath: keyPath) 24 | shake.duration = duration 25 | shake.repeatCount = repeatCount 26 | shake.autoreverses = true 27 | shake.fromValue = NSValue(cgPoint: CGPoint(x: center.x - shakeSize, y: center.y)) 28 | shake.toValue = NSValue(cgPoint: CGPoint(x: center.x + shakeSize, y: center.y)) 29 | 30 | layer.add(shake, forKey: keyPath) 31 | } 32 | } 33 | --------------------------------------------------------------------------------