diff --git a/TheDistanceForms.podspec b/TheDistanceForms.podspec index 1345b35..6f35707 100644 --- a/TheDistanceForms.podspec +++ b/TheDistanceForms.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "TheDistanceForms" - s.version = "0.2.6" + s.version = "0.2.7" s.summary = "An framework for creating flexible forms as generic collections of user input elements." s.homepage = "https://github.com/thedistance" s.license = "MIT" @@ -9,12 +9,12 @@ Pod::Spec.new do |s| s.source = { :git => "https://github.com/thedistance/TheDistanceForms.git", :tag => "#{s.version}" } s.ios.deployment_target = '8.0' - + s.requires_arc = true + #s.source_files = 'TheDistanceForms/Classes/**/*.swift' + s.module_name = "TheDistanceForms" s.default_subspec = "TheDistanceForms" - - s.requires_arc = true s.subspec 'TheDistanceForms' do |c| c.source_files = 'TheDistanceForms/Classes/**/*.swift' @@ -25,11 +25,17 @@ Pod::Spec.new do |s| c.dependency 'SwiftyJSON' end - #s.subspec 'TheDistanceFormsPhotosVideos' do |pv| - #end + s.subspec 'TheDistanceFormsPhotosVideos' do |pv| + pv.source_files = 'TheDistanceFormsPhotosVideos/**/*.swift' + pv.dependency 'TheDistanceCore' + pv.dependency 'AdvancedOperationKit' + pv.dependency 'KeyboardResponder' + pv.dependency 'TDStackView' + pv.dependency 'SwiftyJSON' + end s.subspec 'TheDistanceFormsThemed' do |t| - t.source_files = 'TheDistanceForms/Classes/**/*.swift', 'TheDistanceFormsThemed/ThemedClasses/*.swift' + t.source_files = 'TheDistanceFormsThemed/ThemedClasses/*.swift', 'TheDistanceForms/Classes/**/*.swift' t.dependency 'ThemeKit' t.dependency 'TheDistanceCore' t.dependency 'AdvancedOperationKit' diff --git a/TheDistanceForms.xcodeproj/project.pbxproj b/TheDistanceForms.xcodeproj/project.pbxproj index d01ac8d..ce2b53e 100644 --- a/TheDistanceForms.xcodeproj/project.pbxproj +++ b/TheDistanceForms.xcodeproj/project.pbxproj @@ -7,6 +7,11 @@ objects = { /* Begin PBXBuildFile section */ + 1FC91A23DC15FF81BBDA36F6 /* Pods_TheDistanceFormsPhotosVideos.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 82A9E022FC1D3D3487520B10 /* Pods_TheDistanceFormsPhotosVideos.framework */; }; + 5A7589C41DF9A9F50034F388 /* PhotoCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5A7589BF1DF9A9F50034F388 /* PhotoCollectionViewCell.swift */; }; + 5A7589C51DF9A9F50034F388 /* PhotosStack.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5A7589C01DF9A9F50034F388 /* PhotosStack.swift */; }; + 5A7589C61DF9A9F50034F388 /* PhotoStackManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5A7589C11DF9A9F50034F388 /* PhotoStackManager.swift */; }; + 5A7589C71DF9A9F50034F388 /* Media.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5A7589C31DF9A9F50034F388 /* Media.xcassets */; }; 7A30F8F14284F9D854EF0F01 /* Pods_TheDistanceFormsThemed.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 05A6B1A9C711471AE2495394 /* Pods_TheDistanceFormsThemed.framework */; }; A54511B51D070BE40067714A /* UIDatePickerDataController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A54511B41D070BE40067714A /* UIDatePickerDataController.swift */; }; A54511B81D071B030067714A /* Validation.swift in Sources */ = {isa = PBXBuildFile; fileRef = A54511B71D071B030067714A /* Validation.swift */; }; @@ -31,7 +36,6 @@ A592A0521CD0B2D900128D4D /* TKSegmentedTextFieldStack.swift in Sources */ = {isa = PBXBuildFile; fileRef = A592A0511CD0B2D900128D4D /* TKSegmentedTextFieldStack.swift */; }; A592A0541CD0C10D00128D4D /* TKSwitchStack.swift in Sources */ = {isa = PBXBuildFile; fileRef = A592A0531CD0C10D00128D4D /* TKSwitchStack.swift */; }; A592A0561CD0C1CF00128D4D /* TKFormQuestion.swift in Sources */ = {isa = PBXBuildFile; fileRef = A592A0551CD0C1CF00128D4D /* TKFormQuestion.swift */; }; - A592A0591CD0C3CC00128D4D /* TheDistanceForms.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A5F0DE2B1CC8C5F80032534D /* TheDistanceForms.framework */; }; A592A05B1CD0C3EF00128D4D /* ThemeKitCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A592A03A1CCFC9BA00128D4D /* ThemeKitCore.framework */; }; A592A05E1CD0C49200128D4D /* MyTheme.swift in Sources */ = {isa = PBXBuildFile; fileRef = A592A05D1CD0C49200128D4D /* MyTheme.swift */; }; A592A0601CD0C4D000128D4D /* ThemeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A592A05F1CD0C4D000128D4D /* ThemeViewController.swift */; }; @@ -48,11 +52,6 @@ A5F0DE861CC8C7EF0032534D /* TextFieldStack.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5F0DE771CC8C7EF0032534D /* TextFieldStack.swift */; }; A5F0DE871CC8C7EF0032534D /* TextStack.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5F0DE781CC8C7EF0032534D /* TextStack.swift */; }; A5F0DE881CC8C7EF0032534D /* TextViewStack.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5F0DE791CC8C7EF0032534D /* TextViewStack.swift */; }; - A5F0DE931CC8C80A0032534D /* PhotoCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5F0DE8E1CC8C80A0032534D /* PhotoCollectionViewCell.swift */; }; - A5F0DE941CC8C80A0032534D /* PhotosStack.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5F0DE8F1CC8C80A0032534D /* PhotosStack.swift */; }; - A5F0DE951CC8C80A0032534D /* PhotoStackManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5F0DE901CC8C80A0032534D /* PhotoStackManager.swift */; }; - A5F0DE961CC8C80A0032534D /* Media.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A5F0DE921CC8C80A0032534D /* Media.xcassets */; }; - A5F0DE991CC8CBB60032534D /* TheDistanceForms.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A5F0DE2B1CC8C5F80032534D /* TheDistanceForms.framework */; }; A5F0DED31CC9004C0032534D /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5F0DED21CC9004C0032534D /* AppDelegate.swift */; }; A5F0DED51CC9004C0032534D /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5F0DED41CC9004C0032534D /* ViewController.swift */; }; A5F0DED81CC9004C0032534D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A5F0DED61CC9004C0032534D /* Main.storyboard */; }; @@ -149,10 +148,16 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 0027F9BF48DE704B5D577A2B /* Pods-TheDistanceFormsPhotosVideos.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TheDistanceFormsPhotosVideos.debug.xcconfig"; path = "Pods/Target Support Files/Pods-TheDistanceFormsPhotosVideos/Pods-TheDistanceFormsPhotosVideos.debug.xcconfig"; sourceTree = ""; }; 05A6B1A9C711471AE2495394 /* Pods_TheDistanceFormsThemed.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TheDistanceFormsThemed.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 1ECEB3CC741211318C9EEEDD /* Pods-TheDistanceFormsThemed.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TheDistanceFormsThemed.release.xcconfig"; path = "Pods/Target Support Files/Pods-TheDistanceFormsThemed/Pods-TheDistanceFormsThemed.release.xcconfig"; sourceTree = ""; }; 5A7589B51DF985DD0034F388 /* Pods_TheDistanceForms.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Pods_TheDistanceForms.framework; path = "../../Library/Developer/Xcode/DerivedData/TheDistanceForms-eqocbolqjfvqasftouqigajpdrbb/Build/Products/Debug-iphonesimulator/Pods_TheDistanceForms.framework"; sourceTree = ""; }; + 5A7589BF1DF9A9F50034F388 /* PhotoCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PhotoCollectionViewCell.swift; sourceTree = ""; }; + 5A7589C01DF9A9F50034F388 /* PhotosStack.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PhotosStack.swift; sourceTree = ""; }; + 5A7589C11DF9A9F50034F388 /* PhotoStackManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PhotoStackManager.swift; sourceTree = ""; }; + 5A7589C31DF9A9F50034F388 /* Media.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Media.xcassets; sourceTree = ""; }; 7B39020C39FCC95B33AD664B /* Pods-TheDistanceForms.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TheDistanceForms.debug.xcconfig"; path = "Pods/Target Support Files/Pods-TheDistanceForms/Pods-TheDistanceForms.debug.xcconfig"; sourceTree = ""; }; + 82A9E022FC1D3D3487520B10 /* Pods_TheDistanceFormsPhotosVideos.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TheDistanceFormsPhotosVideos.framework; sourceTree = BUILT_PRODUCTS_DIR; }; A54511B41D070BE40067714A /* UIDatePickerDataController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIDatePickerDataController.swift; sourceTree = ""; }; A54511B71D071B030067714A /* Validation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Validation.swift; sourceTree = ""; }; A54511B91D071B0E0067714A /* ValidationResult.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValidationResult.swift; sourceTree = ""; }; @@ -203,10 +208,6 @@ A5F0DE771CC8C7EF0032534D /* TextFieldStack.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextFieldStack.swift; sourceTree = ""; }; A5F0DE781CC8C7EF0032534D /* TextStack.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextStack.swift; sourceTree = ""; }; A5F0DE791CC8C7EF0032534D /* TextViewStack.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextViewStack.swift; sourceTree = ""; }; - A5F0DE8E1CC8C80A0032534D /* PhotoCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PhotoCollectionViewCell.swift; sourceTree = ""; }; - A5F0DE8F1CC8C80A0032534D /* PhotosStack.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PhotosStack.swift; sourceTree = ""; }; - A5F0DE901CC8C80A0032534D /* PhotoStackManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PhotoStackManager.swift; sourceTree = ""; }; - A5F0DE921CC8C80A0032534D /* Media.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Media.xcassets; sourceTree = ""; }; A5F0DED01CC9004C0032534D /* FormsDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FormsDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; A5F0DED21CC9004C0032534D /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; A5F0DED41CC9004C0032534D /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; @@ -221,6 +222,7 @@ A5F0DEF61CC902320032534D /* SwiftyJSON.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftyJSON.framework; path = Carthage/Build/iOS/SwiftyJSON.framework; sourceTree = ""; }; A5F0DF0C1CCA343E0032534D /* KeyboardResponder.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = KeyboardResponder.framework; path = Carthage/Build/iOS/KeyboardResponder.framework; sourceTree = ""; }; A5F0DF151CCA55A30032534D /* Media.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Media.xcassets; sourceTree = ""; }; + C574CDB924C95821BB8CE785 /* Pods-TheDistanceFormsPhotosVideos.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TheDistanceFormsPhotosVideos.release.xcconfig"; path = "Pods/Target Support Files/Pods-TheDistanceFormsPhotosVideos/Pods-TheDistanceFormsPhotosVideos.release.xcconfig"; sourceTree = ""; }; C5E1E791E422A5F7A2AC398C /* Pods-TheDistanceFormsThemed.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TheDistanceFormsThemed.debug.xcconfig"; path = "Pods/Target Support Files/Pods-TheDistanceFormsThemed/Pods-TheDistanceFormsThemed.debug.xcconfig"; sourceTree = ""; }; D40C5A7F93C6DA91E3C36D63 /* Pods_TheDistanceForms.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TheDistanceForms.framework; sourceTree = BUILT_PRODUCTS_DIR; }; E9C87F991A5FE701BF88E0E6 /* Pods-TheDistanceForms.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TheDistanceForms.release.xcconfig"; path = "Pods/Target Support Files/Pods-TheDistanceForms/Pods-TheDistanceForms.release.xcconfig"; sourceTree = ""; }; @@ -231,7 +233,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - A592A0591CD0C3CC00128D4D /* TheDistanceForms.framework in Frameworks */, 7A30F8F14284F9D854EF0F01 /* Pods_TheDistanceFormsThemed.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -256,7 +257,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - A5F0DE991CC8CBB60032534D /* TheDistanceForms.framework in Frameworks */, + 1FC91A23DC15FF81BBDA36F6 /* Pods_TheDistanceFormsPhotosVideos.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -293,6 +294,24 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 5A7589BE1DF9A9F50034F388 /* Classes */ = { + isa = PBXGroup; + children = ( + 5A7589BF1DF9A9F50034F388 /* PhotoCollectionViewCell.swift */, + 5A7589C01DF9A9F50034F388 /* PhotosStack.swift */, + 5A7589C11DF9A9F50034F388 /* PhotoStackManager.swift */, + ); + path = Classes; + sourceTree = ""; + }; + 5A7589C21DF9A9F50034F388 /* Resources */ = { + isa = PBXGroup; + children = ( + 5A7589C31DF9A9F50034F388 /* Media.xcassets */, + ); + path = Resources; + sourceTree = ""; + }; A54511B61D071B030067714A /* Validation */ = { isa = PBXGroup; children = ( @@ -400,9 +419,9 @@ A5F0DE4B1CC8C60C0032534D /* TheDistanceFormsPhotosVideos */ = { isa = PBXGroup; children = ( + 5A7589BE1DF9A9F50034F388 /* Classes */, + 5A7589C21DF9A9F50034F388 /* Resources */, A5F0DE4C1CC8C60C0032534D /* TheDistanceFormsPhotosVideos.h */, - A5F0DE8D1CC8C80A0032534D /* Classes */, - A5F0DE911CC8C80A0032534D /* Resources */, A5F0DE4E1CC8C60C0032534D /* Info.plist */, ); path = TheDistanceFormsPhotosVideos; @@ -426,6 +445,7 @@ A592A0391CCFC39B00128D4D /* Themed */, D40C5A7F93C6DA91E3C36D63 /* Pods_TheDistanceForms.framework */, 05A6B1A9C711471AE2495394 /* Pods_TheDistanceFormsThemed.framework */, + 82A9E022FC1D3D3487520B10 /* Pods_TheDistanceFormsPhotosVideos.framework */, ); name = Frameworks; sourceTree = ""; @@ -484,26 +504,6 @@ path = "Text Stacks"; sourceTree = ""; }; - A5F0DE8D1CC8C80A0032534D /* Classes */ = { - isa = PBXGroup; - children = ( - A5F0DE8E1CC8C80A0032534D /* PhotoCollectionViewCell.swift */, - A5F0DE8F1CC8C80A0032534D /* PhotosStack.swift */, - A5F0DE901CC8C80A0032534D /* PhotoStackManager.swift */, - ); - name = Classes; - path = TheDistanceFormsPhotosVideosTests/Classes; - sourceTree = SOURCE_ROOT; - }; - A5F0DE911CC8C80A0032534D /* Resources */ = { - isa = PBXGroup; - children = ( - A5F0DE921CC8C80A0032534D /* Media.xcassets */, - ); - name = Resources; - path = TheDistanceFormsPhotosVideosTests/Resources; - sourceTree = SOURCE_ROOT; - }; A5F0DECB1CC8FFF60032534D /* Resources */ = { isa = PBXGroup; children = ( @@ -556,6 +556,8 @@ E9C87F991A5FE701BF88E0E6 /* Pods-TheDistanceForms.release.xcconfig */, C5E1E791E422A5F7A2AC398C /* Pods-TheDistanceFormsThemed.debug.xcconfig */, 1ECEB3CC741211318C9EEEDD /* Pods-TheDistanceFormsThemed.release.xcconfig */, + 0027F9BF48DE704B5D577A2B /* Pods-TheDistanceFormsPhotosVideos.debug.xcconfig */, + C574CDB924C95821BB8CE785 /* Pods-TheDistanceFormsPhotosVideos.release.xcconfig */, ); name = Pods; sourceTree = ""; @@ -653,10 +655,12 @@ isa = PBXNativeTarget; buildConfigurationList = A5F0DE5B1CC8C60C0032534D /* Build configuration list for PBXNativeTarget "TheDistanceFormsPhotosVideos" */; buildPhases = ( + 1E83B3C4C21B79C1C373F49F /* [CP] Check Pods Manifest.lock */, A5F0DE451CC8C60C0032534D /* Sources */, A5F0DE461CC8C60C0032534D /* Frameworks */, A5F0DE471CC8C60C0032534D /* Headers */, A5F0DE481CC8C60C0032534D /* Resources */, + 6493EA1A7A2F8AE8F6A6831E /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -812,7 +816,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - A5F0DE961CC8C80A0032534D /* Media.xcassets in Resources */, + 5A7589C71DF9A9F50034F388 /* Media.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -846,6 +850,21 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 1E83B3C4C21B79C1C373F49F /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../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"; + showEnvVarsInLog = 0; + }; 27BC20099B9CAEF78559C710 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -861,6 +880,21 @@ shellScript = "diff \"${PODS_ROOT}/../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"; showEnvVarsInLog = 0; }; + 6493EA1A7A2F8AE8F6A6831E /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-TheDistanceFormsPhotosVideos/Pods-TheDistanceFormsPhotosVideos-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; 884CA5F1A63132F97CD452FE /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -975,9 +1009,9 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - A5F0DE931CC8C80A0032534D /* PhotoCollectionViewCell.swift in Sources */, - A5F0DE951CC8C80A0032534D /* PhotoStackManager.swift in Sources */, - A5F0DE941CC8C80A0032534D /* PhotosStack.swift in Sources */, + 5A7589C41DF9A9F50034F388 /* PhotoCollectionViewCell.swift in Sources */, + 5A7589C61DF9A9F50034F388 /* PhotoStackManager.swift in Sources */, + 5A7589C51DF9A9F50034F388 /* PhotosStack.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1278,6 +1312,7 @@ }; A5F0DE5C1CC8C60C0032534D /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 0027F9BF48DE704B5D577A2B /* Pods-TheDistanceFormsPhotosVideos.debug.xcconfig */; buildSettings = { "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; @@ -1297,6 +1332,7 @@ }; A5F0DE5D1CC8C60C0032534D /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = C574CDB924C95821BB8CE785 /* Pods-TheDistanceFormsPhotosVideos.release.xcconfig */; buildSettings = { "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; @@ -1317,6 +1353,7 @@ A5F0DE5F1CC8C60C0032534D /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; INFOPLIST_FILE = TheDistanceFormsPhotosVideosTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = uk.co.thedistance.TheDistanceFormsPhotosVideosTests; @@ -1327,6 +1364,7 @@ A5F0DE601CC8C60C0032534D /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; INFOPLIST_FILE = TheDistanceFormsPhotosVideosTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = uk.co.thedistance.TheDistanceFormsPhotosVideosTests; diff --git a/TheDistanceForms/Classes/Dynamic Forms/Form.swift b/TheDistanceForms/Classes/Dynamic Forms/Form.swift index 1b1e47e..d68c4cd 100644 --- a/TheDistanceForms/Classes/Dynamic Forms/Form.swift +++ b/TheDistanceForms/Classes/Dynamic Forms/Form.swift @@ -146,7 +146,7 @@ open class Form: KeyedValueElementContainer, KeyedView { let json:JSON if let date = value as? Date { json = JSON(ServerDateFormatter.string(from: date)) - } else if let valueObject = value as? AnyObject { + } else if let valueObject = value { json = JSON(valueObject) } else { json = JSON(NSNull()) diff --git a/TheDistanceFormsPhotosVideosTests/Classes/PhotoCollectionViewCell.swift b/TheDistanceFormsPhotosVideos/Classes/PhotoCollectionViewCell.swift similarity index 88% rename from TheDistanceFormsPhotosVideosTests/Classes/PhotoCollectionViewCell.swift rename to TheDistanceFormsPhotosVideos/Classes/PhotoCollectionViewCell.swift index 4fbe39c..f8ae441 100644 --- a/TheDistanceFormsPhotosVideosTests/Classes/PhotoCollectionViewCell.swift +++ b/TheDistanceFormsPhotosVideos/Classes/PhotoCollectionViewCell.swift @@ -33,7 +33,7 @@ public class PhotoCollectionViewCell: UICollectionViewCell { public func createViews() { imageView.translatesAutoresizingMaskIntoConstraints = false - imageView.contentMode = .ScaleAspectFill + imageView.contentMode = .scaleAspectFill imageView.clipsToBounds = true contentView.addSubview(imageView) @@ -52,17 +52,17 @@ public class VideoCollectionViewCell: PhotoCollectionViewCell { override public func createViews() { super.createViews() - let whiteTint = UIColor.whiteColor().colorWithAlphaComponent(0.87) + let whiteTint = UIColor.white.withAlphaComponent(0.87) videoIconView.image = UIImage(named: "ic_videocam_white.png") videoIconView.tintColor = whiteTint - timeLabel.font = UIFont.preferredFontForTextStyle(UIFontTextStyleCaption1) + timeLabel.font = UIFont.preferredFont(forTextStyle: UIFontTextStyle.caption1) timeLabel.textColor = whiteTint // configure stack footerStack = CreateStackView([videoIconView, timeLabel]) - footerStack.stackDistribution = .EqualSpacing + footerStack.stackDistribution = .equalSpacing // add as subview footerStack.view.translatesAutoresizingMaskIntoConstraints = false diff --git a/TheDistanceFormsPhotosVideosTests/Classes/PhotoStackManager.swift b/TheDistanceFormsPhotosVideos/Classes/PhotoStackManager.swift similarity index 66% rename from TheDistanceFormsPhotosVideosTests/Classes/PhotoStackManager.swift rename to TheDistanceFormsPhotosVideos/Classes/PhotoStackManager.swift index cac1462..629f049 100644 --- a/TheDistanceFormsPhotosVideosTests/Classes/PhotoStackManager.swift +++ b/TheDistanceFormsPhotosVideos/Classes/PhotoStackManager.swift @@ -19,29 +19,29 @@ import TheDistanceCore public enum PhotosStackAsset: Equatable { - case Photo(UIImage) - case Movie(AVURLAsset, UIImage?) + case photo(UIImage) + case movie(AVURLAsset, UIImage?) init?(pickerResult: UIImagePickerResultType) { switch (pickerResult) { - case .Image(let img): - self = Photo(img) - case .Movie(let URL): + case .image(let img): + self = .photo(img) + case .movie(let URL): - let asset = AVURLAsset(URL:URL) + let asset = AVURLAsset(url:URL) let generator = AVAssetImageGenerator(asset: asset) generator.appliesPreferredTrackTransform = true let thumbnailImage:UIImage? - if let thumbnail = try? generator.copyCGImageAtTime(CMTimeMakeWithSeconds(0.5, 4), actualTime: nil) { - thumbnailImage = UIImage(CGImage: thumbnail).orientationNeutralImage() + if let thumbnail = try? generator.copyCGImage(at: CMTimeMakeWithSeconds(0.5, 4), actualTime: nil) { + thumbnailImage = UIImage(cgImage: thumbnail).orientationNeutralImage() } else { thumbnailImage = nil } - self = Movie(asset, thumbnailImage) - case .None: + self = .movie(asset, thumbnailImage) + case .none: return nil } @@ -51,9 +51,9 @@ public enum PhotosStackAsset: Equatable { public func ==(a1:PhotosStackAsset, a2:PhotosStackAsset) -> Bool { switch (a1, a2) { - case (.Photo(let i1), .Photo(let i2)): + case (.photo(let i1), .photo(let i2)): return i1 == i2 - case (.Movie(let av1, _), .Movie(let av2, _)): + case (.movie(let av1, _), .movie(let av2, _)): return av1 == av2 default: return false @@ -75,9 +75,9 @@ public class PhotosStackManager: NSObject, UICollectionViewDataSource, UICollect public var context:UIViewController public let collectionView:UICollectionView - public let operationQueue:OperationQueue + public let operationQueue:PSOperationQueue - public init(collectionView:UICollectionView, context:UIViewController, operationQueue:OperationQueue) { + public init(collectionView:UICollectionView, context:UIViewController, operationQueue:PSOperationQueue) { self.context = context self.collectionView = collectionView @@ -88,35 +88,35 @@ public class PhotosStackManager: NSObject, UICollectionViewDataSource, UICollect collectionView.dataSource = self collectionView.delegate = self - collectionView.registerClass(PhotoCollectionViewCell.self, forCellWithReuseIdentifier: PhotoCollectionViewCellIdentifier) - collectionView.registerClass(VideoCollectionViewCell.self, forCellWithReuseIdentifier: MovieCollectionViewCellIdentifier) + collectionView.register(PhotoCollectionViewCell.self, forCellWithReuseIdentifier: PhotoCollectionViewCellIdentifier) + collectionView.register(VideoCollectionViewCell.self, forCellWithReuseIdentifier: MovieCollectionViewCellIdentifier) } - public func numberOfSectionsInCollectionView(collectionView: UICollectionView) -> Int { + public func numberOfSections(in collectionView: UICollectionView) -> Int { return 1 } - public func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return mediaDataSource.count } - public func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell { + public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let media = mediaDataSource[indexPath.row] switch (media) { - case .Photo(let image): + case .photo(let image): - let cell = collectionView.dequeueReusableCellWithReuseIdentifier(PhotoCollectionViewCellIdentifier, forIndexPath: indexPath) + let cell = collectionView.dequeueReusableCell(withReuseIdentifier: PhotoCollectionViewCellIdentifier, for: indexPath as IndexPath) if let photoCell = cell as? PhotoCollectionViewCell { photoCell.imageView.image = image } return cell - case .Movie(let asset, let thumbnail): + case .movie(let asset, let thumbnail): - let cell = collectionView.dequeueReusableCellWithReuseIdentifier(MovieCollectionViewCellIdentifier, forIndexPath: indexPath) + let cell = collectionView.dequeueReusableCell(withReuseIdentifier: MovieCollectionViewCellIdentifier, for: indexPath as IndexPath) if let videoCell = cell as? VideoCollectionViewCell { let duration = CMTimeGetSeconds(asset.duration) @@ -142,13 +142,13 @@ public class PhotosStackManager: NSObject, UICollectionViewDataSource, UICollect } } - public func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) { + public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { // show detail to allow deleting } public func newAssetFromSource(source:AdvancedOperationKit.UIPopoverSourceType) { - guard let op = imageSelectionOperation(source) else { return } + guard let op = imageSelectionOperation(source: source) else { return } operationQueue.addOperation(op) } @@ -168,19 +168,19 @@ public class PhotosStackManager: NSObject, UICollectionViewDataSource, UICollect var chosenMedia = self.mediaDataSource switch (media) { - case .Image(_), .Movie(_): + case .image(_), .movie(_): if let asset = PhotosStackAsset(pickerResult: media) { - chosenMedia.insert(asset, atIndex: 0) + chosenMedia.insert(asset, at: 0) self.mediaDataSource = chosenMedia - self.collectionView.insertItemsAtIndexPaths([NSIndexPath(forItem: 0, inSection: 0)]) + self.collectionView.insertItems(at: [IndexPath(item: 0, section: 0)]) - self.delegate?.photosStackManager(self, selectedAsset: asset) + self.delegate?.photosStackManager(stack: self, selectedAsset: asset) } - case .None: + case .none: let _ = "Cancelled Media selection" - dispatch_async(dispatch_get_main_queue(), { () -> Void in - self.delegate?.photosStackManagerCancelled(self) + DispatchQueue.main.async(execute: { () -> Void in + self.delegate?.photosStackManagerCancelled(stack: self) }) // print(str) } diff --git a/TheDistanceFormsPhotosVideosTests/Classes/PhotosStack.swift b/TheDistanceFormsPhotosVideos/Classes/PhotosStack.swift similarity index 83% rename from TheDistanceFormsPhotosVideosTests/Classes/PhotosStack.swift rename to TheDistanceFormsPhotosVideos/Classes/PhotosStack.swift index 76e14ba..d3d22ba 100644 --- a/TheDistanceFormsPhotosVideosTests/Classes/PhotosStack.swift +++ b/TheDistanceFormsPhotosVideos/Classes/PhotosStack.swift @@ -11,7 +11,7 @@ import UIKit import AdvancedOperationKit import TDStackView import TheDistanceCore -import TheDistanceForms + public class PhotosStack: ErrorStack, ValueElement, PhotosStackManagerDelegate { @@ -31,19 +31,19 @@ public class PhotosStack: ErrorStack, ValueElement, PhotosStackManagerDelegate { public init(collectionView: UICollectionView, manager:PhotosStackManager, - addButton: UIButton = UIButton(type: .System), + addButton: UIButton = UIButton(type: .system), textField:UITextField = UITextField(), errorLabel: UILabel = UILabel(), errorImageView: UIImageView = UIImageView(), iconImageView: UIImageView = UIImageView()) { mediaCollectionView = collectionView - mediaCollectionView.backgroundColor = UIColor.clearColor() + mediaCollectionView.backgroundColor = UIColor.clear mediaCollectionViewHeightConstraint = NSLayoutConstraint(item: mediaCollectionView, - attribute: .Height, - relatedBy: .Equal, + attribute: .height, + relatedBy: .equal, toItem: nil, - attribute: .NotAnAttribute, + attribute: .notAnAttribute, multiplier: 0.0, constant: 75.0) mediaCollectionView.addConstraint(mediaCollectionViewHeightConstraint) @@ -51,12 +51,12 @@ public class PhotosStack: ErrorStack, ValueElement, PhotosStackManagerDelegate { self.addButton = addButton self.textField = textField - addButton.setTitle("Add Photo or Video", forState: .Normal) - textField.hidden = true + addButton.setTitle("Add Photo or Video", for: .normal) + textField.isHidden = true mediaManager = manager contentStack = CreateStackView([mediaCollectionView, addButton, textField]) - contentStack.axis = .Vertical + contentStack.axis = .vertical contentStack.spacing = 8.0 super.init(centerComponent: contentStack.view, @@ -66,11 +66,11 @@ public class PhotosStack: ErrorStack, ValueElement, PhotosStackManagerDelegate { mediaManager.delegate = self - addTarget = ObjectTarget(control: addButton, forControlEvents: .TouchUpInside, completion: addTapped) + addTarget = ObjectTarget(control: addButton, forControlEvents: .touchUpInside, completion: addTapped) } public func addTapped(sender:UIButton) { - mediaManager.newAssetFromSource(.View(sender)) + mediaManager.newAssetFromSource(source: .view(sender)) } public func photosStackManager(stack: PhotosStackManager, selectedAsset: PhotosStackAsset) { @@ -80,7 +80,7 @@ public class PhotosStack: ErrorStack, ValueElement, PhotosStackManagerDelegate { public func photosStackManagerCancelled(stack: PhotosStackManager) { } public func updateMediaCollectionViewHeight() { - let contentSize = mediaCollectionView.collectionViewLayout.collectionViewContentSize() + let contentSize = mediaCollectionView.collectionViewLayout.collectionViewContentSize if contentSize.height != mediaCollectionViewHeightConstraint.constant { mediaCollectionViewHeightConstraint.constant = contentSize.height } @@ -90,7 +90,7 @@ public class PhotosStack: ErrorStack, ValueElement, PhotosStackManagerDelegate { return mediaManager.mediaDataSource } - public func setValue(value: T?) -> Bool { + public func setValue(_ value: T?) -> Bool { guard let mediaObjects = value as? [PhotosStackAsset] else { return false } @@ -102,9 +102,9 @@ public class PhotosStack: ErrorStack, ValueElement, PhotosStackManagerDelegate { public func validateValue() -> ValidationResult { let value = getValue() as? [PhotosStackAsset] - let result = validation?.validate(value: value) ?? .Valid + let result = validation?.validate(value) ?? .valid - if case .Invalid(let message) = result { + if case .invalid(let message) = result { errorText = message } else { errorText = nil diff --git a/TheDistanceFormsPhotosVideosTests/Resources/Media.xcassets/Contents.json b/TheDistanceFormsPhotosVideos/Resources/Media.xcassets/Contents.json similarity index 100% rename from TheDistanceFormsPhotosVideosTests/Resources/Media.xcassets/Contents.json rename to TheDistanceFormsPhotosVideos/Resources/Media.xcassets/Contents.json diff --git a/TheDistanceFormsPhotosVideosTests/Resources/Media.xcassets/ic_videocam_white.imageset/Contents.json b/TheDistanceFormsPhotosVideos/Resources/Media.xcassets/ic_videocam_white.imageset/Contents.json similarity index 100% rename from TheDistanceFormsPhotosVideosTests/Resources/Media.xcassets/ic_videocam_white.imageset/Contents.json rename to TheDistanceFormsPhotosVideos/Resources/Media.xcassets/ic_videocam_white.imageset/Contents.json diff --git a/TheDistanceFormsPhotosVideosTests/Resources/Media.xcassets/ic_videocam_white.imageset/ic_videocam_white.png b/TheDistanceFormsPhotosVideos/Resources/Media.xcassets/ic_videocam_white.imageset/ic_videocam_white.png similarity index 100% rename from TheDistanceFormsPhotosVideosTests/Resources/Media.xcassets/ic_videocam_white.imageset/ic_videocam_white.png rename to TheDistanceFormsPhotosVideos/Resources/Media.xcassets/ic_videocam_white.imageset/ic_videocam_white.png diff --git a/TheDistanceFormsPhotosVideosTests/Resources/Media.xcassets/ic_videocam_white.imageset/ic_videocam_white@2x.png b/TheDistanceFormsPhotosVideos/Resources/Media.xcassets/ic_videocam_white.imageset/ic_videocam_white@2x.png similarity index 100% rename from TheDistanceFormsPhotosVideosTests/Resources/Media.xcassets/ic_videocam_white.imageset/ic_videocam_white@2x.png rename to TheDistanceFormsPhotosVideos/Resources/Media.xcassets/ic_videocam_white.imageset/ic_videocam_white@2x.png diff --git a/TheDistanceFormsPhotosVideosTests/Resources/Media.xcassets/ic_videocam_white.imageset/ic_videocam_white@3x.png b/TheDistanceFormsPhotosVideos/Resources/Media.xcassets/ic_videocam_white.imageset/ic_videocam_white@3x.png similarity index 100% rename from TheDistanceFormsPhotosVideosTests/Resources/Media.xcassets/ic_videocam_white.imageset/ic_videocam_white@3x.png rename to TheDistanceFormsPhotosVideos/Resources/Media.xcassets/ic_videocam_white.imageset/ic_videocam_white@3x.png diff --git a/podfile b/podfile index 576cace..5e14c51 100644 --- a/podfile +++ b/podfile @@ -36,3 +36,9 @@ target 'TheDistanceFormsThemed' do end +target 'TheDistanceFormsPhotosVideos' do + + core_pods + +end +