commit c28e02d1bbd39e40c52045f0640eaba43a18d89d Author: Ruoyu Fu Date: Mon May 6 15:01:51 2019 +0800 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..047cbe9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,74 @@ +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## Build generated +build/ +DerivedData/ + +## Various settings +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata/ + +## Other +*.moved-aside +*.xccheckout +*.xcscmblueprint + +## Obj-C/Swift specific +*.hmap +*.ipa +*.dSYM.zip +*.dSYM + +## Playgrounds +timeline.xctimeline +playground.xcworkspace + +# Swift Package Manager +# +# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. +# Packages/ +# Package.pins +# Package.resolved +.build/ + +Pods/ +*.xcworkspace + +# Carthage +# +# Add this line if you want to avoid checking in source code from Carthage dependencies. +# Carthage/Checkouts + +Carthage/Build + +# Accio dependency management +Dependencies/ +.accio/ + +# fastlane +# +# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the +# screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://docs.fastlane.tools/best-practices/source-control/#source-control + +fastlane/report.xml +fastlane/Preview.html +fastlane/screenshots/**/*.png +fastlane/test_output + +# Code Injection +# +# After new code Injection tools there's a generated folder /iOSInjectionProject +# https://github.com/johnno1962/injectionforxcode + +iOSInjectionProject/ diff --git a/LocationInput.xcodeproj/project.pbxproj b/LocationInput.xcodeproj/project.pbxproj new file mode 100644 index 0000000..e3f2785 --- /dev/null +++ b/LocationInput.xcodeproj/project.pbxproj @@ -0,0 +1,611 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 17403F47227AC5440086AF7E /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17403F46227AC5440086AF7E /* AppDelegate.swift */; }; + 17403F49227AC5440086AF7E /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17403F48227AC5440086AF7E /* ViewController.swift */; }; + 17403F4C227AC5440086AF7E /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 17403F4A227AC5440086AF7E /* Main.storyboard */; }; + 17403F4E227AC5460086AF7E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 17403F4D227AC5460086AF7E /* Assets.xcassets */; }; + 17403F51227AC5460086AF7E /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 17403F4F227AC5460086AF7E /* LaunchScreen.storyboard */; }; + 17403F5C227AC5460086AF7E /* LocationInputTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17403F5B227AC5460086AF7E /* LocationInputTests.swift */; }; + 17403F6B227BDB320086AF7E /* GMSRXExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17403F6A227BDB320086AF7E /* GMSRXExtensions.swift */; }; + 8FCBB421DF868555E26034AA /* Pods_LocationInput.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C6FC32474259195B0C055B28 /* Pods_LocationInput.framework */; }; + B2238DBCBEB9586A171FC0E0 /* Pods_LocationInputTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D63BA308C3EBDCDF1B13B7FE /* Pods_LocationInputTests.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 17403F58227AC5460086AF7E /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 17403F3B227AC5440086AF7E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 17403F42227AC5440086AF7E; + remoteInfo = LocationInput; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 1558C6EE9C47FC9FA6BA5CB8 /* Pods-LocationInputTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LocationInputTests.debug.xcconfig"; path = "Target Support Files/Pods-LocationInputTests/Pods-LocationInputTests.debug.xcconfig"; sourceTree = ""; }; + 17403F43227AC5440086AF7E /* LocationInput.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LocationInput.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 17403F46227AC5440086AF7E /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 17403F48227AC5440086AF7E /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 17403F4B227AC5440086AF7E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 17403F4D227AC5460086AF7E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 17403F50227AC5460086AF7E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 17403F52227AC5460086AF7E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 17403F57227AC5460086AF7E /* LocationInputTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LocationInputTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 17403F5B227AC5460086AF7E /* LocationInputTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocationInputTests.swift; sourceTree = ""; }; + 17403F5D227AC5460086AF7E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 17403F6A227BDB320086AF7E /* GMSRXExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GMSRXExtensions.swift; sourceTree = ""; }; + 85DB9E816C57265FBD3B6142 /* Pods-LocationInput.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LocationInput.debug.xcconfig"; path = "Target Support Files/Pods-LocationInput/Pods-LocationInput.debug.xcconfig"; sourceTree = ""; }; + 8692B3A57ECEFE6BF8891CEB /* Pods-LocationInput.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LocationInput.release.xcconfig"; path = "Target Support Files/Pods-LocationInput/Pods-LocationInput.release.xcconfig"; sourceTree = ""; }; + B270D4661BE9E319D254B909 /* Pods-LocationInputTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LocationInputTests.release.xcconfig"; path = "Target Support Files/Pods-LocationInputTests/Pods-LocationInputTests.release.xcconfig"; sourceTree = ""; }; + C6FC32474259195B0C055B28 /* Pods_LocationInput.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_LocationInput.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D63BA308C3EBDCDF1B13B7FE /* Pods_LocationInputTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_LocationInputTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 17403F40227AC5440086AF7E /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 8FCBB421DF868555E26034AA /* Pods_LocationInput.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 17403F54227AC5460086AF7E /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + B2238DBCBEB9586A171FC0E0 /* Pods_LocationInputTests.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 17403F3A227AC5440086AF7E = { + isa = PBXGroup; + children = ( + 17403F45227AC5440086AF7E /* LocationInput */, + 17403F5A227AC5460086AF7E /* LocationInputTests */, + 17403F44227AC5440086AF7E /* Products */, + E30E1A4E7E57DC26986C1F66 /* Pods */, + 464E870BB5733B82AF50C0E6 /* Frameworks */, + ); + sourceTree = ""; + }; + 17403F44227AC5440086AF7E /* Products */ = { + isa = PBXGroup; + children = ( + 17403F43227AC5440086AF7E /* LocationInput.app */, + 17403F57227AC5460086AF7E /* LocationInputTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 17403F45227AC5440086AF7E /* LocationInput */ = { + isa = PBXGroup; + children = ( + 17403F46227AC5440086AF7E /* AppDelegate.swift */, + 17403F48227AC5440086AF7E /* ViewController.swift */, + 17403F4A227AC5440086AF7E /* Main.storyboard */, + 17403F4D227AC5460086AF7E /* Assets.xcassets */, + 17403F4F227AC5460086AF7E /* LaunchScreen.storyboard */, + 17403F52227AC5460086AF7E /* Info.plist */, + 17403F6A227BDB320086AF7E /* GMSRXExtensions.swift */, + ); + path = LocationInput; + sourceTree = ""; + }; + 17403F5A227AC5460086AF7E /* LocationInputTests */ = { + isa = PBXGroup; + children = ( + 17403F5B227AC5460086AF7E /* LocationInputTests.swift */, + 17403F5D227AC5460086AF7E /* Info.plist */, + ); + path = LocationInputTests; + sourceTree = ""; + }; + 464E870BB5733B82AF50C0E6 /* Frameworks */ = { + isa = PBXGroup; + children = ( + C6FC32474259195B0C055B28 /* Pods_LocationInput.framework */, + D63BA308C3EBDCDF1B13B7FE /* Pods_LocationInputTests.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + E30E1A4E7E57DC26986C1F66 /* Pods */ = { + isa = PBXGroup; + children = ( + 85DB9E816C57265FBD3B6142 /* Pods-LocationInput.debug.xcconfig */, + 8692B3A57ECEFE6BF8891CEB /* Pods-LocationInput.release.xcconfig */, + 1558C6EE9C47FC9FA6BA5CB8 /* Pods-LocationInputTests.debug.xcconfig */, + B270D4661BE9E319D254B909 /* Pods-LocationInputTests.release.xcconfig */, + ); + path = Pods; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 17403F42227AC5440086AF7E /* LocationInput */ = { + isa = PBXNativeTarget; + buildConfigurationList = 17403F60227AC5460086AF7E /* Build configuration list for PBXNativeTarget "LocationInput" */; + buildPhases = ( + 803A45C2329C9698535A5CB8 /* [CP] Check Pods Manifest.lock */, + 17403F3F227AC5440086AF7E /* Sources */, + 17403F40227AC5440086AF7E /* Frameworks */, + 17403F41227AC5440086AF7E /* Resources */, + 1AEFFB21E6D3336F1B266D3B /* [CP] Embed Pods Frameworks */, + C3BCEA04A3738448D93955B7 /* [CP] Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = LocationInput; + productName = LocationInput; + productReference = 17403F43227AC5440086AF7E /* LocationInput.app */; + productType = "com.apple.product-type.application"; + }; + 17403F56227AC5460086AF7E /* LocationInputTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 17403F63227AC5460086AF7E /* Build configuration list for PBXNativeTarget "LocationInputTests" */; + buildPhases = ( + 633249FF5F3D8A3488CD65D3 /* [CP] Check Pods Manifest.lock */, + 17403F53227AC5460086AF7E /* Sources */, + 17403F54227AC5460086AF7E /* Frameworks */, + 17403F55227AC5460086AF7E /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 17403F59227AC5460086AF7E /* PBXTargetDependency */, + ); + name = LocationInputTests; + productName = LocationInputTests; + productReference = 17403F57227AC5460086AF7E /* LocationInputTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 17403F3B227AC5440086AF7E /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1020; + LastUpgradeCheck = 1020; + ORGANIZATIONNAME = Tappollo; + TargetAttributes = { + 17403F42227AC5440086AF7E = { + CreatedOnToolsVersion = 10.2.1; + }; + 17403F56227AC5460086AF7E = { + CreatedOnToolsVersion = 10.2.1; + TestTargetID = 17403F42227AC5440086AF7E; + }; + }; + }; + buildConfigurationList = 17403F3E227AC5440086AF7E /* Build configuration list for PBXProject "LocationInput" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 17403F3A227AC5440086AF7E; + productRefGroup = 17403F44227AC5440086AF7E /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 17403F42227AC5440086AF7E /* LocationInput */, + 17403F56227AC5460086AF7E /* LocationInputTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 17403F41227AC5440086AF7E /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 17403F51227AC5460086AF7E /* LaunchScreen.storyboard in Resources */, + 17403F4E227AC5460086AF7E /* Assets.xcassets in Resources */, + 17403F4C227AC5440086AF7E /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 17403F55227AC5460086AF7E /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 1AEFFB21E6D3336F1B266D3B /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-LocationInput/Pods-LocationInput-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/RxAtomic/RxAtomic.framework", + "${BUILT_PRODUCTS_DIR}/RxCocoa/RxCocoa.framework", + "${BUILT_PRODUCTS_DIR}/RxSwift/RxSwift.framework", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + ); + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxAtomic.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxCocoa.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxSwift.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-LocationInput/Pods-LocationInput-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 633249FF5F3D8A3488CD65D3 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-LocationInputTests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + 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"; + showEnvVarsInLog = 0; + }; + 803A45C2329C9698535A5CB8 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-LocationInput-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + 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"; + showEnvVarsInLog = 0; + }; + C3BCEA04A3738448D93955B7 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-LocationInput/Pods-LocationInput-resources.sh", + "${PODS_ROOT}/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/Resources/GoogleMaps.bundle", + "${PODS_ROOT}/GooglePlaces/Frameworks/GooglePlaces.framework/Resources/GooglePlaces.bundle", + ); + name = "[CP] Copy Pods Resources"; + outputFileListPaths = ( + ); + outputPaths = ( + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GoogleMaps.bundle", + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GooglePlaces.bundle", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-LocationInput/Pods-LocationInput-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 17403F3F227AC5440086AF7E /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 17403F49227AC5440086AF7E /* ViewController.swift in Sources */, + 17403F6B227BDB320086AF7E /* GMSRXExtensions.swift in Sources */, + 17403F47227AC5440086AF7E /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 17403F53227AC5460086AF7E /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 17403F5C227AC5460086AF7E /* LocationInputTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 17403F59227AC5460086AF7E /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 17403F42227AC5440086AF7E /* LocationInput */; + targetProxy = 17403F58227AC5460086AF7E /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 17403F4A227AC5440086AF7E /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 17403F4B227AC5440086AF7E /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 17403F4F227AC5460086AF7E /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 17403F50227AC5460086AF7E /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 17403F5E227AC5460086AF7E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.2; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 17403F5F227AC5460086AF7E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.2; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 17403F61227AC5460086AF7E /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 85DB9E816C57265FBD3B6142 /* Pods-LocationInput.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 835BXF96BF; + INFOPLIST_FILE = LocationInput/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.tappollo.LocationInput; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 17403F62227AC5460086AF7E /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 8692B3A57ECEFE6BF8891CEB /* Pods-LocationInput.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 835BXF96BF; + INFOPLIST_FILE = LocationInput/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.tappollo.LocationInput; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + 17403F64227AC5460086AF7E /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 1558C6EE9C47FC9FA6BA5CB8 /* Pods-LocationInputTests.debug.xcconfig */; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 835BXF96BF; + INFOPLIST_FILE = LocationInputTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.tappollo.LocationInputTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/LocationInput.app/LocationInput"; + }; + name = Debug; + }; + 17403F65227AC5460086AF7E /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = B270D4661BE9E319D254B909 /* Pods-LocationInputTests.release.xcconfig */; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 835BXF96BF; + INFOPLIST_FILE = LocationInputTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.tappollo.LocationInputTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/LocationInput.app/LocationInput"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 17403F3E227AC5440086AF7E /* Build configuration list for PBXProject "LocationInput" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 17403F5E227AC5460086AF7E /* Debug */, + 17403F5F227AC5460086AF7E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 17403F60227AC5460086AF7E /* Build configuration list for PBXNativeTarget "LocationInput" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 17403F61227AC5460086AF7E /* Debug */, + 17403F62227AC5460086AF7E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 17403F63227AC5460086AF7E /* Build configuration list for PBXNativeTarget "LocationInputTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 17403F64227AC5460086AF7E /* Debug */, + 17403F65227AC5460086AF7E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 17403F3B227AC5440086AF7E /* Project object */; +} diff --git a/LocationInput/AppDelegate.swift b/LocationInput/AppDelegate.swift new file mode 100644 index 0000000..145b537 --- /dev/null +++ b/LocationInput/AppDelegate.swift @@ -0,0 +1,47 @@ +// +// AppDelegate.swift +// LocationInput +// +// Created by Ruoyu Fu on 2019/5/2. +// Copyright © 2019 Tappollo. All rights reserved. +// + +import UIKit +import GooglePlaces +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + GMSPlacesClient.provideAPIKey("AIzaSyAGYMvwsth1NowF8OKMezks4GmJYgaLdr8") + // Override point for customization after application launch. + return true + } + + func applicationWillResignActive(_ application: UIApplication) { + // 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. + // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(_ application: UIApplication) { + // 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. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(_ application: UIApplication) { + // 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. + } + + func applicationDidBecomeActive(_ application: UIApplication) { + // 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. + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + +} + diff --git a/LocationInput/Assets.xcassets/AppIcon.appiconset/Contents.json b/LocationInput/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..d8db8d6 --- /dev/null +++ b/LocationInput/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/LocationInput/Assets.xcassets/Contents.json b/LocationInput/Assets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/LocationInput/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/LocationInput/Assets.xcassets/End.imageset/Contents.json b/LocationInput/Assets.xcassets/End.imageset/Contents.json new file mode 100644 index 0000000..c8c8d2c --- /dev/null +++ b/LocationInput/Assets.xcassets/End.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "End@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "End@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/LocationInput/Assets.xcassets/End.imageset/End@2x.png b/LocationInput/Assets.xcassets/End.imageset/End@2x.png new file mode 100644 index 0000000..cc4b4cc Binary files /dev/null and b/LocationInput/Assets.xcassets/End.imageset/End@2x.png differ diff --git a/LocationInput/Assets.xcassets/End.imageset/End@3x.png b/LocationInput/Assets.xcassets/End.imageset/End@3x.png new file mode 100644 index 0000000..1d921a2 Binary files /dev/null and b/LocationInput/Assets.xcassets/End.imageset/End@3x.png differ diff --git a/LocationInput/Assets.xcassets/Start.imageset/Contents.json b/LocationInput/Assets.xcassets/Start.imageset/Contents.json new file mode 100644 index 0000000..b072d35 --- /dev/null +++ b/LocationInput/Assets.xcassets/Start.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "Start@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "Start@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/LocationInput/Assets.xcassets/Start.imageset/Start@2x.png b/LocationInput/Assets.xcassets/Start.imageset/Start@2x.png new file mode 100644 index 0000000..8401848 Binary files /dev/null and b/LocationInput/Assets.xcassets/Start.imageset/Start@2x.png differ diff --git a/LocationInput/Assets.xcassets/Start.imageset/Start@3x.png b/LocationInput/Assets.xcassets/Start.imageset/Start@3x.png new file mode 100644 index 0000000..ae2447c Binary files /dev/null and b/LocationInput/Assets.xcassets/Start.imageset/Start@3x.png differ diff --git a/LocationInput/Base.lproj/LaunchScreen.storyboard b/LocationInput/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..bfa3612 --- /dev/null +++ b/LocationInput/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/LocationInput/Base.lproj/Main.storyboard b/LocationInput/Base.lproj/Main.storyboard new file mode 100644 index 0000000..834e2a9 --- /dev/null +++ b/LocationInput/Base.lproj/Main.storyboard @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/LocationInput/GMSRXExtensions.swift b/LocationInput/GMSRXExtensions.swift new file mode 100644 index 0000000..24e6ce1 --- /dev/null +++ b/LocationInput/GMSRXExtensions.swift @@ -0,0 +1,68 @@ +// +// GMSRXExtensions.swift +// LocationInput +// +// Created by Ruoyu Fu on 2019/5/3. +// Copyright © 2019 Tappollo. All rights reserved. +// + +import RxSwift +import RxCocoa +import GooglePlaces + +extension GMSAutocompleteTableDataSource: HasDelegate { + public typealias Delegate = GMSAutocompleteTableDataSourceDelegate +} + +open class RxGMSDataSourceDelegateProxy + : DelegateProxy + , DelegateProxyType +, GMSAutocompleteTableDataSourceDelegate { + + public weak private(set) var dataSource: GMSAutocompleteTableDataSource? + + public init(dataSource: ParentObject) { + self.dataSource = dataSource + super.init(parentObject: dataSource, delegateProxy: RxGMSDataSourceDelegateProxy.self) + } + public static func registerKnownImplementations() { + register { RxGMSDataSourceDelegateProxy(dataSource: $0) } + } + + var placeBehaviorSubject = BehaviorSubject(value: nil) + + public func tableDataSource(_ tableDataSource: GMSAutocompleteTableDataSource, didAutocompleteWith place: GMSPlace) { + placeBehaviorSubject.on(.next(place)) + } + + public func tableDataSource(_ tableDataSource: GMSAutocompleteTableDataSource, didFailAutocompleteWithError error: Error) { + } + + deinit { + placeBehaviorSubject.on(.completed) + } +} + +extension Reactive where Base == GMSAutocompleteTableDataSource{ + + public var delegate: DelegateProxy { + return RxGMSDataSourceDelegateProxy.proxy(for: base) + } + + var sourceText:Binder { + return Binder(self.base) { (dataSource, text: String?) in + dataSource.sourceTextHasChanged(text) + } + } + + public var didUpdateAutocompletePredictions: ControlEvent { + let source = delegate.methodInvoked( + #selector(GMSAutocompleteTableDataSourceDelegate.didUpdateAutocompletePredictions(for:))).map{_ in} + return ControlEvent(events: source) + } + + public var didAutocompletePlace: ControlEvent { + return ControlEvent(events: (delegate as! RxGMSDataSourceDelegateProxy).placeBehaviorSubject) + } + +} diff --git a/LocationInput/Info.plist b/LocationInput/Info.plist new file mode 100644 index 0000000..16be3b6 --- /dev/null +++ b/LocationInput/Info.plist @@ -0,0 +1,45 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/LocationInput/ViewController.swift b/LocationInput/ViewController.swift new file mode 100644 index 0000000..18e0488 --- /dev/null +++ b/LocationInput/ViewController.swift @@ -0,0 +1,59 @@ +// +// ViewController.swift +// LocationInput +// +// Created by Ruoyu Fu on 2019/5/2. +// Copyright © 2019 Tappollo. All rights reserved. +// + +import UIKit +import GooglePlaces +import RxCocoa +import RxSwift + +class ViewController: UIViewController { + + let disposeBag = DisposeBag() + @IBOutlet weak var header: UIView! + @IBOutlet weak var pickupResults: UITableView! + @IBOutlet weak var dropoffResults: UITableView! + @IBOutlet weak var pickupField: UITextField! + @IBOutlet weak var dropoffField: UITextField! + let pickupSource = GMSAutocompleteTableDataSource() + let dropoffSource = GMSAutocompleteTableDataSource() + + override func viewDidLoad() { + super.viewDidLoad() + setupView() + bindModels(textField: pickupField, table: pickupResults, source: pickupSource) + bindModels(textField: dropoffField, table: dropoffResults, source: dropoffSource) + } + func setupView() { + header.layer.masksToBounds = false + header.layer.shadowOffset = CGSize(width: 1, height: 1) + header.layer.shadowRadius = 3 + header.layer.shadowOpacity = 0.3 + } + func bindModels(textField: UITextField, table: UITableView, source: GMSAutocompleteTableDataSource) { + table.delegate = source + table.dataSource = source + Observable.merge([ + textField.rx.controlEvent([.editingDidBegin]).map({false}), + textField.rx.controlEvent([.editingDidEnd]).map({true}) + ]) + .bind(to: table.rx.isHidden) + .disposed(by: disposeBag) + textField.rx.text + .bind(to: source.rx.sourceText) + .disposed(by: disposeBag) + source.rx.didUpdateAutocompletePredictions + .bind {table.reloadData()}.disposed(by: disposeBag) + source.rx.didAutocompletePlace + .filter({$0 != nil}) + .map({$0!.name}) + .do(onNext: {_ in textField.resignFirstResponder()}) + .bind(to: textField.rx.text) + .disposed(by: disposeBag) + } + +} diff --git a/LocationInputTests/Info.plist b/LocationInputTests/Info.plist new file mode 100644 index 0000000..6c40a6c --- /dev/null +++ b/LocationInputTests/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/LocationInputTests/LocationInputTests.swift b/LocationInputTests/LocationInputTests.swift new file mode 100644 index 0000000..128b2d0 --- /dev/null +++ b/LocationInputTests/LocationInputTests.swift @@ -0,0 +1,34 @@ +// +// LocationInputTests.swift +// LocationInputTests +// +// Created by Ruoyu Fu on 2019/5/2. +// Copyright © 2019 Tappollo. All rights reserved. +// + +import XCTest +@testable import LocationInput + +class LocationInputTests: XCTestCase { + + override func setUp() { + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + } + + func testExample() { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + + func testPerformanceExample() { + // This is an example of a performance test case. + self.measure { + // Put the code you want to measure the time of here. + } + } + +} diff --git a/Podfile b/Podfile new file mode 100644 index 0000000..d51efd3 --- /dev/null +++ b/Podfile @@ -0,0 +1,19 @@ +# Uncomment the next line to define a global platform for your project +# platform :ios, '9.0' + +target 'LocationInput' do + # Comment the next line if you're not using Swift and don't want to use dynamic frameworks + use_frameworks! + + # Pods for LocationInput + pod 'RxSwift' + pod 'RxCocoa' + pod 'GooglePlaces' + pod 'GoogleMaps' + + target 'LocationInputTests' do + inherit! :search_paths + # Pods for testing + end + +end diff --git a/Podfile.lock b/Podfile.lock new file mode 100644 index 0000000..24f2554 --- /dev/null +++ b/Podfile.lock @@ -0,0 +1,38 @@ +PODS: + - GoogleMaps (3.0.3): + - GoogleMaps/Maps (= 3.0.3) + - GoogleMaps/Base (3.0.3) + - GoogleMaps/Maps (3.0.3): + - GoogleMaps/Base + - GooglePlaces (3.0.3): + - GoogleMaps/Base (= 3.0.3) + - RxAtomic (4.4.2) + - RxCocoa (4.4.2): + - RxSwift (>= 4.4.2, ~> 4.4) + - RxSwift (4.4.2): + - RxAtomic (>= 4.4.2, ~> 4.4) + +DEPENDENCIES: + - GoogleMaps + - GooglePlaces + - RxCocoa + - RxSwift + +SPEC REPOS: + https://github.com/cocoapods/specs.git: + - GoogleMaps + - GooglePlaces + - RxAtomic + - RxCocoa + - RxSwift + +SPEC CHECKSUMS: + GoogleMaps: fd5c9fa58871781b9fb94d4936f19c69fe60ce32 + GooglePlaces: f09e76993c9c3ee4af8f4f7f535bb94d6aa3b649 + RxAtomic: d00e97c10db88c6f08540e0bf2752fc5a2404167 + RxCocoa: 477990dc3b4c3ff55fb0ac77e1cc06244e0aaec8 + RxSwift: 74c29b693c8e42b0f64400e8b06564575742d649 + +PODFILE CHECKSUM: dda2c3e127c1387645cb61712b865b92b80b0077 + +COCOAPODS: 1.6.0