├── .gitignore ├── Example ├── LMGeocoder.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── LMGeocoder-Example.xcscheme ├── LMGeocoder.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── lminh.xcuserdatad │ │ └── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist ├── LMGeocoder │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ ├── Contents.json │ │ └── background.imageset │ │ │ ├── Contents.json │ │ │ └── background.png │ ├── LMAppDelegate.h │ ├── LMAppDelegate.m │ ├── LMGeocoder-Info.plist │ ├── LMGeocoder-Prefix.pch │ ├── LMViewController.h │ ├── LMViewController.m │ ├── en.lproj │ │ └── InfoPlist.strings │ └── main.m ├── Podfile ├── Podfile.lock ├── Pods │ ├── Local Podspecs │ │ └── LMGeocoder.podspec.json │ ├── Manifest.lock │ ├── Pods.xcodeproj │ │ ├── project.pbxproj │ │ └── xcuserdata │ │ │ └── lminh.xcuserdatad │ │ │ └── xcschemes │ │ │ ├── LMGeocoder.xcscheme │ │ │ ├── Pods-LMGeocoder_Example.xcscheme │ │ │ ├── Pods-LMGeocoder_Tests.xcscheme │ │ │ └── xcschememanagement.plist │ └── Target Support Files │ │ ├── LMGeocoder │ │ ├── Info.plist │ │ ├── LMGeocoder-Info.plist │ │ ├── LMGeocoder-dummy.m │ │ ├── LMGeocoder-prefix.pch │ │ ├── LMGeocoder-umbrella.h │ │ ├── LMGeocoder.modulemap │ │ └── LMGeocoder.xcconfig │ │ ├── Pods-LMGeocoder_Example │ │ ├── Info.plist │ │ ├── Pods-LMGeocoder_Example-Info.plist │ │ ├── Pods-LMGeocoder_Example-acknowledgements.markdown │ │ ├── Pods-LMGeocoder_Example-acknowledgements.plist │ │ ├── Pods-LMGeocoder_Example-dummy.m │ │ ├── Pods-LMGeocoder_Example-frameworks.sh │ │ ├── Pods-LMGeocoder_Example-resources.sh │ │ ├── Pods-LMGeocoder_Example-umbrella.h │ │ ├── Pods-LMGeocoder_Example.debug.xcconfig │ │ ├── Pods-LMGeocoder_Example.modulemap │ │ └── Pods-LMGeocoder_Example.release.xcconfig │ │ └── Pods-LMGeocoder_Tests │ │ ├── Info.plist │ │ ├── Pods-LMGeocoder_Tests-Info.plist │ │ ├── Pods-LMGeocoder_Tests-acknowledgements.markdown │ │ ├── Pods-LMGeocoder_Tests-acknowledgements.plist │ │ ├── Pods-LMGeocoder_Tests-dummy.m │ │ ├── Pods-LMGeocoder_Tests-frameworks.sh │ │ ├── Pods-LMGeocoder_Tests-resources.sh │ │ ├── Pods-LMGeocoder_Tests-umbrella.h │ │ ├── Pods-LMGeocoder_Tests.debug.xcconfig │ │ ├── Pods-LMGeocoder_Tests.modulemap │ │ └── Pods-LMGeocoder_Tests.release.xcconfig └── Tests │ ├── Tests-Info.plist │ ├── Tests-Prefix.pch │ ├── Tests.m │ └── en.lproj │ └── InfoPlist.strings ├── LICENSE ├── LMGeocoder.podspec ├── LMGeocoder ├── Assets │ └── .gitkeep └── Classes │ ├── .gitkeep │ ├── LMAddress.h │ ├── LMAddress.m │ ├── LMGeocoder.h │ ├── LMGeocoder.m │ ├── LMGeocodingOperation.h │ └── LMGeocodingOperation.m ├── README.md ├── Screenshots ├── screenshot.png └── screenshot@2x.png └── _Pods.xcodeproj /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | LMGeocoderDemo/.DS_Store 3 | 4 | LMGeocoderDemo/.DS_Store 5 | 6 | *.xcuserstate 7 | -------------------------------------------------------------------------------- /Example/LMGeocoder.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; 11 | 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; }; 12 | 6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; 13 | 6003F598195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F596195388D20070C39A /* InfoPlist.strings */; }; 14 | 6003F59A195388D20070C39A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F599195388D20070C39A /* main.m */; }; 15 | 6003F59E195388D20070C39A /* LMAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F59D195388D20070C39A /* LMAppDelegate.m */; }; 16 | 6003F5A7195388D20070C39A /* LMViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5A6195388D20070C39A /* LMViewController.m */; }; 17 | 6003F5A9195388D20070C39A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5A8195388D20070C39A /* Images.xcassets */; }; 18 | 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F5AF195388D20070C39A /* XCTest.framework */; }; 19 | 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; 20 | 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; 21 | 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; }; 22 | 6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; }; 23 | 6387220749990D207B353811 /* Pods_LMGeocoder_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96AFA4BA01EDD8DA0D42DD2F /* Pods_LMGeocoder_Tests.framework */; }; 24 | 71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */; }; 25 | 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */; }; 26 | BF696745A8AF458D9DF1F8F7 /* Pods_LMGeocoder_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E16B299D0F6F919E828E47EC /* Pods_LMGeocoder_Example.framework */; }; 27 | /* End PBXBuildFile section */ 28 | 29 | /* Begin PBXContainerItemProxy section */ 30 | 6003F5B3195388D20070C39A /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = 6003F582195388D10070C39A /* Project object */; 33 | proxyType = 1; 34 | remoteGlobalIDString = 6003F589195388D20070C39A; 35 | remoteInfo = LMGeocoder; 36 | }; 37 | /* End PBXContainerItemProxy section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | 1197A34B60D5342451D09653 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; 41 | 1C954EBBFD3E8F512ABCC8DE /* Pods-LMGeocoder_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LMGeocoder_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-LMGeocoder_Example/Pods-LMGeocoder_Example.debug.xcconfig"; sourceTree = ""; }; 42 | 6003F58A195388D20070C39A /* LMGeocoder_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LMGeocoder_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | 6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 44 | 6003F58F195388D20070C39A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 45 | 6003F591195388D20070C39A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 46 | 6003F595195388D20070C39A /* LMGeocoder-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "LMGeocoder-Info.plist"; sourceTree = ""; }; 47 | 6003F597195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 48 | 6003F599195388D20070C39A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 49 | 6003F59B195388D20070C39A /* LMGeocoder-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "LMGeocoder-Prefix.pch"; sourceTree = ""; }; 50 | 6003F59C195388D20070C39A /* LMAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LMAppDelegate.h; sourceTree = ""; }; 51 | 6003F59D195388D20070C39A /* LMAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LMAppDelegate.m; sourceTree = ""; }; 52 | 6003F5A5195388D20070C39A /* LMViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LMViewController.h; sourceTree = ""; }; 53 | 6003F5A6195388D20070C39A /* LMViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LMViewController.m; sourceTree = ""; }; 54 | 6003F5A8195388D20070C39A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 55 | 6003F5AE195388D20070C39A /* LMGeocoder_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LMGeocoder_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 56 | 6003F5AF195388D20070C39A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 57 | 6003F5B7195388D20070C39A /* Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tests-Info.plist"; sourceTree = ""; }; 58 | 6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 59 | 6003F5BB195388D20070C39A /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = ""; }; 60 | 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = ""; }; 61 | 71719F9E1E33DC2100824A3D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 62 | 74B65C4C486BDF23C3618844 /* Pods-LMGeocoder_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LMGeocoder_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-LMGeocoder_Tests/Pods-LMGeocoder_Tests.debug.xcconfig"; sourceTree = ""; }; 63 | 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Main.storyboard; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 64 | 96AFA4BA01EDD8DA0D42DD2F /* Pods_LMGeocoder_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_LMGeocoder_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 65 | 9ECC9D03FFA3A04B82E796A7 /* Pods-LMGeocoder_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LMGeocoder_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-LMGeocoder_Example/Pods-LMGeocoder_Example.release.xcconfig"; sourceTree = ""; }; 66 | B8CE3764209A15EF65B4A0EB /* LMGeocoder.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LMGeocoder.podspec; path = ../LMGeocoder.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 67 | D1D9E9FCE66AD0145EA78C5D /* Pods-LMGeocoder_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LMGeocoder_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-LMGeocoder_Tests/Pods-LMGeocoder_Tests.release.xcconfig"; sourceTree = ""; }; 68 | D58959B02DCB1C9D5BFDD747 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; 69 | E16B299D0F6F919E828E47EC /* Pods_LMGeocoder_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_LMGeocoder_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 70 | /* End PBXFileReference section */ 71 | 72 | /* Begin PBXFrameworksBuildPhase section */ 73 | 6003F587195388D20070C39A /* Frameworks */ = { 74 | isa = PBXFrameworksBuildPhase; 75 | buildActionMask = 2147483647; 76 | files = ( 77 | 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */, 78 | 6003F592195388D20070C39A /* UIKit.framework in Frameworks */, 79 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */, 80 | BF696745A8AF458D9DF1F8F7 /* Pods_LMGeocoder_Example.framework in Frameworks */, 81 | ); 82 | runOnlyForDeploymentPostprocessing = 0; 83 | }; 84 | 6003F5AB195388D20070C39A /* Frameworks */ = { 85 | isa = PBXFrameworksBuildPhase; 86 | buildActionMask = 2147483647; 87 | files = ( 88 | 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */, 89 | 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */, 90 | 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */, 91 | 6387220749990D207B353811 /* Pods_LMGeocoder_Tests.framework in Frameworks */, 92 | ); 93 | runOnlyForDeploymentPostprocessing = 0; 94 | }; 95 | /* End PBXFrameworksBuildPhase section */ 96 | 97 | /* Begin PBXGroup section */ 98 | 6003F581195388D10070C39A = { 99 | isa = PBXGroup; 100 | children = ( 101 | 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */, 102 | 6003F593195388D20070C39A /* Example for LMGeocoder */, 103 | 6003F5B5195388D20070C39A /* Tests */, 104 | 6003F58C195388D20070C39A /* Frameworks */, 105 | 6003F58B195388D20070C39A /* Products */, 106 | F685AB8AACC9DA250C57DD81 /* Pods */, 107 | ); 108 | sourceTree = ""; 109 | }; 110 | 6003F58B195388D20070C39A /* Products */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | 6003F58A195388D20070C39A /* LMGeocoder_Example.app */, 114 | 6003F5AE195388D20070C39A /* LMGeocoder_Tests.xctest */, 115 | ); 116 | name = Products; 117 | sourceTree = ""; 118 | }; 119 | 6003F58C195388D20070C39A /* Frameworks */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | 6003F58D195388D20070C39A /* Foundation.framework */, 123 | 6003F58F195388D20070C39A /* CoreGraphics.framework */, 124 | 6003F591195388D20070C39A /* UIKit.framework */, 125 | 6003F5AF195388D20070C39A /* XCTest.framework */, 126 | E16B299D0F6F919E828E47EC /* Pods_LMGeocoder_Example.framework */, 127 | 96AFA4BA01EDD8DA0D42DD2F /* Pods_LMGeocoder_Tests.framework */, 128 | ); 129 | name = Frameworks; 130 | sourceTree = ""; 131 | }; 132 | 6003F593195388D20070C39A /* Example for LMGeocoder */ = { 133 | isa = PBXGroup; 134 | children = ( 135 | 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */, 136 | 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */, 137 | 6003F59C195388D20070C39A /* LMAppDelegate.h */, 138 | 6003F59D195388D20070C39A /* LMAppDelegate.m */, 139 | 6003F5A5195388D20070C39A /* LMViewController.h */, 140 | 6003F5A6195388D20070C39A /* LMViewController.m */, 141 | 6003F594195388D20070C39A /* Supporting Files */, 142 | ); 143 | name = "Example for LMGeocoder"; 144 | path = LMGeocoder; 145 | sourceTree = ""; 146 | }; 147 | 6003F594195388D20070C39A /* Supporting Files */ = { 148 | isa = PBXGroup; 149 | children = ( 150 | 6003F5A8195388D20070C39A /* Images.xcassets */, 151 | 6003F595195388D20070C39A /* LMGeocoder-Info.plist */, 152 | 6003F596195388D20070C39A /* InfoPlist.strings */, 153 | 6003F599195388D20070C39A /* main.m */, 154 | 6003F59B195388D20070C39A /* LMGeocoder-Prefix.pch */, 155 | ); 156 | name = "Supporting Files"; 157 | sourceTree = ""; 158 | }; 159 | 6003F5B5195388D20070C39A /* Tests */ = { 160 | isa = PBXGroup; 161 | children = ( 162 | 6003F5BB195388D20070C39A /* Tests.m */, 163 | 6003F5B6195388D20070C39A /* Supporting Files */, 164 | ); 165 | path = Tests; 166 | sourceTree = ""; 167 | }; 168 | 6003F5B6195388D20070C39A /* Supporting Files */ = { 169 | isa = PBXGroup; 170 | children = ( 171 | 6003F5B7195388D20070C39A /* Tests-Info.plist */, 172 | 6003F5B8195388D20070C39A /* InfoPlist.strings */, 173 | 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */, 174 | ); 175 | name = "Supporting Files"; 176 | sourceTree = ""; 177 | }; 178 | 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */ = { 179 | isa = PBXGroup; 180 | children = ( 181 | B8CE3764209A15EF65B4A0EB /* LMGeocoder.podspec */, 182 | 1197A34B60D5342451D09653 /* README.md */, 183 | D58959B02DCB1C9D5BFDD747 /* LICENSE */, 184 | ); 185 | name = "Podspec Metadata"; 186 | sourceTree = ""; 187 | }; 188 | F685AB8AACC9DA250C57DD81 /* Pods */ = { 189 | isa = PBXGroup; 190 | children = ( 191 | 1C954EBBFD3E8F512ABCC8DE /* Pods-LMGeocoder_Example.debug.xcconfig */, 192 | 9ECC9D03FFA3A04B82E796A7 /* Pods-LMGeocoder_Example.release.xcconfig */, 193 | 74B65C4C486BDF23C3618844 /* Pods-LMGeocoder_Tests.debug.xcconfig */, 194 | D1D9E9FCE66AD0145EA78C5D /* Pods-LMGeocoder_Tests.release.xcconfig */, 195 | ); 196 | name = Pods; 197 | sourceTree = ""; 198 | }; 199 | /* End PBXGroup section */ 200 | 201 | /* Begin PBXNativeTarget section */ 202 | 6003F589195388D20070C39A /* LMGeocoder_Example */ = { 203 | isa = PBXNativeTarget; 204 | buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "LMGeocoder_Example" */; 205 | buildPhases = ( 206 | 7BF0DB12B693C7264DAAB7E8 /* [CP] Check Pods Manifest.lock */, 207 | 6003F586195388D20070C39A /* Sources */, 208 | 6003F587195388D20070C39A /* Frameworks */, 209 | 6003F588195388D20070C39A /* Resources */, 210 | F920C4A5D1A18DF3A5048A2E /* [CP] Embed Pods Frameworks */, 211 | ); 212 | buildRules = ( 213 | ); 214 | dependencies = ( 215 | ); 216 | name = LMGeocoder_Example; 217 | productName = LMGeocoder; 218 | productReference = 6003F58A195388D20070C39A /* LMGeocoder_Example.app */; 219 | productType = "com.apple.product-type.application"; 220 | }; 221 | 6003F5AD195388D20070C39A /* LMGeocoder_Tests */ = { 222 | isa = PBXNativeTarget; 223 | buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "LMGeocoder_Tests" */; 224 | buildPhases = ( 225 | F45F11762760320B8C63255B /* [CP] Check Pods Manifest.lock */, 226 | 6003F5AA195388D20070C39A /* Sources */, 227 | 6003F5AB195388D20070C39A /* Frameworks */, 228 | 6003F5AC195388D20070C39A /* Resources */, 229 | ); 230 | buildRules = ( 231 | ); 232 | dependencies = ( 233 | 6003F5B4195388D20070C39A /* PBXTargetDependency */, 234 | ); 235 | name = LMGeocoder_Tests; 236 | productName = LMGeocoderTests; 237 | productReference = 6003F5AE195388D20070C39A /* LMGeocoder_Tests.xctest */; 238 | productType = "com.apple.product-type.bundle.unit-test"; 239 | }; 240 | /* End PBXNativeTarget section */ 241 | 242 | /* Begin PBXProject section */ 243 | 6003F582195388D10070C39A /* Project object */ = { 244 | isa = PBXProject; 245 | attributes = { 246 | CLASSPREFIX = LM; 247 | LastUpgradeCheck = 1020; 248 | ORGANIZATIONNAME = LMinh; 249 | TargetAttributes = { 250 | 6003F5AD195388D20070C39A = { 251 | TestTargetID = 6003F589195388D20070C39A; 252 | }; 253 | }; 254 | }; 255 | buildConfigurationList = 6003F585195388D10070C39A /* Build configuration list for PBXProject "LMGeocoder" */; 256 | compatibilityVersion = "Xcode 3.2"; 257 | developmentRegion = en; 258 | hasScannedForEncodings = 0; 259 | knownRegions = ( 260 | en, 261 | Base, 262 | ); 263 | mainGroup = 6003F581195388D10070C39A; 264 | productRefGroup = 6003F58B195388D20070C39A /* Products */; 265 | projectDirPath = ""; 266 | projectRoot = ""; 267 | targets = ( 268 | 6003F589195388D20070C39A /* LMGeocoder_Example */, 269 | 6003F5AD195388D20070C39A /* LMGeocoder_Tests */, 270 | ); 271 | }; 272 | /* End PBXProject section */ 273 | 274 | /* Begin PBXResourcesBuildPhase section */ 275 | 6003F588195388D20070C39A /* Resources */ = { 276 | isa = PBXResourcesBuildPhase; 277 | buildActionMask = 2147483647; 278 | files = ( 279 | 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */, 280 | 71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */, 281 | 6003F5A9195388D20070C39A /* Images.xcassets in Resources */, 282 | 6003F598195388D20070C39A /* InfoPlist.strings in Resources */, 283 | ); 284 | runOnlyForDeploymentPostprocessing = 0; 285 | }; 286 | 6003F5AC195388D20070C39A /* Resources */ = { 287 | isa = PBXResourcesBuildPhase; 288 | buildActionMask = 2147483647; 289 | files = ( 290 | 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */, 291 | ); 292 | runOnlyForDeploymentPostprocessing = 0; 293 | }; 294 | /* End PBXResourcesBuildPhase section */ 295 | 296 | /* Begin PBXShellScriptBuildPhase section */ 297 | 7BF0DB12B693C7264DAAB7E8 /* [CP] Check Pods Manifest.lock */ = { 298 | isa = PBXShellScriptBuildPhase; 299 | buildActionMask = 2147483647; 300 | files = ( 301 | ); 302 | inputFileListPaths = ( 303 | ); 304 | inputPaths = ( 305 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 306 | "${PODS_ROOT}/Manifest.lock", 307 | ); 308 | name = "[CP] Check Pods Manifest.lock"; 309 | outputFileListPaths = ( 310 | ); 311 | outputPaths = ( 312 | "$(DERIVED_FILE_DIR)/Pods-LMGeocoder_Example-checkManifestLockResult.txt", 313 | ); 314 | runOnlyForDeploymentPostprocessing = 0; 315 | shellPath = /bin/sh; 316 | 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"; 317 | showEnvVarsInLog = 0; 318 | }; 319 | F45F11762760320B8C63255B /* [CP] Check Pods Manifest.lock */ = { 320 | isa = PBXShellScriptBuildPhase; 321 | buildActionMask = 2147483647; 322 | files = ( 323 | ); 324 | inputFileListPaths = ( 325 | ); 326 | inputPaths = ( 327 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 328 | "${PODS_ROOT}/Manifest.lock", 329 | ); 330 | name = "[CP] Check Pods Manifest.lock"; 331 | outputFileListPaths = ( 332 | ); 333 | outputPaths = ( 334 | "$(DERIVED_FILE_DIR)/Pods-LMGeocoder_Tests-checkManifestLockResult.txt", 335 | ); 336 | runOnlyForDeploymentPostprocessing = 0; 337 | shellPath = /bin/sh; 338 | 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"; 339 | showEnvVarsInLog = 0; 340 | }; 341 | F920C4A5D1A18DF3A5048A2E /* [CP] Embed Pods Frameworks */ = { 342 | isa = PBXShellScriptBuildPhase; 343 | buildActionMask = 2147483647; 344 | files = ( 345 | ); 346 | inputPaths = ( 347 | "${PODS_ROOT}/Target Support Files/Pods-LMGeocoder_Example/Pods-LMGeocoder_Example-frameworks.sh", 348 | "${BUILT_PRODUCTS_DIR}/LMGeocoder/LMGeocoder.framework", 349 | ); 350 | name = "[CP] Embed Pods Frameworks"; 351 | outputPaths = ( 352 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/LMGeocoder.framework", 353 | ); 354 | runOnlyForDeploymentPostprocessing = 0; 355 | shellPath = /bin/sh; 356 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-LMGeocoder_Example/Pods-LMGeocoder_Example-frameworks.sh\"\n"; 357 | showEnvVarsInLog = 0; 358 | }; 359 | /* End PBXShellScriptBuildPhase section */ 360 | 361 | /* Begin PBXSourcesBuildPhase section */ 362 | 6003F586195388D20070C39A /* Sources */ = { 363 | isa = PBXSourcesBuildPhase; 364 | buildActionMask = 2147483647; 365 | files = ( 366 | 6003F59E195388D20070C39A /* LMAppDelegate.m in Sources */, 367 | 6003F5A7195388D20070C39A /* LMViewController.m in Sources */, 368 | 6003F59A195388D20070C39A /* main.m in Sources */, 369 | ); 370 | runOnlyForDeploymentPostprocessing = 0; 371 | }; 372 | 6003F5AA195388D20070C39A /* Sources */ = { 373 | isa = PBXSourcesBuildPhase; 374 | buildActionMask = 2147483647; 375 | files = ( 376 | 6003F5BC195388D20070C39A /* Tests.m in Sources */, 377 | ); 378 | runOnlyForDeploymentPostprocessing = 0; 379 | }; 380 | /* End PBXSourcesBuildPhase section */ 381 | 382 | /* Begin PBXTargetDependency section */ 383 | 6003F5B4195388D20070C39A /* PBXTargetDependency */ = { 384 | isa = PBXTargetDependency; 385 | target = 6003F589195388D20070C39A /* LMGeocoder_Example */; 386 | targetProxy = 6003F5B3195388D20070C39A /* PBXContainerItemProxy */; 387 | }; 388 | /* End PBXTargetDependency section */ 389 | 390 | /* Begin PBXVariantGroup section */ 391 | 6003F596195388D20070C39A /* InfoPlist.strings */ = { 392 | isa = PBXVariantGroup; 393 | children = ( 394 | 6003F597195388D20070C39A /* en */, 395 | ); 396 | name = InfoPlist.strings; 397 | sourceTree = ""; 398 | }; 399 | 6003F5B8195388D20070C39A /* InfoPlist.strings */ = { 400 | isa = PBXVariantGroup; 401 | children = ( 402 | 6003F5B9195388D20070C39A /* en */, 403 | ); 404 | name = InfoPlist.strings; 405 | sourceTree = ""; 406 | }; 407 | 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */ = { 408 | isa = PBXVariantGroup; 409 | children = ( 410 | 71719F9E1E33DC2100824A3D /* Base */, 411 | ); 412 | name = LaunchScreen.storyboard; 413 | sourceTree = ""; 414 | }; 415 | /* End PBXVariantGroup section */ 416 | 417 | /* Begin XCBuildConfiguration section */ 418 | 6003F5BD195388D20070C39A /* Debug */ = { 419 | isa = XCBuildConfiguration; 420 | buildSettings = { 421 | ALWAYS_SEARCH_USER_PATHS = NO; 422 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 423 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 424 | CLANG_CXX_LIBRARY = "libc++"; 425 | CLANG_ENABLE_MODULES = YES; 426 | CLANG_ENABLE_OBJC_ARC = YES; 427 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 428 | CLANG_WARN_BOOL_CONVERSION = YES; 429 | CLANG_WARN_COMMA = YES; 430 | CLANG_WARN_CONSTANT_CONVERSION = YES; 431 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 432 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 433 | CLANG_WARN_EMPTY_BODY = YES; 434 | CLANG_WARN_ENUM_CONVERSION = YES; 435 | CLANG_WARN_INFINITE_RECURSION = YES; 436 | CLANG_WARN_INT_CONVERSION = YES; 437 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 438 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 439 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 440 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 441 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 442 | CLANG_WARN_STRICT_PROTOTYPES = YES; 443 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 444 | CLANG_WARN_UNREACHABLE_CODE = YES; 445 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 446 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 447 | COPY_PHASE_STRIP = NO; 448 | ENABLE_STRICT_OBJC_MSGSEND = YES; 449 | ENABLE_TESTABILITY = YES; 450 | GCC_C_LANGUAGE_STANDARD = gnu99; 451 | GCC_DYNAMIC_NO_PIC = NO; 452 | GCC_NO_COMMON_BLOCKS = YES; 453 | GCC_OPTIMIZATION_LEVEL = 0; 454 | GCC_PREPROCESSOR_DEFINITIONS = ( 455 | "DEBUG=1", 456 | "$(inherited)", 457 | ); 458 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 459 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 460 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 461 | GCC_WARN_UNDECLARED_SELECTOR = YES; 462 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 463 | GCC_WARN_UNUSED_FUNCTION = YES; 464 | GCC_WARN_UNUSED_VARIABLE = YES; 465 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 466 | ONLY_ACTIVE_ARCH = YES; 467 | SDKROOT = iphoneos; 468 | TARGETED_DEVICE_FAMILY = "1,2"; 469 | }; 470 | name = Debug; 471 | }; 472 | 6003F5BE195388D20070C39A /* Release */ = { 473 | isa = XCBuildConfiguration; 474 | buildSettings = { 475 | ALWAYS_SEARCH_USER_PATHS = NO; 476 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 477 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 478 | CLANG_CXX_LIBRARY = "libc++"; 479 | CLANG_ENABLE_MODULES = YES; 480 | CLANG_ENABLE_OBJC_ARC = YES; 481 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 482 | CLANG_WARN_BOOL_CONVERSION = YES; 483 | CLANG_WARN_COMMA = YES; 484 | CLANG_WARN_CONSTANT_CONVERSION = YES; 485 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 486 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 487 | CLANG_WARN_EMPTY_BODY = YES; 488 | CLANG_WARN_ENUM_CONVERSION = YES; 489 | CLANG_WARN_INFINITE_RECURSION = YES; 490 | CLANG_WARN_INT_CONVERSION = YES; 491 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 492 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 493 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 494 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 495 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 496 | CLANG_WARN_STRICT_PROTOTYPES = YES; 497 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 498 | CLANG_WARN_UNREACHABLE_CODE = YES; 499 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 500 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 501 | COPY_PHASE_STRIP = YES; 502 | ENABLE_NS_ASSERTIONS = NO; 503 | ENABLE_STRICT_OBJC_MSGSEND = YES; 504 | GCC_C_LANGUAGE_STANDARD = gnu99; 505 | GCC_NO_COMMON_BLOCKS = YES; 506 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 507 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 508 | GCC_WARN_UNDECLARED_SELECTOR = YES; 509 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 510 | GCC_WARN_UNUSED_FUNCTION = YES; 511 | GCC_WARN_UNUSED_VARIABLE = YES; 512 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 513 | SDKROOT = iphoneos; 514 | TARGETED_DEVICE_FAMILY = "1,2"; 515 | VALIDATE_PRODUCT = YES; 516 | }; 517 | name = Release; 518 | }; 519 | 6003F5C0195388D20070C39A /* Debug */ = { 520 | isa = XCBuildConfiguration; 521 | baseConfigurationReference = 1C954EBBFD3E8F512ABCC8DE /* Pods-LMGeocoder_Example.debug.xcconfig */; 522 | buildSettings = { 523 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 524 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 525 | GCC_PREFIX_HEADER = "LMGeocoder/LMGeocoder-Prefix.pch"; 526 | INFOPLIST_FILE = "LMGeocoder/LMGeocoder-Info.plist"; 527 | MODULE_NAME = ExampleApp; 528 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; 529 | PRODUCT_NAME = "$(TARGET_NAME)"; 530 | WRAPPER_EXTENSION = app; 531 | }; 532 | name = Debug; 533 | }; 534 | 6003F5C1195388D20070C39A /* Release */ = { 535 | isa = XCBuildConfiguration; 536 | baseConfigurationReference = 9ECC9D03FFA3A04B82E796A7 /* Pods-LMGeocoder_Example.release.xcconfig */; 537 | buildSettings = { 538 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 539 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 540 | GCC_PREFIX_HEADER = "LMGeocoder/LMGeocoder-Prefix.pch"; 541 | INFOPLIST_FILE = "LMGeocoder/LMGeocoder-Info.plist"; 542 | MODULE_NAME = ExampleApp; 543 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; 544 | PRODUCT_NAME = "$(TARGET_NAME)"; 545 | WRAPPER_EXTENSION = app; 546 | }; 547 | name = Release; 548 | }; 549 | 6003F5C3195388D20070C39A /* Debug */ = { 550 | isa = XCBuildConfiguration; 551 | baseConfigurationReference = 74B65C4C486BDF23C3618844 /* Pods-LMGeocoder_Tests.debug.xcconfig */; 552 | buildSettings = { 553 | BUNDLE_LOADER = "$(TEST_HOST)"; 554 | FRAMEWORK_SEARCH_PATHS = ( 555 | "$(SDKROOT)/Developer/Library/Frameworks", 556 | "$(inherited)", 557 | "$(DEVELOPER_FRAMEWORKS_DIR)", 558 | ); 559 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 560 | GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; 561 | GCC_PREPROCESSOR_DEFINITIONS = ( 562 | "DEBUG=1", 563 | "$(inherited)", 564 | ); 565 | INFOPLIST_FILE = "Tests/Tests-Info.plist"; 566 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; 567 | PRODUCT_NAME = "$(TARGET_NAME)"; 568 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/LMGeocoder_Example.app/LMGeocoder_Example"; 569 | WRAPPER_EXTENSION = xctest; 570 | }; 571 | name = Debug; 572 | }; 573 | 6003F5C4195388D20070C39A /* Release */ = { 574 | isa = XCBuildConfiguration; 575 | baseConfigurationReference = D1D9E9FCE66AD0145EA78C5D /* Pods-LMGeocoder_Tests.release.xcconfig */; 576 | buildSettings = { 577 | BUNDLE_LOADER = "$(TEST_HOST)"; 578 | FRAMEWORK_SEARCH_PATHS = ( 579 | "$(SDKROOT)/Developer/Library/Frameworks", 580 | "$(inherited)", 581 | "$(DEVELOPER_FRAMEWORKS_DIR)", 582 | ); 583 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 584 | GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; 585 | INFOPLIST_FILE = "Tests/Tests-Info.plist"; 586 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; 587 | PRODUCT_NAME = "$(TARGET_NAME)"; 588 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/LMGeocoder_Example.app/LMGeocoder_Example"; 589 | WRAPPER_EXTENSION = xctest; 590 | }; 591 | name = Release; 592 | }; 593 | /* End XCBuildConfiguration section */ 594 | 595 | /* Begin XCConfigurationList section */ 596 | 6003F585195388D10070C39A /* Build configuration list for PBXProject "LMGeocoder" */ = { 597 | isa = XCConfigurationList; 598 | buildConfigurations = ( 599 | 6003F5BD195388D20070C39A /* Debug */, 600 | 6003F5BE195388D20070C39A /* Release */, 601 | ); 602 | defaultConfigurationIsVisible = 0; 603 | defaultConfigurationName = Release; 604 | }; 605 | 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "LMGeocoder_Example" */ = { 606 | isa = XCConfigurationList; 607 | buildConfigurations = ( 608 | 6003F5C0195388D20070C39A /* Debug */, 609 | 6003F5C1195388D20070C39A /* Release */, 610 | ); 611 | defaultConfigurationIsVisible = 0; 612 | defaultConfigurationName = Release; 613 | }; 614 | 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "LMGeocoder_Tests" */ = { 615 | isa = XCConfigurationList; 616 | buildConfigurations = ( 617 | 6003F5C3195388D20070C39A /* Debug */, 618 | 6003F5C4195388D20070C39A /* Release */, 619 | ); 620 | defaultConfigurationIsVisible = 0; 621 | defaultConfigurationName = Release; 622 | }; 623 | /* End XCConfigurationList section */ 624 | }; 625 | rootObject = 6003F582195388D10070C39A /* Project object */; 626 | } 627 | -------------------------------------------------------------------------------- /Example/LMGeocoder.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/LMGeocoder.xcodeproj/xcshareddata/xcschemes/LMGeocoder-Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 64 | 66 | 72 | 73 | 74 | 75 | 76 | 77 | 83 | 85 | 91 | 92 | 93 | 94 | 96 | 97 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /Example/LMGeocoder.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/LMGeocoder.xcworkspace/xcuserdata/lminh.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 20 | 21 | 22 | 24 | 36 | 37 | 38 | 40 | 52 | 53 | 54 | 56 | 68 | 69 | 70 | 72 | 84 | 85 | 86 | 88 | 100 | 101 | 102 | 104 | 116 | 117 | 118 | 120 | 132 | 133 | 134 | 136 | 148 | 149 | 150 | 152 | 164 | 165 | 166 | 168 | 180 | 181 | 182 | 184 | 196 | 197 | 198 | 199 | 200 | -------------------------------------------------------------------------------- /Example/LMGeocoder/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 | 30 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /Example/LMGeocoder/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 50 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 79 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 121 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | -------------------------------------------------------------------------------- /Example/LMGeocoder/Images.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 | } 99 | -------------------------------------------------------------------------------- /Example/LMGeocoder/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Example/LMGeocoder/Images.xcassets/background.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "background.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Example/LMGeocoder/Images.xcassets/background.imageset/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lminhtm/LMGeocoder/20db5f27fb12c3a2726c2355b1476ae7c9c3db42/Example/LMGeocoder/Images.xcassets/background.imageset/background.png -------------------------------------------------------------------------------- /Example/LMGeocoder/LMAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // LMAppDelegate.h 3 | // LMGeocoder 4 | // 5 | // Created by LMinh on 03/02/2019. 6 | // Copyright (c) 2019 LMinh. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | @interface LMAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Example/LMGeocoder/LMAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // LMAppDelegate.m 3 | // LMGeocoder 4 | // 5 | // Created by LMinh on 03/02/2019. 6 | // Copyright (c) 2019 LMinh. All rights reserved. 7 | // 8 | 9 | #import "LMAppDelegate.h" 10 | 11 | @implementation LMAppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | // Override point for customization after application launch. 16 | return YES; 17 | } 18 | 19 | - (void)applicationWillResignActive:(UIApplication *)application 20 | { 21 | // 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. 22 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 23 | } 24 | 25 | - (void)applicationDidEnterBackground:(UIApplication *)application 26 | { 27 | // 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. 28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 29 | } 30 | 31 | - (void)applicationWillEnterForeground:(UIApplication *)application 32 | { 33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | - (void)applicationDidBecomeActive:(UIApplication *)application 37 | { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application 42 | { 43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Example/LMGeocoder/LMGeocoder-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | NSLocationWhenInUseUsageDescription 49 | Testing 50 | NSCameraUsageDescription 51 | Testing 52 | UIViewControllerBasedStatusBarAppearance 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /Example/LMGeocoder/LMGeocoder-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | @import UIKit; 15 | @import Foundation; 16 | #endif 17 | -------------------------------------------------------------------------------- /Example/LMGeocoder/LMViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // LMViewController.h 3 | // LMGeocoder 4 | // 5 | // Created by LMinh on 03/02/2019. 6 | // Copyright (c) 2019 LMinh. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | @interface LMViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/LMGeocoder/LMViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // LMViewController.m 3 | // LMGeocoder 4 | // 5 | // Created by LMinh on 03/02/2019. 6 | // Copyright (c) 2019 LMinh. All rights reserved. 7 | // 8 | 9 | #import "LMViewController.h" 10 | #import 11 | #import 12 | #import 13 | 14 | @interface LMViewController () 15 | 16 | @property (strong, nonatomic) CLLocationManager *locationManager; 17 | 18 | @property (weak, nonatomic) IBOutlet UIImageView *backgroundImageView; 19 | @property (weak, nonatomic) IBOutlet UIView *latitudeView; 20 | @property (weak, nonatomic) IBOutlet UIView *longitudeView; 21 | @property (weak, nonatomic) IBOutlet UIView *addressView; 22 | @property (weak, nonatomic) IBOutlet UILabel *latitudeLabel; 23 | @property (weak, nonatomic) IBOutlet UILabel *longitudeLabel; 24 | @property (weak, nonatomic) IBOutlet UILabel *addressLabel; 25 | 26 | @end 27 | 28 | @implementation LMViewController 29 | 30 | #pragma mark - VIEW LIFECYCLE 31 | 32 | - (void)viewDidLoad { 33 | 34 | [super viewDidLoad]; 35 | 36 | // You can set your google API key here 37 | [LMGeocoder sharedInstance].googleAPIKey = nil; 38 | 39 | // Start getting current location 40 | self.locationManager = [[CLLocationManager alloc] init]; 41 | self.locationManager.delegate = self; 42 | self.locationManager.desiredAccuracy = kCLLocationAccuracyBestForNavigation; 43 | self.locationManager.distanceFilter = 10; 44 | [self.locationManager requestWhenInUseAuthorization]; 45 | [self.locationManager startUpdatingLocation]; 46 | 47 | // Customize UI 48 | [self customizeUI]; 49 | } 50 | 51 | - (void)customizeUI { 52 | 53 | [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; 54 | 55 | // Black background 56 | self.latitudeView.layer.cornerRadius = 5; 57 | self.longitudeView.layer.cornerRadius = 5; 58 | self.addressView.layer.cornerRadius = 5; 59 | self.latitudeView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.4]; 60 | self.longitudeView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.4]; 61 | self.addressView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.4]; 62 | 63 | // Show camera on real device for nice effect 64 | BOOL hasCamera = ([[AVCaptureDevice devices] count] > 0); 65 | if (hasCamera) { 66 | AVCaptureSession *session = [[AVCaptureSession alloc] init]; 67 | session.sessionPreset = AVCaptureSessionPresetHigh; 68 | 69 | AVCaptureVideoPreviewLayer *captureVideoPreviewLayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession:session]; 70 | [captureVideoPreviewLayer setVideoGravity:AVLayerVideoGravityResizeAspectFill]; 71 | [captureVideoPreviewLayer setFrame:self.backgroundImageView.bounds]; 72 | [self.backgroundImageView.layer addSublayer:captureVideoPreviewLayer]; 73 | 74 | AVCaptureDevice *device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; 75 | NSError *error = nil; 76 | AVCaptureDeviceInput *input = [AVCaptureDeviceInput deviceInputWithDevice:device error:&error]; 77 | [session addInput:input]; 78 | [session startRunning]; 79 | } 80 | else { 81 | self.backgroundImageView.image = [UIImage imageNamed:@"background"]; 82 | } 83 | } 84 | 85 | 86 | #pragma mark - LOCATION MANAGER 87 | 88 | - (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations { 89 | 90 | CLLocation *location = [locations lastObject]; 91 | CLLocationCoordinate2D coordinate = location.coordinate; 92 | 93 | // Update UI 94 | self.latitudeLabel.text = [NSString stringWithFormat:@"%f", coordinate.latitude]; 95 | self.longitudeLabel.text = [NSString stringWithFormat:@"%f", coordinate.longitude]; 96 | 97 | // Start to reverse 98 | [[LMGeocoder sharedInstance] reverseGeocodeCoordinate:coordinate 99 | service:LMGeocoderServiceGoogle 100 | alternativeService:LMGeocoderServiceApple 101 | completionHandler:^(NSArray *results, NSError *error) { 102 | 103 | // Parse formatted address 104 | NSString *formattedAddress = @"-"; 105 | if (results.count && !error) { 106 | LMAddress *address = [results firstObject]; 107 | formattedAddress = address.formattedAddress; 108 | } 109 | NSLog(@"%@", formattedAddress); 110 | 111 | // Update UI 112 | self.addressLabel.text = formattedAddress; 113 | }]; 114 | } 115 | 116 | @end 117 | -------------------------------------------------------------------------------- /Example/LMGeocoder/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example/LMGeocoder/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // LMGeocoder 4 | // 5 | // Created by LMinh on 03/02/2019. 6 | // Copyright (c) 2019 LMinh. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | #import "LMAppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) 13 | { 14 | @autoreleasepool { 15 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([LMAppDelegate class])); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | use_frameworks! 2 | 3 | platform :ios, '8.0' 4 | 5 | target 'LMGeocoder_Example' do 6 | pod 'LMGeocoder', :path => '../' 7 | 8 | target 'LMGeocoder_Tests' do 9 | inherit! :search_paths 10 | 11 | 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - LMGeocoder (1.1.0) 3 | 4 | DEPENDENCIES: 5 | - LMGeocoder (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | LMGeocoder: 9 | :path: "../" 10 | 11 | SPEC CHECKSUMS: 12 | LMGeocoder: a5f44d368721c1f5901d61a9fca2e3268e8bf7a7 13 | 14 | PODFILE CHECKSUM: 4925dcdf83c1e8a06018d7e2f33bb6222425bf85 15 | 16 | COCOAPODS: 1.7.4 17 | -------------------------------------------------------------------------------- /Example/Pods/Local Podspecs/LMGeocoder.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "LMGeocoder", 3 | "version": "1.1.0", 4 | "summary": "Simple wrapper for geocoding and reverse geocoding, using both Google Geocoding API and Apple iOS Geocoding Framework.", 5 | "description": "Simple wrapper for geocoding and reverse geocoding, written in Objective-C, using both Google Geocoding API and Apple iOS Geocoding Framework.", 6 | "homepage": "https://github.com/lminhtm/LMGeocoder", 7 | "screenshots": "https://raw.github.com/lminhtm/LMGeocoder/master/Screenshots/screenshot.png", 8 | "license": { 9 | "type": "MIT", 10 | "file": "LICENSE" 11 | }, 12 | "authors": { 13 | "LMinh": "lminhtm@gmail.com" 14 | }, 15 | "source": { 16 | "git": "https://github.com/lminhtm/LMGeocoder.git", 17 | "tag": "1.1.0" 18 | }, 19 | "platforms": { 20 | "ios": "8.0" 21 | }, 22 | "source_files": "LMGeocoder/Classes/**/*" 23 | } 24 | -------------------------------------------------------------------------------- /Example/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - LMGeocoder (1.1.0) 3 | 4 | DEPENDENCIES: 5 | - LMGeocoder (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | LMGeocoder: 9 | :path: "../" 10 | 11 | SPEC CHECKSUMS: 12 | LMGeocoder: a5f44d368721c1f5901d61a9fca2e3268e8bf7a7 13 | 14 | PODFILE CHECKSUM: 4925dcdf83c1e8a06018d7e2f33bb6222425bf85 15 | 16 | COCOAPODS: 1.7.4 17 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/xcuserdata/lminh.xcuserdatad/xcschemes/LMGeocoder.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/xcuserdata/lminh.xcuserdatad/xcschemes/Pods-LMGeocoder_Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 66 | 67 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/xcuserdata/lminh.xcuserdatad/xcschemes/Pods-LMGeocoder_Tests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 66 | 67 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /Example/Pods/Pods.xcodeproj/xcuserdata/lminh.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | LMGeocoder.xcscheme 8 | 9 | isShown 10 | 11 | 12 | Pods-LMGeocoder_Example.xcscheme 13 | 14 | isShown 15 | 16 | 17 | Pods-LMGeocoder_Tests.xcscheme 18 | 19 | isShown 20 | 21 | 22 | 23 | SuppressBuildableAutocreation 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/LMGeocoder/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.9 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/LMGeocoder/LMGeocoder-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.1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/LMGeocoder/LMGeocoder-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_LMGeocoder : NSObject 3 | @end 4 | @implementation PodsDummy_LMGeocoder 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/LMGeocoder/LMGeocoder-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/LMGeocoder/LMGeocoder-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 | #import "LMAddress.h" 14 | #import "LMGeocoder.h" 15 | #import "LMGeocodingOperation.h" 16 | 17 | FOUNDATION_EXPORT double LMGeocoderVersionNumber; 18 | FOUNDATION_EXPORT const unsigned char LMGeocoderVersionString[]; 19 | 20 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/LMGeocoder/LMGeocoder.modulemap: -------------------------------------------------------------------------------- 1 | framework module LMGeocoder { 2 | umbrella header "LMGeocoder-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/LMGeocoder/LMGeocoder.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/LMGeocoder 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | PODS_BUILD_DIR = ${BUILD_DIR} 4 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 5 | PODS_ROOT = ${SRCROOT} 6 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. 7 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 8 | SKIP_INSTALL = YES 9 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-LMGeocoder_Example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-LMGeocoder_Example/Pods-LMGeocoder_Example-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-LMGeocoder_Example/Pods-LMGeocoder_Example-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## LMGeocoder 5 | 6 | Copyright (c) 2019 LMinh 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | Generated by CocoaPods - https://cocoapods.org 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-LMGeocoder_Example/Pods-LMGeocoder_Example-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 | Copyright (c) 2019 LMinh <lminhtm@gmail.com> 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | License 38 | MIT 39 | Title 40 | LMGeocoder 41 | Type 42 | PSGroupSpecifier 43 | 44 | 45 | FooterText 46 | Generated by CocoaPods - https://cocoapods.org 47 | Title 48 | 49 | Type 50 | PSGroupSpecifier 51 | 52 | 53 | StringsTable 54 | Acknowledgements 55 | Title 56 | Acknowledgements 57 | 58 | 59 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-LMGeocoder_Example/Pods-LMGeocoder_Example-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_LMGeocoder_Example : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_LMGeocoder_Example 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-LMGeocoder_Example/Pods-LMGeocoder_Example-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | function on_error { 7 | echo "$(realpath -mq "${0}"):$1: error: Unexpected failure" 8 | } 9 | trap 'on_error $LINENO' ERR 10 | 11 | if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then 12 | # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy 13 | # frameworks to, so exit 0 (signalling the script phase was successful). 14 | exit 0 15 | fi 16 | 17 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 18 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 19 | 20 | COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" 21 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 22 | 23 | # Used as a return value for each invocation of `strip_invalid_archs` function. 24 | STRIP_BINARY_RETVAL=0 25 | 26 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 27 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 28 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 29 | 30 | # Copies and strips a vendored framework 31 | install_framework() 32 | { 33 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 34 | local source="${BUILT_PRODUCTS_DIR}/$1" 35 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 36 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 37 | elif [ -r "$1" ]; then 38 | local source="$1" 39 | fi 40 | 41 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 42 | 43 | if [ -L "${source}" ]; then 44 | echo "Symlinked..." 45 | source="$(readlink "${source}")" 46 | fi 47 | 48 | # Use filter instead of exclude so missing patterns don't throw errors. 49 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 50 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 51 | 52 | local basename 53 | basename="$(basename -s .framework "$1")" 54 | binary="${destination}/${basename}.framework/${basename}" 55 | 56 | if ! [ -r "$binary" ]; then 57 | binary="${destination}/${basename}" 58 | elif [ -L "${binary}" ]; then 59 | echo "Destination binary is symlinked..." 60 | dirname="$(dirname "${binary}")" 61 | binary="${dirname}/$(readlink "${binary}")" 62 | fi 63 | 64 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 65 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 66 | strip_invalid_archs "$binary" 67 | fi 68 | 69 | # Resign the code if required by the build settings to avoid unstable apps 70 | code_sign_if_enabled "${destination}/$(basename "$1")" 71 | 72 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 73 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 74 | local swift_runtime_libs 75 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u) 76 | for lib in $swift_runtime_libs; do 77 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 78 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 79 | code_sign_if_enabled "${destination}/${lib}" 80 | done 81 | fi 82 | } 83 | 84 | # Copies and strips a vendored dSYM 85 | install_dsym() { 86 | local source="$1" 87 | if [ -r "$source" ]; then 88 | # Copy the dSYM into a the targets temp dir. 89 | 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}\"" 90 | 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}" 91 | 92 | local basename 93 | basename="$(basename -s .framework.dSYM "$source")" 94 | binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" 95 | 96 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 97 | if [[ "$(file "$binary")" == *"Mach-O "*"dSYM companion"* ]]; then 98 | strip_invalid_archs "$binary" 99 | fi 100 | 101 | if [[ $STRIP_BINARY_RETVAL == 1 ]]; then 102 | # Move the stripped file into its final destination. 103 | 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}\"" 104 | 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}" 105 | else 106 | # 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. 107 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" 108 | fi 109 | fi 110 | } 111 | 112 | # Copies the bcsymbolmap files of a vendored framework 113 | install_bcsymbolmap() { 114 | local bcsymbolmap_path="$1" 115 | local destination="${BUILT_PRODUCTS_DIR}" 116 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}"" 117 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}" 118 | } 119 | 120 | # Signs a framework with the provided identity 121 | code_sign_if_enabled() { 122 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 123 | # Use the current code_sign_identity 124 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 125 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" 126 | 127 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 128 | code_sign_cmd="$code_sign_cmd &" 129 | fi 130 | echo "$code_sign_cmd" 131 | eval "$code_sign_cmd" 132 | fi 133 | } 134 | 135 | # Strip invalid architectures 136 | strip_invalid_archs() { 137 | binary="$1" 138 | # Get architectures for current target binary 139 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" 140 | # Intersect them with the architectures we are building for 141 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" 142 | # If there are no archs supported by this binary then warn the user 143 | if [[ -z "$intersected_archs" ]]; then 144 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." 145 | STRIP_BINARY_RETVAL=0 146 | return 147 | fi 148 | stripped="" 149 | for arch in $binary_archs; do 150 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 151 | # Strip non-valid architectures in-place 152 | lipo -remove "$arch" -output "$binary" "$binary" 153 | stripped="$stripped $arch" 154 | fi 155 | done 156 | if [[ "$stripped" ]]; then 157 | echo "Stripped $binary of architectures:$stripped" 158 | fi 159 | STRIP_BINARY_RETVAL=1 160 | } 161 | 162 | 163 | if [[ "$CONFIGURATION" == "Debug" ]]; then 164 | install_framework "${BUILT_PRODUCTS_DIR}/LMGeocoder/LMGeocoder.framework" 165 | fi 166 | if [[ "$CONFIGURATION" == "Release" ]]; then 167 | install_framework "${BUILT_PRODUCTS_DIR}/LMGeocoder/LMGeocoder.framework" 168 | fi 169 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 170 | wait 171 | fi 172 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-LMGeocoder_Example/Pods-LMGeocoder_Example-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then 7 | # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy 8 | # resources to, so exit 0 (signalling the script phase was successful). 9 | exit 0 10 | fi 11 | 12 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 13 | 14 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 15 | > "$RESOURCES_TO_COPY" 16 | 17 | XCASSET_FILES=() 18 | 19 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 20 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 21 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 22 | 23 | case "${TARGETED_DEVICE_FAMILY:-}" in 24 | 1,2) 25 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 26 | ;; 27 | 1) 28 | TARGET_DEVICE_ARGS="--target-device iphone" 29 | ;; 30 | 2) 31 | TARGET_DEVICE_ARGS="--target-device ipad" 32 | ;; 33 | 3) 34 | TARGET_DEVICE_ARGS="--target-device tv" 35 | ;; 36 | 4) 37 | TARGET_DEVICE_ARGS="--target-device watch" 38 | ;; 39 | *) 40 | TARGET_DEVICE_ARGS="--target-device mac" 41 | ;; 42 | esac 43 | 44 | install_resource() 45 | { 46 | if [[ "$1" = /* ]] ; then 47 | RESOURCE_PATH="$1" 48 | else 49 | RESOURCE_PATH="${PODS_ROOT}/$1" 50 | fi 51 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 52 | cat << EOM 53 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 54 | EOM 55 | exit 1 56 | fi 57 | case $RESOURCE_PATH in 58 | *.storyboard) 59 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 60 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 61 | ;; 62 | *.xib) 63 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 64 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 65 | ;; 66 | *.framework) 67 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 68 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 69 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 70 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 71 | ;; 72 | *.xcdatamodel) 73 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true 74 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 75 | ;; 76 | *.xcdatamodeld) 77 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true 78 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 79 | ;; 80 | *.xcmappingmodel) 81 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true 82 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 83 | ;; 84 | *.xcassets) 85 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 86 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 87 | ;; 88 | *) 89 | echo "$RESOURCE_PATH" || true 90 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 91 | ;; 92 | esac 93 | } 94 | 95 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 96 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 97 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 98 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 99 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 100 | fi 101 | rm -f "$RESOURCES_TO_COPY" 102 | 103 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ] 104 | then 105 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 106 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 107 | while read line; do 108 | if [[ $line != "${PODS_ROOT}*" ]]; then 109 | XCASSET_FILES+=("$line") 110 | fi 111 | done <<<"$OTHER_XCASSETS" 112 | 113 | if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then 114 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 115 | else 116 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist" 117 | fi 118 | fi 119 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-LMGeocoder_Example/Pods-LMGeocoder_Example-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_LMGeocoder_ExampleVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_LMGeocoder_ExampleVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-LMGeocoder_Example/Pods-LMGeocoder_Example.debug.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/LMGeocoder" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/LMGeocoder/LMGeocoder.framework/Headers" 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_LDFLAGS = $(inherited) -framework "LMGeocoder" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-LMGeocoder_Example/Pods-LMGeocoder_Example.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_LMGeocoder_Example { 2 | umbrella header "Pods-LMGeocoder_Example-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-LMGeocoder_Example/Pods-LMGeocoder_Example.release.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/LMGeocoder" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/LMGeocoder/LMGeocoder.framework/Headers" 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_LDFLAGS = $(inherited) -framework "LMGeocoder" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-LMGeocoder_Tests/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-LMGeocoder_Tests/Pods-LMGeocoder_Tests-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-LMGeocoder_Tests/Pods-LMGeocoder_Tests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-LMGeocoder_Tests/Pods-LMGeocoder_Tests-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 | Generated by CocoaPods - https://cocoapods.org 18 | Title 19 | 20 | Type 21 | PSGroupSpecifier 22 | 23 | 24 | StringsTable 25 | Acknowledgements 26 | Title 27 | Acknowledgements 28 | 29 | 30 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-LMGeocoder_Tests/Pods-LMGeocoder_Tests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_LMGeocoder_Tests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_LMGeocoder_Tests 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-LMGeocoder_Tests/Pods-LMGeocoder_Tests-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then 7 | # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy 8 | # frameworks to, so exit 0 (signalling the script phase was successful). 9 | exit 0 10 | fi 11 | 12 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 13 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 14 | 15 | COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" 16 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 17 | 18 | # Used as a return value for each invocation of `strip_invalid_archs` function. 19 | STRIP_BINARY_RETVAL=0 20 | 21 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 22 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 23 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 24 | 25 | # Copies and strips a vendored framework 26 | install_framework() 27 | { 28 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 29 | local source="${BUILT_PRODUCTS_DIR}/$1" 30 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 31 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 32 | elif [ -r "$1" ]; then 33 | local source="$1" 34 | fi 35 | 36 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 37 | 38 | if [ -L "${source}" ]; then 39 | echo "Symlinked..." 40 | source="$(readlink "${source}")" 41 | fi 42 | 43 | # Use filter instead of exclude so missing patterns don't throw errors. 44 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 45 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 46 | 47 | local basename 48 | basename="$(basename -s .framework "$1")" 49 | binary="${destination}/${basename}.framework/${basename}" 50 | if ! [ -r "$binary" ]; then 51 | binary="${destination}/${basename}" 52 | fi 53 | 54 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 55 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 56 | strip_invalid_archs "$binary" 57 | fi 58 | 59 | # Resign the code if required by the build settings to avoid unstable apps 60 | code_sign_if_enabled "${destination}/$(basename "$1")" 61 | 62 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 63 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 64 | local swift_runtime_libs 65 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 66 | for lib in $swift_runtime_libs; do 67 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 68 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 69 | code_sign_if_enabled "${destination}/${lib}" 70 | done 71 | fi 72 | } 73 | 74 | # Copies and strips a vendored dSYM 75 | install_dsym() { 76 | local source="$1" 77 | if [ -r "$source" ]; then 78 | # Copy the dSYM into a the targets temp dir. 79 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" 80 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" 81 | 82 | local basename 83 | basename="$(basename -s .framework.dSYM "$source")" 84 | binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" 85 | 86 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 87 | if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then 88 | strip_invalid_archs "$binary" 89 | fi 90 | 91 | if [[ $STRIP_BINARY_RETVAL == 1 ]]; then 92 | # Move the stripped file into its final destination. 93 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" 94 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}" 95 | else 96 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. 97 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" 98 | fi 99 | fi 100 | } 101 | 102 | # Signs a framework with the provided identity 103 | code_sign_if_enabled() { 104 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 105 | # Use the current code_sign_identitiy 106 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 107 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" 108 | 109 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 110 | code_sign_cmd="$code_sign_cmd &" 111 | fi 112 | echo "$code_sign_cmd" 113 | eval "$code_sign_cmd" 114 | fi 115 | } 116 | 117 | # Strip invalid architectures 118 | strip_invalid_archs() { 119 | binary="$1" 120 | # Get architectures for current target binary 121 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" 122 | # Intersect them with the architectures we are building for 123 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" 124 | # If there are no archs supported by this binary then warn the user 125 | if [[ -z "$intersected_archs" ]]; then 126 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." 127 | STRIP_BINARY_RETVAL=0 128 | return 129 | fi 130 | stripped="" 131 | for arch in $binary_archs; do 132 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 133 | # Strip non-valid architectures in-place 134 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 135 | stripped="$stripped $arch" 136 | fi 137 | done 138 | if [[ "$stripped" ]]; then 139 | echo "Stripped $binary of architectures:$stripped" 140 | fi 141 | STRIP_BINARY_RETVAL=1 142 | } 143 | 144 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 145 | wait 146 | fi 147 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-LMGeocoder_Tests/Pods-LMGeocoder_Tests-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-LMGeocoder_Tests/Pods-LMGeocoder_Tests-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_LMGeocoder_TestsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_LMGeocoder_TestsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-LMGeocoder_Tests/Pods-LMGeocoder_Tests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/LMGeocoder" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/LMGeocoder/LMGeocoder.framework/Headers" 4 | OTHER_LDFLAGS = $(inherited) -framework "LMGeocoder" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-LMGeocoder_Tests/Pods-LMGeocoder_Tests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_LMGeocoder_Tests { 2 | umbrella header "Pods-LMGeocoder_Tests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-LMGeocoder_Tests/Pods-LMGeocoder_Tests.release.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/LMGeocoder" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/LMGeocoder/LMGeocoder.framework/Headers" 4 | OTHER_LDFLAGS = $(inherited) -framework "LMGeocoder" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | -------------------------------------------------------------------------------- /Example/Tests/Tests-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 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Example/Tests/Tests-Prefix.pch: -------------------------------------------------------------------------------- 1 | // The contents of this file are implicitly included at the beginning of every test case source file. 2 | 3 | #ifdef __OBJC__ 4 | 5 | 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /Example/Tests/Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // LMGeocoderTests.m 3 | // LMGeocoderTests 4 | // 5 | // Created by LMinh on 03/02/2019. 6 | // Copyright (c) 2019 LMinh. All rights reserved. 7 | // 8 | 9 | @import XCTest; 10 | 11 | @interface Tests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation Tests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | 36 | -------------------------------------------------------------------------------- /Example/Tests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019 LMinh 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /LMGeocoder.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'LMGeocoder' 3 | s.version = '1.1.0' 4 | s.summary = 'Simple wrapper for geocoding and reverse geocoding, using both Google Geocoding API and Apple iOS Geocoding Framework.' 5 | s.description = <<-DESC 6 | Simple wrapper for geocoding and reverse geocoding, written in Objective-C, using both Google Geocoding API and Apple iOS Geocoding Framework. 7 | DESC 8 | 9 | s.homepage = 'https://github.com/lminhtm/LMGeocoder' 10 | s.screenshots = 'https://raw.github.com/lminhtm/LMGeocoder/master/Screenshots/screenshot.png' 11 | s.license = { :type => 'MIT', :file => 'LICENSE' } 12 | s.author = { 'LMinh' => 'lminhtm@gmail.com' } 13 | s.source = { :git => 'https://github.com/lminhtm/LMGeocoder.git', :tag => s.version.to_s } 14 | 15 | s.ios.deployment_target = '8.0' 16 | 17 | s.source_files = 'LMGeocoder/Classes/**/*' 18 | # s.public_header_files = 'Pod/Classes/**/*.h' 19 | # s.frameworks = 'UIKit', 'MapKit' 20 | # s.dependency 'AFNetworking', '~> 2.3' 21 | end 22 | -------------------------------------------------------------------------------- /LMGeocoder/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lminhtm/LMGeocoder/20db5f27fb12c3a2726c2355b1476ae7c9c3db42/LMGeocoder/Assets/.gitkeep -------------------------------------------------------------------------------- /LMGeocoder/Classes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lminhtm/LMGeocoder/20db5f27fb12c3a2726c2355b1476ae7c9c3db42/LMGeocoder/Classes/.gitkeep -------------------------------------------------------------------------------- /LMGeocoder/Classes/LMAddress.h: -------------------------------------------------------------------------------- 1 | // 2 | // LMAddress.h 3 | // LMGeocoder 4 | // 5 | // Created by LMinh on 31/05/2014. 6 | // Copyright (c) 2014 LMinh. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | /** 13 | A result from a reverse geocode request, containing a human-readable address. 14 | Some of the fields may be nil, indicating they are not present. 15 | */ 16 | @interface LMAddress : NSObject 17 | 18 | /** 19 | The location coordinate 20 | */ 21 | @property (nonatomic, readonly, assign) CLLocationCoordinate2D coordinate; 22 | 23 | /** 24 | The precise street address. 25 | */ 26 | @property (nonatomic, readonly, copy, nullable) NSString *streetNumber; 27 | 28 | /** 29 | The named route. 30 | */ 31 | @property (nonatomic, readonly, copy, nullable) NSString *route; 32 | 33 | /** 34 | The incorporated city or town political entity. 35 | */ 36 | @property (nonatomic, readonly, copy, nullable) NSString *locality; 37 | 38 | /** 39 | The first-order civil entity below a localit. 40 | */ 41 | @property (nonatomic, readonly, copy, nullable) NSString *subLocality; 42 | 43 | /** 44 | The civil entity below the country level. 45 | */ 46 | @property (nonatomic, readonly, copy, nullable) NSString *administrativeArea; 47 | 48 | /** 49 | The additional administrative area information. 50 | */ 51 | @property (nonatomic, readonly, copy, nullable) NSString *subAdministrativeArea; 52 | 53 | /** 54 | The neighborhood information. 55 | */ 56 | @property (nonatomic, readonly, copy, nullable) NSString *neighborhood; 57 | 58 | /** 59 | The Postal/Zip code. 60 | */ 61 | @property (nonatomic, readonly, copy, nullable) NSString *postalCode; 62 | 63 | /** 64 | The country name. 65 | */ 66 | @property (nonatomic, readonly, copy, nullable) NSString *country; 67 | 68 | /** 69 | The ISO country code. 70 | */ 71 | @property (nonatomic, readonly, copy, nullable) NSString *ISOcountryCode; 72 | 73 | /** 74 | The formatted address. 75 | */ 76 | @property (nonatomic, readonly, copy, nullable) NSString *formattedAddress; 77 | 78 | /** 79 | An array of NSString containing formatted lines of the address. 80 | */ 81 | @property (nonatomic, readonly, copy, nullable) NSArray *lines; 82 | 83 | /** 84 | Raw source object. 85 | */ 86 | @property (nonatomic, readonly, strong, nullable) NSObject *rawSource; 87 | 88 | /** 89 | Initialize with response from server 90 | 91 | @param locationData response object recieved from server 92 | @param serviceType pass here LMGeocoderServiceGoogle or LMGeocoderServiceApple 93 | @return object with all data set for use 94 | */ 95 | - (nonnull id)initWithLocationData:(nonnull id)locationData serviceType:(int)serviceType; 96 | 97 | @end 98 | -------------------------------------------------------------------------------- /LMGeocoder/Classes/LMAddress.m: -------------------------------------------------------------------------------- 1 | // 2 | // LMAddress.m 3 | // LMGeocoder 4 | // 5 | // Created by LMinh on 31/05/2014. 6 | // Copyright (c) 2014 LMinh. All rights reserved. 7 | // 8 | 9 | #import "LMAddress.h" 10 | #import "LMGeocoder.h" 11 | 12 | static NSString * const LMLatitudeKey = @"latitude"; 13 | static NSString * const LMLongitudeKey = @"longitude"; 14 | static NSString * const LMStreetNumberKey = @"streetNumber"; 15 | static NSString * const LMRouteKey = @"route"; 16 | static NSString * const LMLocalityKey = @"locality"; 17 | static NSString * const LMSubLocalityKey = @"subLocality"; 18 | static NSString * const LMAdministrativeAreaKey = @"administrativeArea"; 19 | static NSString * const LMSubAdministrativeAreaKey = @"subAdministrativeArea"; 20 | static NSString * const LMNeighborhoodKey = @"neighborhood"; 21 | static NSString * const LMPostalCodeKey = @"postalCode"; 22 | static NSString * const LMCountryKey = @"country"; 23 | static NSString * const LMISOCountryCodeKey = @"ISOcountryCode"; 24 | static NSString * const LMFormattedAddressKey = @"formattedAddress"; 25 | static NSString * const LMLinesKey = @"lines"; 26 | 27 | #define allStringKeys @[LMStreetNumberKey, LMRouteKey, LMLocalityKey, LMSubLocalityKey, \ 28 | LMAdministrativeAreaKey, LMSubAdministrativeAreaKey, LMNeighborhoodKey, LMPostalCodeKey, \ 29 | LMCountryKey, LMISOCountryCodeKey, LMFormattedAddressKey] 30 | 31 | @implementation LMAddress 32 | 33 | @synthesize coordinate = _coordinate; 34 | @synthesize streetNumber = _streetNumber; 35 | @synthesize route = _route; 36 | @synthesize locality = _locality; 37 | @synthesize subLocality = _subLocality; 38 | @synthesize administrativeArea = _administrativeArea; 39 | @synthesize subAdministrativeArea = _subAdministrativeArea; 40 | @synthesize neighborhood = _neighborhood; 41 | @synthesize postalCode = _postalCode; 42 | @synthesize country = _country; 43 | @synthesize ISOcountryCode = _ISOcountryCode; 44 | @synthesize formattedAddress = _formattedAddress; 45 | @synthesize lines = _lines; 46 | @synthesize rawSource = _rawSource; 47 | 48 | #pragma mark - INIT 49 | 50 | - (id)initWithLocationData:(id)locationData serviceType:(int)serviceType 51 | { 52 | self = [self init]; 53 | if (self) { 54 | switch (serviceType) { 55 | case LMGeocoderServiceApple: 56 | [self parseAppleResponse:locationData]; 57 | break; 58 | case LMGeocoderServiceGoogle: 59 | [self parseGoogleResponse:locationData]; 60 | break; 61 | default: 62 | break; 63 | } 64 | } 65 | return self; 66 | } 67 | 68 | 69 | #pragma mark - SUPPORT 70 | 71 | - (void)parseAppleResponse:(id)locationData 72 | { 73 | if (!locationData || ![locationData isKindOfClass:[CLPlacemark class]]) { 74 | return; 75 | } 76 | CLPlacemark *placemark = (CLPlacemark *)locationData; 77 | NSArray *lines = placemark.addressDictionary[@"FormattedAddressLines"]; 78 | NSString *formattedAddress = [lines componentsJoinedByString:@", "]; 79 | 80 | _coordinate = placemark.location.coordinate; 81 | _streetNumber = placemark.thoroughfare; 82 | _locality = placemark.locality; 83 | _subLocality = placemark.subLocality; 84 | _administrativeArea = placemark.administrativeArea; 85 | _subAdministrativeArea = placemark.subAdministrativeArea; 86 | _postalCode = placemark.postalCode; 87 | _country = placemark.country; 88 | _ISOcountryCode = placemark.ISOcountryCode; 89 | _formattedAddress = formattedAddress; 90 | _lines = lines; 91 | _rawSource = placemark; 92 | } 93 | 94 | - (void)parseGoogleResponse:(id)locationData 95 | { 96 | if (!locationData || ![locationData isKindOfClass:[NSDictionary class]]) { 97 | return; 98 | } 99 | NSDictionary *locationDict = (NSDictionary *)locationData; 100 | 101 | NSArray *addressComponents = locationDict[@"address_components"]; 102 | NSString *formattedAddress = locationDict[@"formatted_address"]; 103 | double lat = [locationDict[@"geometry"][@"location"][@"lat"] doubleValue]; 104 | double lng = [locationDict[@"geometry"][@"location"][@"lng"] doubleValue]; 105 | 106 | _coordinate = CLLocationCoordinate2DMake(lat, lng); 107 | _streetNumber = [self component:@"street_number" inArray:addressComponents ofType:@"long_name"]; 108 | _route = [self component:@"route" inArray:addressComponents ofType:@"long_name"]; 109 | _locality = [self component:@"locality" inArray:addressComponents ofType:@"long_name"]; 110 | _subLocality = [self component:@"sublocality" inArray:addressComponents ofType:@"long_name"]; 111 | _administrativeArea = [self component:@"administrative_area_level_1" inArray:addressComponents ofType:@"long_name"]; 112 | _subAdministrativeArea = [self component:@"administrative_area_level_2" inArray:addressComponents ofType:@"long_name"]; 113 | _neighborhood = [self component:@"neighborhood" inArray:addressComponents ofType:@"long_name"]; 114 | _postalCode = [self component:@"postal_code" inArray:addressComponents ofType:@"short_name"]; 115 | _country = [self component:@"country" inArray:addressComponents ofType:@"long_name"]; 116 | _ISOcountryCode = [self component:@"country" inArray:addressComponents ofType:@"short_name"]; 117 | _formattedAddress = formattedAddress; 118 | _lines = [formattedAddress componentsSeparatedByString:@", "]; 119 | _rawSource = locationDict; 120 | } 121 | 122 | - (NSString *)component:(NSString *)component inArray:(NSArray *)array ofType:(NSString *)type 123 | { 124 | NSInteger index = [array indexOfObjectPassingTest:^(id obj, NSUInteger idx, BOOL *stop) { 125 | 126 | NSArray *types = [obj objectForKey:@"types"]; 127 | if (types.count) { 128 | return [types containsObject:component]; 129 | } 130 | return NO; 131 | }]; 132 | 133 | if (index == NSNotFound || index >= array.count) { 134 | return nil; 135 | } 136 | 137 | return [[array objectAtIndex:index] valueForKey:type]; 138 | } 139 | 140 | 141 | #pragma mark - EQUALITY 142 | 143 | - (BOOL)isEqual:(id)object 144 | { 145 | BOOL equal = [super isEqual:object]; 146 | if (equal) { 147 | return YES; 148 | } 149 | if (![object isKindOfClass:[self class]]) { 150 | return NO; 151 | } 152 | 153 | LMAddress *other = object; 154 | 155 | // Lat/Long 156 | equal = (self.coordinate.latitude == other.coordinate.latitude); 157 | equal &= (self.coordinate.longitude == other.coordinate.longitude); 158 | 159 | // String values 160 | for (NSString *key in allStringKeys) { 161 | equal &= [[self valueForKey:key] isEqual:[other valueForKey:key]]; 162 | } 163 | 164 | // Lines 165 | equal &= [self.lines isEqualToArray:other.lines]; 166 | 167 | return equal; 168 | } 169 | 170 | - (NSUInteger)hash 171 | { 172 | // Should be enough to hash-table well 173 | NSUInteger hashValue = 1; 174 | hashValue += floor(self.coordinate.latitude) + floor(self.coordinate.longitude); 175 | hashValue += self.formattedAddress.hash; 176 | return hashValue; 177 | } 178 | 179 | 180 | #pragma mark - NSCODING 181 | 182 | - (id)initWithCoder:(NSCoder *)aDecoder 183 | { 184 | self = [self init]; 185 | if (self) 186 | { 187 | // Load doubles into coordinate 188 | _coordinate = CLLocationCoordinate2DMake([aDecoder decodeDoubleForKey:LMLatitudeKey], [aDecoder decodeDoubleForKey:LMLongitudeKey]); 189 | 190 | // Load the strings into properties by name 191 | for (NSString *key in allStringKeys) { 192 | [self setValue:[aDecoder decodeObjectForKey:key] forKey:key]; 193 | } 194 | 195 | // Load lines array 196 | _lines = [aDecoder decodeObjectForKey:LMLinesKey]; 197 | } 198 | return self; 199 | } 200 | 201 | - (void)encodeWithCoder:(NSCoder *)aCoder 202 | { 203 | // Double 204 | [aCoder encodeDouble:self.coordinate.latitude forKey:LMLatitudeKey]; 205 | [aCoder encodeDouble:self.coordinate.longitude forKey:LMLongitudeKey]; 206 | 207 | // String 208 | for (NSString *key in allStringKeys) { 209 | [aCoder encodeObject:[self valueForKey:key] forKey:key]; 210 | } 211 | 212 | // Array 213 | [aCoder encodeObject:self.lines forKey:LMLinesKey]; 214 | } 215 | 216 | 217 | #pragma mark - NSCOPYING 218 | 219 | - (id)copyWithZone:(NSZone *)zone 220 | { 221 | return [NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:self]]; 222 | } 223 | 224 | @end 225 | -------------------------------------------------------------------------------- /LMGeocoder/Classes/LMGeocoder.h: -------------------------------------------------------------------------------- 1 | // 2 | // LMGeocoder.h 3 | // LMGeocoder 4 | // 5 | // Created by LMinh on 31/05/2014. 6 | // Copyright (c) 2014 LMinh. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "LMAddress.h" 12 | #import "LMGeocodingOperation.h" 13 | 14 | NS_ASSUME_NONNULL_BEGIN 15 | 16 | /** 17 | * Exposes a service for geocoding and reverse geocoding. 18 | */ 19 | @interface LMGeocoder : NSObject 20 | 21 | /** 22 | * Indicating whether the receiver is in the middle of geocoding its value. 23 | */ 24 | @property (nonatomic, assign, readonly) BOOL isGeocoding; 25 | 26 | /** 27 | * To set google API key 28 | */ 29 | @property (nonatomic, strong, nullable) NSString *googleAPIKey; 30 | 31 | /** 32 | * Get shared instance. 33 | */ 34 | + (LMGeocoder *)sharedInstance; 35 | 36 | /** 37 | * Submits a forward-geocoding request using the specified string. 38 | * After initiating a forward-geocoding request, do not attempt to initiate another forward- or reverse-geocoding request. 39 | * Geocoding requests are rate-limited for each app, so making too many requests in a short period of time may cause some of the requests to fail. 40 | * When the maximum rate is exceeded, the geocoder passes an error object to your completion handler. 41 | * 42 | * @param addressString The string describing the location you want to look up. 43 | * @param service The service API used to geocode. 44 | * @param alternativeService The service API will be used if service API failed. LMGeocoderServiceUndefined means no alternative. 45 | * @param completionHandler The callback to invoke with the geocode results. The callback will be invoked asynchronously from the main thread. 46 | */ 47 | - (void)geocodeAddressString:(NSString *)addressString 48 | service:(LMGeocoderService)service 49 | alternativeService:(LMGeocoderService)alternativeService 50 | completionHandler:(nullable LMGeocodeCallback)completionHandler; 51 | 52 | /** 53 | * Submits a reverse-geocoding request for the specified coordinate. 54 | * After initiating a reverse-geocoding request, do not attempt to initiate another reverse- or forward-geocoding request. 55 | * Geocoding requests are rate-limited for each app, so making too many requests in a short period of time may cause some of the requests to fail. 56 | * When the maximum rate is exceeded, the geocoder passes an error object to your completion handler. 57 | * 58 | * @param coordinate The coordinate to look up. 59 | * @param service The service API used to reverse geocode. 60 | * @param alternativeService The service API will be used if service API failed. LMGeocoderServiceUndefined means no alternative. 61 | * @param completionHandler The callback to invoke with the reverse geocode results. The callback will be invoked asynchronously from the main thread. 62 | */ 63 | - (void)reverseGeocodeCoordinate:(CLLocationCoordinate2D)coordinate 64 | service:(LMGeocoderService)service 65 | alternativeService:(LMGeocoderService)alternativeService 66 | completionHandler:(nullable LMGeocodeCallback)completionHandler; 67 | 68 | /** 69 | * Cancels a pending geocoding request. 70 | */ 71 | - (void)cancelGeocode; 72 | 73 | @end 74 | 75 | NS_ASSUME_NONNULL_END 76 | -------------------------------------------------------------------------------- /LMGeocoder/Classes/LMGeocoder.m: -------------------------------------------------------------------------------- 1 | // 2 | // LMGeocoder.m 3 | // LMGeocoder 4 | // 5 | // Created by LMinh on 31/05/2014. 6 | // Copyright (c) 2014 LMinh. All rights reserved. 7 | // 8 | 9 | #import "LMGeocoder.h" 10 | 11 | @interface LMGeocoder () 12 | 13 | @property (nonatomic, strong) NSOperationQueue *operationQueue; 14 | 15 | @end 16 | 17 | @implementation LMGeocoder 18 | 19 | #pragma mark - INIT 20 | 21 | + (LMGeocoder *)sharedInstance 22 | { 23 | static LMGeocoder *sharedInstance = nil; 24 | static dispatch_once_t onceToken; 25 | dispatch_once(&onceToken, ^{ 26 | sharedInstance = [[LMGeocoder alloc] init]; 27 | }); 28 | return sharedInstance; 29 | } 30 | 31 | - (id)init 32 | { 33 | self = [super init]; 34 | if (self != nil) { 35 | _operationQueue = [NSOperationQueue new]; 36 | _operationQueue.maxConcurrentOperationCount = 1; 37 | } 38 | return self; 39 | } 40 | 41 | - (BOOL)isGeocoding 42 | { 43 | return self.operationQueue.operationCount > 0; 44 | } 45 | 46 | 47 | #pragma mark - GEOCODE 48 | 49 | - (void)geocodeAddressString:(NSString *)addressString 50 | service:(LMGeocoderService)service 51 | alternativeService:(LMGeocoderService)alternativeService 52 | completionHandler:(LMGeocodeCallback)completionHandler 53 | { 54 | [self.operationQueue cancelAllOperations]; 55 | 56 | LMGeocodingOperation *operation = [LMGeocodingOperation new]; 57 | operation.addressString = addressString; 58 | operation.service = service; 59 | operation.alternativeService = alternativeService; 60 | operation.googleAPIKey = self.googleAPIKey; 61 | operation.completionHandler = completionHandler; 62 | [self.operationQueue addOperation:operation]; 63 | } 64 | 65 | 66 | #pragma mark - REVERSE GEOCODE 67 | 68 | - (void)reverseGeocodeCoordinate:(CLLocationCoordinate2D)coordinate 69 | service:(LMGeocoderService)service 70 | alternativeService:(LMGeocoderService)alternativeService 71 | completionHandler:(LMGeocodeCallback)completionHandler 72 | { 73 | [self.operationQueue cancelAllOperations]; 74 | 75 | LMGeocodingOperation *operation = [LMGeocodingOperation new]; 76 | operation.coordinate = coordinate; 77 | operation.isReverseGeocoding = YES; 78 | operation.service = service; 79 | operation.alternativeService = alternativeService; 80 | operation.googleAPIKey = self.googleAPIKey; 81 | operation.completionHandler = completionHandler; 82 | [self.operationQueue addOperation:operation]; 83 | } 84 | 85 | 86 | #pragma mark - CANCEL 87 | 88 | - (void)cancelGeocode 89 | { 90 | [self.operationQueue cancelAllOperations]; 91 | } 92 | 93 | @end 94 | -------------------------------------------------------------------------------- /LMGeocoder/Classes/LMGeocodingOperation.h: -------------------------------------------------------------------------------- 1 | // 2 | // LMGeocodingOperation.h 3 | // LMGeocoder 4 | // 5 | // Created by LMinh on 8/24/19. 6 | // 7 | 8 | #import 9 | #import 10 | #import "LMAddress.h" 11 | 12 | /** 13 | * LMGeocoder service API. 14 | */ 15 | typedef enum : NSUInteger { 16 | LMGeocoderServiceUndefined, 17 | LMGeocoderServiceGoogle, 18 | LMGeocoderServiceApple, 19 | } LMGeocoderService; 20 | 21 | /** 22 | * LMGeocoder error codes, embedded in NSError. 23 | */ 24 | typedef enum : NSUInteger { 25 | LMGeocoderErrorCodeInvalidCoordinate, 26 | LMGeocoderErrorCodeInvalidAddressString, 27 | LMGeocoderErrorCodeInternal, 28 | } LMGeocoderErrorCode; 29 | 30 | /** 31 | * Handler that reports a geocoding response, or error. 32 | */ 33 | typedef void (^LMGeocodeCallback) (NSArray * _Nullable results, NSError * _Nullable error); 34 | 35 | NS_ASSUME_NONNULL_BEGIN 36 | 37 | @interface LMGeocodingOperation : NSOperation 38 | 39 | @property (nonatomic, copy) NSString *addressString; 40 | @property (nonatomic, assign) CLLocationCoordinate2D coordinate; 41 | @property (nonatomic, assign) BOOL isReverseGeocoding; 42 | @property (nonatomic, assign) LMGeocoderService service; 43 | @property (nonatomic, assign) LMGeocoderService alternativeService; 44 | @property (nonatomic, strong, nullable) NSString *googleAPIKey; 45 | @property (nonatomic, copy, nullable) LMGeocodeCallback completionHandler; 46 | 47 | @end 48 | 49 | NS_ASSUME_NONNULL_END 50 | -------------------------------------------------------------------------------- /LMGeocoder/Classes/LMGeocodingOperation.m: -------------------------------------------------------------------------------- 1 | // 2 | // LMGeocodingOperation.m 3 | // LMGeocoder 4 | // 5 | // Created by LMinh on 8/24/19. 6 | // 7 | 8 | #import "LMGeocodingOperation.h" 9 | #import "LMAddress.h" 10 | 11 | static NSString * const LMGeocoderErrorDomain = @"LMGeocoderError"; 12 | 13 | #define kGoogleAPIReverseGeocodingURL(lat, lng) [NSString stringWithFormat:@"https://maps.googleapis.com/maps/api/geocode/json?latlng=%f,%f&sensor=true", lat, lng]; 14 | #define kGoogleAPIGeocodingURL(address) [NSString stringWithFormat:@"https://maps.googleapis.com/maps/api/geocode/json?address=%@&sensor=true", address]; 15 | #define kGoogleAPIURLWithKey(url, key) [NSString stringWithFormat:@"%@&key=%@", url, key]; 16 | 17 | @interface LMGeocodingOperation () 18 | 19 | @property (nonatomic, strong) CLGeocoder *appleGeocoder; 20 | @property (nonatomic, strong) NSURLSessionDataTask *googleGeocoderTask; 21 | 22 | @end 23 | 24 | @implementation LMGeocodingOperation 25 | 26 | @synthesize ready = _ready; 27 | @synthesize executing = _executing; 28 | @synthesize finished = _finished; 29 | 30 | #pragma mark - INIT 31 | 32 | - (instancetype)init 33 | { 34 | self = [super init]; 35 | if (self) { 36 | _appleGeocoder = [[CLGeocoder alloc] init]; 37 | _ready = YES; 38 | } 39 | return self; 40 | } 41 | 42 | 43 | #pragma mark - STATE 44 | 45 | - (void)setReady:(BOOL)ready 46 | { 47 | if (_ready != ready) 48 | { 49 | [self willChangeValueForKey:NSStringFromSelector(@selector(isReady))]; 50 | _ready = ready; 51 | [self didChangeValueForKey:NSStringFromSelector(@selector(isReady))]; 52 | } 53 | } 54 | 55 | - (BOOL)isReady 56 | { 57 | return _ready; 58 | } 59 | 60 | - (void)setExecuting:(BOOL)executing 61 | { 62 | if (_executing != executing) 63 | { 64 | [self willChangeValueForKey:NSStringFromSelector(@selector(isExecuting))]; 65 | _executing = executing; 66 | [self didChangeValueForKey:NSStringFromSelector(@selector(isExecuting))]; 67 | } 68 | } 69 | 70 | - (BOOL)isExecuting 71 | { 72 | return _executing; 73 | } 74 | 75 | - (void)setFinished:(BOOL)finished 76 | { 77 | if (_finished != finished) 78 | { 79 | [self willChangeValueForKey:NSStringFromSelector(@selector(isFinished))]; 80 | _finished = finished; 81 | [self didChangeValueForKey:NSStringFromSelector(@selector(isFinished))]; 82 | } 83 | } 84 | 85 | - (BOOL)isFinished 86 | { 87 | return _finished; 88 | } 89 | 90 | - (BOOL)isAsynchronous 91 | { 92 | return YES; 93 | } 94 | 95 | 96 | #pragma mark - CONTROL 97 | 98 | - (void)completeOperation 99 | { 100 | if (self.executing) { 101 | self.executing = NO; 102 | self.finished = YES; 103 | } 104 | } 105 | 106 | - (void)cancel 107 | { 108 | [super cancel]; 109 | 110 | if (self.appleGeocoder) { 111 | [self.appleGeocoder cancelGeocode]; 112 | } 113 | 114 | if (self.googleGeocoderTask) { 115 | [self.googleGeocoderTask cancel]; 116 | } 117 | 118 | [self completeOperation]; 119 | } 120 | 121 | - (void)start 122 | { 123 | if (!self.isExecuting) { 124 | self.ready = NO; 125 | self.executing = YES; 126 | self.finished = NO; 127 | } 128 | 129 | if (self.isReverseGeocoding) { 130 | [self reverseGeocodeCoordinate:self.coordinate 131 | service:self.service 132 | alternativeService:self.alternativeService 133 | completionHandler:self.completionHandler]; 134 | } 135 | else { 136 | [self geocodeAddressString:self.addressString 137 | service:self.service 138 | alternativeService:self.alternativeService 139 | completionHandler:self.completionHandler]; 140 | } 141 | } 142 | 143 | 144 | #pragma mark - GEOCODE 145 | 146 | - (void)geocodeAddressString:(NSString *)addressString 147 | service:(LMGeocoderService)service 148 | alternativeService:(LMGeocoderService)alternativeService 149 | completionHandler:(LMGeocodeCallback)completionHandler 150 | { 151 | // Check address string 152 | if (addressString == nil || addressString.length == 0) 153 | { 154 | // Invalid address string --> Return error 155 | NSError *error = [NSError errorWithDomain:LMGeocoderErrorDomain 156 | code:LMGeocoderErrorCodeInvalidAddressString 157 | userInfo:nil]; 158 | if (self.completionHandler && !self.isCancelled) { 159 | self.completionHandler(nil, error); 160 | } 161 | 162 | // Finish 163 | [self completeOperation]; 164 | } 165 | else 166 | { 167 | // Valid address string --> Check service 168 | if (service == LMGeocoderServiceGoogle) 169 | { 170 | // Geocode using Google service 171 | NSString *urlString = kGoogleAPIGeocodingURL(addressString); 172 | if (self.googleAPIKey != nil) { 173 | urlString = kGoogleAPIURLWithKey(urlString, self.googleAPIKey) 174 | } 175 | [self buildAsynchronousRequestFromURLString:urlString 176 | completionHandler:^(NSArray *results, NSError *error) { 177 | 178 | if (error 179 | && !results 180 | && alternativeService != LMGeocoderServiceUndefined 181 | && !self.isCancelled) { 182 | // Retry with alternativeService 183 | [self geocodeAddressString:addressString 184 | service:alternativeService 185 | alternativeService:LMGeocoderServiceUndefined 186 | completionHandler:completionHandler]; 187 | } 188 | else { 189 | // Return 190 | dispatch_async(dispatch_get_main_queue(), ^{ 191 | if (completionHandler && !self.isCancelled) { 192 | completionHandler(results, error); 193 | } 194 | }); 195 | 196 | // Finish 197 | [self completeOperation]; 198 | } 199 | }]; 200 | } 201 | else if (service == LMGeocoderServiceApple) 202 | { 203 | // Geocode using Apple service 204 | [self.appleGeocoder geocodeAddressString:addressString 205 | completionHandler:^(NSArray *placemarks, NSError *error) { 206 | 207 | if (error 208 | && !placemarks 209 | && alternativeService != LMGeocoderServiceUndefined 210 | && !self.isCancelled) { 211 | // Retry with alternativeService 212 | [self geocodeAddressString:addressString 213 | service:alternativeService 214 | alternativeService:LMGeocoderServiceUndefined 215 | completionHandler:completionHandler]; 216 | } 217 | else { 218 | // Return 219 | dispatch_async(dispatch_get_main_queue(), ^{ 220 | NSArray *results = [self parseGeocodingResponseResults:placemarks 221 | service:LMGeocoderServiceApple]; 222 | if (completionHandler && !self.isCancelled) { 223 | completionHandler(results, error); 224 | } 225 | }); 226 | 227 | // Finish 228 | [self completeOperation]; 229 | } 230 | }]; 231 | } 232 | } 233 | } 234 | 235 | 236 | #pragma mark - REVERSE GEOCODE 237 | 238 | - (void)reverseGeocodeCoordinate:(CLLocationCoordinate2D)coordinate 239 | service:(LMGeocoderService)service 240 | alternativeService:(LMGeocoderService)alternativeService 241 | completionHandler:(LMGeocodeCallback)completionHandler 242 | { 243 | // Check location coordinate 244 | if (!CLLocationCoordinate2DIsValid(coordinate)) 245 | { 246 | // Invalid location coordinate --> Return error 247 | NSError *error = [NSError errorWithDomain:LMGeocoderErrorDomain 248 | code:LMGeocoderErrorCodeInvalidCoordinate 249 | userInfo:nil]; 250 | if (completionHandler && !self.isCancelled) { 251 | completionHandler(nil, error); 252 | } 253 | 254 | // Finish 255 | [self completeOperation]; 256 | } 257 | else 258 | { 259 | // Valid location coordinate --> Check service 260 | if (service == LMGeocoderServiceGoogle) 261 | { 262 | // Reverse geocode using Google service 263 | NSString *urlString = kGoogleAPIReverseGeocodingURL(coordinate.latitude, coordinate.longitude); 264 | if (self.googleAPIKey != nil) { 265 | urlString = kGoogleAPIURLWithKey(urlString, self.googleAPIKey) 266 | } 267 | [self buildAsynchronousRequestFromURLString:urlString 268 | completionHandler:^(NSArray *results, NSError *error) { 269 | 270 | if (error 271 | && !results 272 | && alternativeService != LMGeocoderServiceUndefined 273 | && !self.isCancelled) { 274 | // Retry with alternativeService 275 | [self reverseGeocodeCoordinate:coordinate 276 | service:alternativeService 277 | alternativeService:LMGeocoderServiceUndefined 278 | completionHandler:completionHandler]; 279 | } 280 | else { 281 | // Return 282 | dispatch_async(dispatch_get_main_queue(), ^{ 283 | if (completionHandler && !self.isCancelled) { 284 | completionHandler(results, error); 285 | } 286 | }); 287 | 288 | // Finish 289 | [self completeOperation]; 290 | } 291 | }]; 292 | } 293 | else if (service == LMGeocoderServiceApple) 294 | { 295 | // Reverse geocode using Apple service 296 | CLLocation *location = [[CLLocation alloc] initWithLatitude:coordinate.latitude 297 | longitude:coordinate.longitude]; 298 | [self.appleGeocoder reverseGeocodeLocation:location 299 | completionHandler:^(NSArray *placemarks, NSError *error) { 300 | 301 | if (error 302 | && !placemarks 303 | && alternativeService != LMGeocoderServiceUndefined 304 | && !self.isCancelled) { 305 | // Retry with alternativeService 306 | [self reverseGeocodeCoordinate:coordinate 307 | service:alternativeService 308 | alternativeService:LMGeocoderServiceUndefined 309 | completionHandler:completionHandler]; 310 | } 311 | else { 312 | // Return 313 | dispatch_async(dispatch_get_main_queue(), ^{ 314 | NSArray *results = [self parseGeocodingResponseResults:placemarks 315 | service:LMGeocoderServiceApple]; 316 | if (completionHandler && !self.isCancelled) { 317 | completionHandler(results, error); 318 | } 319 | }); 320 | 321 | // Finish 322 | [self completeOperation]; 323 | } 324 | }]; 325 | } 326 | } 327 | } 328 | 329 | 330 | #pragma mark - CONNECTION STUFF 331 | 332 | - (void)buildAsynchronousRequestFromURLString:(NSString *)urlString 333 | completionHandler:(LMGeocodeCallback)handler 334 | { 335 | urlString = [urlString stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]]; 336 | NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:urlString]]; 337 | 338 | NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration]; 339 | NSURLSession *session = [NSURLSession sessionWithConfiguration:configuration]; 340 | self.googleGeocoderTask = [session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { 341 | 342 | if (!error && data) 343 | { 344 | // Request successful --> Parse response to JSON 345 | NSError *parsingError = nil; 346 | NSDictionary *result = [NSJSONSerialization JSONObjectWithData:data 347 | options:NSJSONReadingAllowFragments 348 | error:&parsingError]; 349 | if (!parsingError && result) 350 | { 351 | // Parse successful --> Check status value 352 | NSString *status = [result valueForKey:@"status"]; 353 | if ([status isEqualToString:@"OK"]) 354 | { 355 | // Status OK --> Parse response results 356 | NSArray *locationDicts = [result objectForKey:@"results"]; 357 | NSArray *finalResults = [self parseGeocodingResponseResults:locationDicts 358 | service:LMGeocoderServiceGoogle]; 359 | 360 | if (handler) { 361 | handler(finalResults, nil); 362 | } 363 | } 364 | else 365 | { 366 | // Other statuses --> Return error 367 | NSError *error = [NSError errorWithDomain:LMGeocoderErrorDomain 368 | code:LMGeocoderErrorCodeInternal 369 | userInfo:nil]; 370 | if (handler) { 371 | handler(nil, error); 372 | } 373 | } 374 | } 375 | else 376 | { 377 | // Parse failed --> Return error 378 | if (handler) { 379 | handler(nil, parsingError); 380 | } 381 | } 382 | } 383 | else 384 | { 385 | // Request failed --> Return error 386 | if (handler) { 387 | handler(nil, error); 388 | } 389 | } 390 | }]; 391 | [self.googleGeocoderTask resume]; 392 | } 393 | 394 | 395 | #pragma mark - PARSE RESULT DATA 396 | 397 | - (NSArray *)parseGeocodingResponseResults:(NSArray *)responseResults service:(LMGeocoderService)service 398 | { 399 | NSMutableArray *finalResults = [NSMutableArray new]; 400 | 401 | for (id responseResult in responseResults) { 402 | LMAddress *address = [[LMAddress alloc] initWithLocationData:responseResult serviceType:service]; 403 | [finalResults addObject:address]; 404 | } 405 | 406 | return finalResults; 407 | } 408 | 409 | @end 410 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LMGeocoder 2 | LMGeocoder is a simple wrapper for geocoding and reverse geocoding, using both Google Geocoding API and Apple iOS Geocoding Framework. 3 | 4 | [![CI Status](https://img.shields.io/travis/LMinh/LMGeocoder.svg?style=flat)](https://travis-ci.org/LMinh/LMGeocoder) 5 | [![Version](https://img.shields.io/cocoapods/v/LMGeocoder.svg?style=flat)](https://cocoapods.org/pods/LMGeocoder) 6 | [![License](https://img.shields.io/cocoapods/l/LMGeocoder.svg?style=flat)](https://cocoapods.org/pods/LMGeocoder) 7 | [![Platform](https://img.shields.io/cocoapods/p/LMGeocoder.svg?style=flat)](https://cocoapods.org/pods/LMGeocoder) 8 | 9 | ![](https://raw.github.com/lminhtm/LMGeocoder/master/Screenshots/screenshot.png) 10 | 11 | ## Features 12 | * Wrapper for Geocoding and Reverse geocoding with blocked-based coding. 13 | * Use both Google Geocoding API and Apple iOS Geocoding Framework. 14 | 15 | ## Requirements 16 | iOS 8.0 or higher 17 | 18 | ## Installation 19 | LMGeocoder is available through [CocoaPods](https://cocoapods.org). To install 20 | it, simply add the following line to your Podfile: 21 | 22 | ```ruby 23 | pod 'LMGeocoder' 24 | ``` 25 | 26 | ## Swift Version 27 | https://github.com/lminhtm/LMGeocoderSwift 28 | 29 | ## Usage 30 | #### Geocoding 31 | ```ObjC 32 | [[LMGeocoder sharedInstance] geocodeAddressString:addressString 33 | service:LMGeocoderServiceGoogle 34 | alternativeService:LMGeocoderServiceApple 35 | completionHandler:^(NSArray *results, NSError *error) { 36 | if (results.count && !error) { 37 | LMAddress *address = [results firstObject]; 38 | NSLog(@"Coordinate: (%f, %f)", address.coordinate.latitude, address.coordinate.longitude); 39 | } 40 | }]; 41 | ``` 42 | 43 | #### Reverse Geocoding 44 | ```ObjC 45 | [[LMGeocoder sharedInstance] reverseGeocodeCoordinate:coordinate 46 | service:LMGeocoderServiceGoogle 47 | alternativeService:LMGeocoderServiceApple 48 | completionHandler:^(NSArray *results, NSError *error) { 49 | if (results.count && !error) { 50 | LMAddress *address = [results firstObject]; 51 | NSLog(@"Address: %@", address.formattedAddress); 52 | } 53 | }]; 54 | ``` 55 | 56 | #### Cancel Geocode 57 | ```ObjC 58 | [[LMGeocoder sharedInstance] cancelGeocode]; 59 | ``` 60 | 61 | ## Example 62 | To run the example project, clone the repo, and run `pod install` from the Example directory first. 63 | 64 | ## License 65 | LMGeocoder is available under the MIT license. See the LICENSE file for more info. 66 | 67 | ## Author 68 | Minh Nguyen 69 | * https://github.com/lminhtm 70 | * lminhtm@gmail.com 71 | -------------------------------------------------------------------------------- /Screenshots/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lminhtm/LMGeocoder/20db5f27fb12c3a2726c2355b1476ae7c9c3db42/Screenshots/screenshot.png -------------------------------------------------------------------------------- /Screenshots/screenshot@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lminhtm/LMGeocoder/20db5f27fb12c3a2726c2355b1476ae7c9c3db42/Screenshots/screenshot@2x.png -------------------------------------------------------------------------------- /_Pods.xcodeproj: -------------------------------------------------------------------------------- 1 | Example/Pods/Pods.xcodeproj --------------------------------------------------------------------------------