├── LICENSE ├── MapManager.swift ├── Maptest ├── Maptest.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── Maptest.xccheckout │ │ └── xcuserdata │ │ │ ├── jimmy.xcuserdatad │ │ │ ├── UserInterfaceState.xcuserstate │ │ │ └── WorkspaceSettings.xcsettings │ │ │ └── julio.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ ├── jimmy.xcuserdatad │ │ ├── xcdebugger │ │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ │ ├── Maptest.xcscheme │ │ │ └── xcschememanagement.plist │ │ └── julio.xcuserdatad │ │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ ├── Maptest.xcscheme │ │ └── xcschememanagement.plist ├── Maptest │ ├── AppDelegate.swift │ ├── Base.lproj │ │ └── Main.storyboard │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── LaunchImage.launchimage │ │ │ └── Contents.json │ ├── Info.plist │ ├── Launch Screen.storyboard │ └── ViewController.swift └── MaptestTests │ ├── Info.plist │ └── MaptestTests.swift └── README.md /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Varshyl Mobile Pvt. Ltd. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /MapManager.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MapManager.swift 3 | // 4 | // 5 | // Created by Jimmy Jose on 14/08/14. 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | import UIKit 26 | import CoreLocation 27 | import MapKit 28 | 29 | typealias DirectionsCompletionHandler = ((route:MKPolyline?, directionInformation:NSDictionary?, boundingRegion:MKMapRect?, error:String?)->())? 30 | 31 | // TODO: Documentation 32 | class MapManager: NSObject{ 33 | 34 | private var directionsCompletionHandler:DirectionsCompletionHandler 35 | private let errorNoRoutesAvailable = "No routes available"// add more error handling 36 | 37 | private let errorDictionary = ["NOT_FOUND" : "At least one of the locations specified in the request's origin, destination, or waypoints could not be geocoded", 38 | "ZERO_RESULTS":"No route could be found between the origin and destination", 39 | "MAX_WAYPOINTS_EXCEEDED":"Too many waypointss were provided in the request The maximum allowed waypoints is 8, plus the origin, and destination", 40 | "INVALID_REQUEST":"The provided request was invalid. Common causes of this status include an invalid parameter or parameter value", 41 | "OVER_QUERY_LIMIT":"Service has received too many requests from your application within the allowed time period", 42 | "REQUEST_DENIED":"Service denied use of the directions service by your application", 43 | "UNKNOWN_ERROR":"Directions request could not be processed due to a server error. Please try again"] 44 | 45 | override init(){ 46 | super.init() 47 | } 48 | 49 | func directions(from from:CLLocationCoordinate2D,to:NSString,directionCompletionHandler:DirectionsCompletionHandler){ 50 | self.directionsCompletionHandler = directionCompletionHandler 51 | let geoCoder = CLGeocoder() 52 | geoCoder.geocodeAddressString(to as String, completionHandler: { (placemarksObject, error) -> Void in 53 | if let error = error { 54 | self.directionsCompletionHandler!(route: nil,directionInformation:nil, boundingRegion: nil, error: error.localizedDescription) 55 | } 56 | else { 57 | let placemark = placemarksObject!.last! 58 | 59 | let placemarkSource = MKPlacemark(coordinate: from, addressDictionary: nil) 60 | 61 | let source = MKMapItem(placemark: placemarkSource) 62 | let placemarkDestination = MKPlacemark(placemark: placemark) 63 | let destination = MKMapItem(placemark: placemarkDestination) 64 | 65 | self.directionsFor(source: source, destination: destination, directionCompletionHandler: directionCompletionHandler) 66 | } 67 | }) 68 | } 69 | 70 | func directionsFromCurrentLocation(to to:NSString,directionCompletionHandler:DirectionsCompletionHandler){ 71 | self.directionsCompletionHandler = directionCompletionHandler 72 | let geoCoder = CLGeocoder() 73 | geoCoder.geocodeAddressString(to as String, completionHandler: { (placemarksObject, error) -> Void in 74 | if let error = error { 75 | self.directionsCompletionHandler!(route: nil,directionInformation:nil, boundingRegion: nil, error: error.localizedDescription) 76 | } 77 | else{ 78 | let placemark = placemarksObject!.last! 79 | let source = MKMapItem.mapItemForCurrentLocation() 80 | let placemarkDestination = MKPlacemark(placemark: placemark) 81 | let destination = MKMapItem(placemark: placemarkDestination) 82 | self.directionsFor(source: source, destination: destination, directionCompletionHandler: directionCompletionHandler) 83 | } 84 | }) 85 | } 86 | 87 | func directionsFromCurrentLocation(to to:CLLocationCoordinate2D,directionCompletionHandler:DirectionsCompletionHandler){ 88 | let source = MKMapItem.mapItemForCurrentLocation() 89 | let placemarkDestination = MKPlacemark(coordinate: to, addressDictionary: nil) 90 | let destination = MKMapItem(placemark: placemarkDestination) 91 | directionsFor(source: source, destination: destination, directionCompletionHandler: directionCompletionHandler) 92 | } 93 | 94 | func directions(from from:CLLocationCoordinate2D, to:CLLocationCoordinate2D,directionCompletionHandler:DirectionsCompletionHandler){ 95 | let placemarkSource = MKPlacemark(coordinate: from, addressDictionary: nil) 96 | let source = MKMapItem(placemark: placemarkSource) 97 | let placemarkDestination = MKPlacemark(coordinate: to, addressDictionary: nil) 98 | let destination = MKMapItem(placemark: placemarkDestination) 99 | directionsFor(source: source, destination: destination, directionCompletionHandler: directionCompletionHandler) 100 | } 101 | 102 | private func directionsFor(source source:MKMapItem, destination:MKMapItem, directionCompletionHandler:DirectionsCompletionHandler){ 103 | self.directionsCompletionHandler = directionCompletionHandler 104 | let directionRequest = MKDirectionsRequest() 105 | directionRequest.source = source 106 | directionRequest.destination = destination 107 | directionRequest.transportType = MKDirectionsTransportType.Any 108 | directionRequest.requestsAlternateRoutes = true 109 | let directions = MKDirections(request: directionRequest) 110 | directions.calculateDirectionsWithCompletionHandler({ 111 | (response:MKDirectionsResponse?, error:NSError?) -> Void in 112 | if let error = error { 113 | self.directionsCompletionHandler!(route: nil,directionInformation:nil, boundingRegion: nil, error: error.localizedDescription) 114 | } 115 | else if response!.routes.isEmpty { 116 | self.directionsCompletionHandler!(route: nil,directionInformation:nil, boundingRegion: nil, error: self.errorNoRoutesAvailable) 117 | } 118 | else{ 119 | let route: MKRoute = response!.routes[0] 120 | let steps = route.steps as NSArray 121 | let end_address = route.name 122 | let distance = route.distance.description 123 | let duration = route.expectedTravelTime.description 124 | 125 | let source = response!.source.placemark.coordinate 126 | let destination = response!.destination.placemark.coordinate 127 | 128 | let start_location = ["lat":source.latitude,"lng":source.longitude] 129 | let end_location = ["lat":destination.latitude,"lng":destination.longitude] 130 | 131 | let stepsFinalArray = NSMutableArray() 132 | 133 | steps.enumerateObjectsUsingBlock({ (obj, idx, stop) -> Void in 134 | let step:MKRouteStep = obj as! MKRouteStep 135 | let distance = step.distance.description 136 | let instructions = step.instructions 137 | let stepsDictionary = NSMutableDictionary() 138 | 139 | stepsDictionary.setObject(distance, forKey: "distance") 140 | stepsDictionary.setObject("", forKey: "duration") 141 | stepsDictionary.setObject(instructions, forKey: "instructions") 142 | 143 | stepsFinalArray.addObject(stepsDictionary) 144 | }) 145 | 146 | let stepsDict = NSMutableDictionary() 147 | stepsDict.setObject(distance, forKey: "distance") 148 | stepsDict.setObject(duration, forKey: "duration") 149 | stepsDict.setObject(end_address, forKey: "end_address") 150 | stepsDict.setObject(end_location, forKey: "end_location") 151 | stepsDict.setObject("", forKey: "start_address") 152 | stepsDict.setObject(start_location, forKey: "start_location") 153 | stepsDict.setObject(stepsFinalArray, forKey: "steps") 154 | 155 | self.directionsCompletionHandler!(route: route.polyline,directionInformation: stepsDict, boundingRegion: route.polyline.boundingMapRect, error: nil) 156 | } 157 | }) 158 | } 159 | 160 | /** 161 | Get directions using Google API by passing source and destination as string. 162 | - parameter from: Starting point of journey 163 | - parameter to: Ending point of journey 164 | - returns: directionCompletionHandler: Completion handler contains polyline,dictionary,maprect and error 165 | */ 166 | func directionsUsingGoogle(from from:NSString, to:NSString,directionCompletionHandler:DirectionsCompletionHandler){ 167 | getDirectionsUsingGoogle(origin: from, destination: to, directionCompletionHandler: directionCompletionHandler) 168 | } 169 | 170 | func directionsUsingGoogle(from from:CLLocationCoordinate2D, to:CLLocationCoordinate2D,directionCompletionHandler:DirectionsCompletionHandler){ 171 | let originLatLng = "\(from.latitude),\(from.longitude)" 172 | let destinationLatLng = "\(to.latitude),\(to.longitude)" 173 | getDirectionsUsingGoogle(origin: originLatLng, destination: destinationLatLng, directionCompletionHandler: directionCompletionHandler) 174 | 175 | } 176 | 177 | func directionsUsingGoogle(from from:CLLocationCoordinate2D, to:NSString,directionCompletionHandler:DirectionsCompletionHandler){ 178 | let originLatLng = "\(from.latitude),\(from.longitude)" 179 | getDirectionsUsingGoogle(origin: originLatLng, destination: to, directionCompletionHandler: directionCompletionHandler) 180 | } 181 | 182 | private func getDirectionsUsingGoogle(origin origin:NSString, destination:NSString,directionCompletionHandler:DirectionsCompletionHandler){ 183 | self.directionsCompletionHandler = directionCompletionHandler 184 | let path = "http://maps.googleapis.com/maps/api/directions/json?origin=\(origin)&destination=\(destination)" 185 | performOperationForURL(path) 186 | } 187 | 188 | private func performOperationForURL(urlString:NSString){ 189 | let urlEncoded = urlString.stringByReplacingOccurrencesOfString(" ", withString: "%20") 190 | let url:NSURL? = NSURL(string:urlEncoded) 191 | let request:NSURLRequest = NSURLRequest(URL:url!) 192 | let queue:NSOperationQueue = NSOperationQueue() 193 | 194 | NSURLConnection.sendAsynchronousRequest(request,queue:queue,completionHandler:{response,data,error in 195 | if error != nil { 196 | print(error!.localizedDescription) 197 | self.directionsCompletionHandler!(route: nil,directionInformation:nil, boundingRegion: nil, error: error!.localizedDescription) 198 | } 199 | else{ 200 | let jsonResult: NSDictionary = (try! NSJSONSerialization.JSONObjectWithData(data!, options: NSJSONReadingOptions.MutableContainers)) as! NSDictionary 201 | let routes = jsonResult.objectForKey("routes") as! NSArray 202 | let status = jsonResult.objectForKey("status") as! NSString 203 | let route = routes.lastObject as! NSDictionary //first object? 204 | if status.isEqualToString("OK") && route.allKeys.count > 0 { 205 | let legs = route.objectForKey("legs") as! NSArray 206 | let steps = legs.firstObject as! NSDictionary 207 | let directionInformation = self.parser(steps) as NSDictionary 208 | let overviewPolyline = route.objectForKey("overview_polyline") as! NSDictionary 209 | let points = overviewPolyline.objectForKey("points") as! NSString 210 | let locations = self.decodePolyLine(points) as Array 211 | var coordinates = locations.map({ (location: CLLocation) -> 212 | CLLocationCoordinate2D in 213 | return location.coordinate 214 | }) 215 | let polyline = MKPolyline(coordinates: &coordinates, count: locations.count) 216 | self.directionsCompletionHandler!(route: polyline,directionInformation:directionInformation, boundingRegion: polyline.boundingMapRect, error: nil) 217 | } 218 | else{ 219 | var errorMsg = self.errorDictionary[status as String] 220 | if errorMsg == nil { 221 | errorMsg = self.errorNoRoutesAvailable 222 | } 223 | self.directionsCompletionHandler!(route: nil,directionInformation:nil, boundingRegion: nil, error: errorMsg) 224 | } 225 | } 226 | } 227 | ) 228 | } 229 | 230 | private func decodePolyLine(encodedStr:NSString)->Array{ 231 | var array = Array() 232 | let len = encodedStr.length 233 | let range = NSMakeRange(0, len) 234 | var strpolyline = encodedStr 235 | var index = 0 236 | var lat = 0 as Int32 237 | var lng = 0 as Int32 238 | 239 | strpolyline = encodedStr.stringByReplacingOccurrencesOfString("\\\\", withString: "\\", options: NSStringCompareOptions.LiteralSearch, range: range) 240 | while(index= 0x20) 252 | 253 | var dlat = 0 254 | 255 | if((result & 1) == 1){ 256 | dlat = ~(result >> 1) 257 | } 258 | else{ 259 | dlat = (result >> 1) 260 | } 261 | 262 | lat += dlat 263 | 264 | shift = 0 265 | result = 0 266 | 267 | repeat { 268 | let numUnichar = strpolyline.characterAtIndex(index++) 269 | let num = NSNumber(unsignedShort: numUnichar) 270 | let numInt = num.integerValue 271 | b = numInt - 63 272 | result |= (b & 0x1f) << shift 273 | shift += 5 274 | } while(b >= 0x20) 275 | 276 | var dlng = 0 277 | 278 | if((result & 1) == 1){ 279 | dlng = ~(result >> 1) 280 | } 281 | else{ 282 | dlng = (result >> 1) 283 | } 284 | lng += dlng 285 | 286 | let latitude = NSNumber(int:lat).doubleValue * 1e-5 287 | let longitude = NSNumber(int:lng).doubleValue * 1e-5 288 | let location = CLLocation(latitude: latitude, longitude: longitude) 289 | array.append(location) 290 | } 291 | return array 292 | } 293 | 294 | private func parser(data:NSDictionary)->NSDictionary{ 295 | let distance = (data.objectForKey("distance") as! NSDictionary).objectForKey("text") as! NSString 296 | let duration = (data.objectForKey("duration") as! NSDictionary).objectForKey("text") as! NSString 297 | let end_address = data.objectForKey("end_address") as! NSString 298 | let end_location = data.objectForKey("end_location") as! NSDictionary 299 | let start_address = data.objectForKey("start_address") as! NSString 300 | let start_location = data.objectForKey("start_location") as! NSDictionary 301 | let stepsArray = data.objectForKey("steps") as! NSArray 302 | let stepsDict = NSMutableDictionary() 303 | let stepsFinalArray = NSMutableArray() 304 | 305 | stepsArray.enumerateObjectsUsingBlock { (obj, idx, stop) -> Void in 306 | let stepDict = obj as! NSDictionary 307 | let distance = (stepDict.objectForKey("distance") as! NSDictionary).objectForKey("text") as! NSString 308 | let duration = (stepDict.objectForKey("duration") as! NSDictionary).objectForKey("text") as! NSString 309 | let html_instructions = stepDict.objectForKey("html_instructions") as! NSString 310 | let end_location = stepDict.objectForKey("end_location") as! NSDictionary 311 | let instructions = self.removeHTMLTags((stepDict.objectForKey("html_instructions") as! NSString)) 312 | let start_location = stepDict.objectForKey("start_location") as! NSDictionary 313 | let stepsDictionary = NSMutableDictionary() 314 | stepsDictionary.setObject(distance, forKey: "distance") 315 | stepsDictionary.setObject(duration, forKey: "duration") 316 | stepsDictionary.setObject(html_instructions, forKey: "html_instructions") 317 | stepsDictionary.setObject(end_location, forKey: "end_location") 318 | stepsDictionary.setObject(instructions, forKey: "instructions") 319 | stepsDictionary.setObject(start_location, forKey: "start_location") 320 | stepsFinalArray.addObject(stepsDictionary) 321 | } 322 | stepsDict.setObject(distance, forKey: "distance") 323 | stepsDict.setObject(duration, forKey: "duration") 324 | stepsDict.setObject(end_address, forKey: "end_address") 325 | stepsDict.setObject(end_location, forKey: "end_location") 326 | stepsDict.setObject(start_address, forKey: "start_address") 327 | stepsDict.setObject(start_location, forKey: "start_location") 328 | stepsDict.setObject(stepsFinalArray, forKey: "steps") 329 | return stepsDict 330 | } 331 | 332 | private func removeHTMLTags(source:NSString)->NSString{ 333 | var range = NSMakeRange(0, 0) 334 | let HTMLTags = "<[^>]*>" 335 | 336 | var sourceString = source 337 | while( sourceString.rangeOfString(HTMLTags, options: NSStringCompareOptions.RegularExpressionSearch).location != NSNotFound){ 338 | range = sourceString.rangeOfString(HTMLTags, options: NSStringCompareOptions.RegularExpressionSearch) 339 | sourceString = sourceString.stringByReplacingCharactersInRange(range, withString: "") 340 | } 341 | return sourceString; 342 | } 343 | } 344 | 345 | -------------------------------------------------------------------------------- /Maptest/Maptest.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 43C8EF971BBF32810003CAF4 /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 43C8EF961BBF32810003CAF4 /* Launch Screen.storyboard */; settings = {ASSET_TAGS = (); }; }; 11 | BF5D184619BC6F5A00FA08CD /* MapManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF5D184519BC6F5A00FA08CD /* MapManager.swift */; }; 12 | BF7A144519ACB9C200B47403 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BFCFF58719A1395900D16DD9 /* CoreLocation.framework */; }; 13 | BF7A144619ACB9C700B47403 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BFCFF58519A1394D00D16DD9 /* UIKit.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 14 | BF7A144719ACB9CC00B47403 /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BFCFF58319A1394400D16DD9 /* MapKit.framework */; }; 15 | BFCFF56719A138A700D16DD9 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFCFF56619A138A700D16DD9 /* AppDelegate.swift */; }; 16 | BFCFF56919A138A700D16DD9 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFCFF56819A138A700D16DD9 /* ViewController.swift */; }; 17 | BFCFF56C19A138A700D16DD9 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BFCFF56A19A138A700D16DD9 /* Main.storyboard */; }; 18 | BFCFF56E19A138A700D16DD9 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BFCFF56D19A138A700D16DD9 /* Images.xcassets */; }; 19 | BFCFF57A19A138A700D16DD9 /* MaptestTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFCFF57919A138A700D16DD9 /* MaptestTests.swift */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXContainerItemProxy section */ 23 | BFCFF57419A138A700D16DD9 /* PBXContainerItemProxy */ = { 24 | isa = PBXContainerItemProxy; 25 | containerPortal = BFCFF55919A138A600D16DD9 /* Project object */; 26 | proxyType = 1; 27 | remoteGlobalIDString = BFCFF56019A138A600D16DD9; 28 | remoteInfo = Maptest; 29 | }; 30 | /* End PBXContainerItemProxy section */ 31 | 32 | /* Begin PBXFileReference section */ 33 | 43C8EF961BBF32810003CAF4 /* Launch Screen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = ""; }; 34 | BF5D184519BC6F5A00FA08CD /* MapManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MapManager.swift; path = ../../MapManager.swift; sourceTree = ""; }; 35 | BFCFF56119A138A600D16DD9 /* Maptest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Maptest.app; sourceTree = BUILT_PRODUCTS_DIR; }; 36 | BFCFF56519A138A700D16DD9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 37 | BFCFF56619A138A700D16DD9 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 38 | BFCFF56819A138A700D16DD9 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 39 | BFCFF56B19A138A700D16DD9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 40 | BFCFF56D19A138A700D16DD9 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 41 | BFCFF57319A138A700D16DD9 /* MaptestTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MaptestTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 42 | BFCFF57819A138A700D16DD9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 43 | BFCFF57919A138A700D16DD9 /* MaptestTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MaptestTests.swift; sourceTree = ""; }; 44 | BFCFF58319A1394400D16DD9 /* MapKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MapKit.framework; path = System/Library/Frameworks/MapKit.framework; sourceTree = SDKROOT; }; 45 | BFCFF58519A1394D00D16DD9 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 46 | BFCFF58719A1395900D16DD9 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; 47 | /* End PBXFileReference section */ 48 | 49 | /* Begin PBXFrameworksBuildPhase section */ 50 | BFCFF55E19A138A600D16DD9 /* Frameworks */ = { 51 | isa = PBXFrameworksBuildPhase; 52 | buildActionMask = 2147483647; 53 | files = ( 54 | BF7A144719ACB9CC00B47403 /* MapKit.framework in Frameworks */, 55 | BF7A144619ACB9C700B47403 /* UIKit.framework in Frameworks */, 56 | BF7A144519ACB9C200B47403 /* CoreLocation.framework in Frameworks */, 57 | ); 58 | runOnlyForDeploymentPostprocessing = 0; 59 | }; 60 | BFCFF57019A138A700D16DD9 /* Frameworks */ = { 61 | isa = PBXFrameworksBuildPhase; 62 | buildActionMask = 2147483647; 63 | files = ( 64 | ); 65 | runOnlyForDeploymentPostprocessing = 0; 66 | }; 67 | /* End PBXFrameworksBuildPhase section */ 68 | 69 | /* Begin PBXGroup section */ 70 | BFCFF55819A138A600D16DD9 = { 71 | isa = PBXGroup; 72 | children = ( 73 | BFCFF58719A1395900D16DD9 /* CoreLocation.framework */, 74 | BFCFF58519A1394D00D16DD9 /* UIKit.framework */, 75 | BFCFF58319A1394400D16DD9 /* MapKit.framework */, 76 | BFCFF56319A138A600D16DD9 /* Maptest */, 77 | BFCFF57619A138A700D16DD9 /* MaptestTests */, 78 | BFCFF56219A138A600D16DD9 /* Products */, 79 | ); 80 | sourceTree = ""; 81 | }; 82 | BFCFF56219A138A600D16DD9 /* Products */ = { 83 | isa = PBXGroup; 84 | children = ( 85 | BFCFF56119A138A600D16DD9 /* Maptest.app */, 86 | BFCFF57319A138A700D16DD9 /* MaptestTests.xctest */, 87 | ); 88 | name = Products; 89 | sourceTree = ""; 90 | }; 91 | BFCFF56319A138A600D16DD9 /* Maptest */ = { 92 | isa = PBXGroup; 93 | children = ( 94 | BF5D184519BC6F5A00FA08CD /* MapManager.swift */, 95 | BFCFF56619A138A700D16DD9 /* AppDelegate.swift */, 96 | BFCFF56819A138A700D16DD9 /* ViewController.swift */, 97 | BFCFF56A19A138A700D16DD9 /* Main.storyboard */, 98 | BFCFF56D19A138A700D16DD9 /* Images.xcassets */, 99 | BFCFF56419A138A700D16DD9 /* Supporting Files */, 100 | 43C8EF961BBF32810003CAF4 /* Launch Screen.storyboard */, 101 | ); 102 | path = Maptest; 103 | sourceTree = ""; 104 | }; 105 | BFCFF56419A138A700D16DD9 /* Supporting Files */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | BFCFF56519A138A700D16DD9 /* Info.plist */, 109 | ); 110 | name = "Supporting Files"; 111 | sourceTree = ""; 112 | }; 113 | BFCFF57619A138A700D16DD9 /* MaptestTests */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | BFCFF57919A138A700D16DD9 /* MaptestTests.swift */, 117 | BFCFF57719A138A700D16DD9 /* Supporting Files */, 118 | ); 119 | path = MaptestTests; 120 | sourceTree = ""; 121 | }; 122 | BFCFF57719A138A700D16DD9 /* Supporting Files */ = { 123 | isa = PBXGroup; 124 | children = ( 125 | BFCFF57819A138A700D16DD9 /* Info.plist */, 126 | ); 127 | name = "Supporting Files"; 128 | sourceTree = ""; 129 | }; 130 | /* End PBXGroup section */ 131 | 132 | /* Begin PBXNativeTarget section */ 133 | BFCFF56019A138A600D16DD9 /* Maptest */ = { 134 | isa = PBXNativeTarget; 135 | buildConfigurationList = BFCFF57D19A138A700D16DD9 /* Build configuration list for PBXNativeTarget "Maptest" */; 136 | buildPhases = ( 137 | BFCFF55D19A138A600D16DD9 /* Sources */, 138 | BFCFF55E19A138A600D16DD9 /* Frameworks */, 139 | BFCFF55F19A138A600D16DD9 /* Resources */, 140 | ); 141 | buildRules = ( 142 | ); 143 | dependencies = ( 144 | ); 145 | name = Maptest; 146 | productName = Maptest; 147 | productReference = BFCFF56119A138A600D16DD9 /* Maptest.app */; 148 | productType = "com.apple.product-type.application"; 149 | }; 150 | BFCFF57219A138A700D16DD9 /* MaptestTests */ = { 151 | isa = PBXNativeTarget; 152 | buildConfigurationList = BFCFF58019A138A700D16DD9 /* Build configuration list for PBXNativeTarget "MaptestTests" */; 153 | buildPhases = ( 154 | BFCFF56F19A138A700D16DD9 /* Sources */, 155 | BFCFF57019A138A700D16DD9 /* Frameworks */, 156 | BFCFF57119A138A700D16DD9 /* Resources */, 157 | ); 158 | buildRules = ( 159 | ); 160 | dependencies = ( 161 | BFCFF57519A138A700D16DD9 /* PBXTargetDependency */, 162 | ); 163 | name = MaptestTests; 164 | productName = MaptestTests; 165 | productReference = BFCFF57319A138A700D16DD9 /* MaptestTests.xctest */; 166 | productType = "com.apple.product-type.bundle.unit-test"; 167 | }; 168 | /* End PBXNativeTarget section */ 169 | 170 | /* Begin PBXProject section */ 171 | BFCFF55919A138A600D16DD9 /* Project object */ = { 172 | isa = PBXProject; 173 | attributes = { 174 | LastSwiftMigration = 0700; 175 | LastSwiftUpdateCheck = 0700; 176 | LastUpgradeCheck = 0700; 177 | ORGANIZATIONNAME = "Varshyl Mobile Pvt. Ltd."; 178 | TargetAttributes = { 179 | BFCFF56019A138A600D16DD9 = { 180 | CreatedOnToolsVersion = 6.0; 181 | }; 182 | BFCFF57219A138A700D16DD9 = { 183 | CreatedOnToolsVersion = 6.0; 184 | TestTargetID = BFCFF56019A138A600D16DD9; 185 | }; 186 | }; 187 | }; 188 | buildConfigurationList = BFCFF55C19A138A600D16DD9 /* Build configuration list for PBXProject "Maptest" */; 189 | compatibilityVersion = "Xcode 3.2"; 190 | developmentRegion = English; 191 | hasScannedForEncodings = 0; 192 | knownRegions = ( 193 | en, 194 | Base, 195 | ); 196 | mainGroup = BFCFF55819A138A600D16DD9; 197 | productRefGroup = BFCFF56219A138A600D16DD9 /* Products */; 198 | projectDirPath = ""; 199 | projectRoot = ""; 200 | targets = ( 201 | BFCFF56019A138A600D16DD9 /* Maptest */, 202 | BFCFF57219A138A700D16DD9 /* MaptestTests */, 203 | ); 204 | }; 205 | /* End PBXProject section */ 206 | 207 | /* Begin PBXResourcesBuildPhase section */ 208 | BFCFF55F19A138A600D16DD9 /* Resources */ = { 209 | isa = PBXResourcesBuildPhase; 210 | buildActionMask = 2147483647; 211 | files = ( 212 | 43C8EF971BBF32810003CAF4 /* Launch Screen.storyboard in Resources */, 213 | BFCFF56C19A138A700D16DD9 /* Main.storyboard in Resources */, 214 | BFCFF56E19A138A700D16DD9 /* Images.xcassets in Resources */, 215 | ); 216 | runOnlyForDeploymentPostprocessing = 0; 217 | }; 218 | BFCFF57119A138A700D16DD9 /* Resources */ = { 219 | isa = PBXResourcesBuildPhase; 220 | buildActionMask = 2147483647; 221 | files = ( 222 | ); 223 | runOnlyForDeploymentPostprocessing = 0; 224 | }; 225 | /* End PBXResourcesBuildPhase section */ 226 | 227 | /* Begin PBXSourcesBuildPhase section */ 228 | BFCFF55D19A138A600D16DD9 /* Sources */ = { 229 | isa = PBXSourcesBuildPhase; 230 | buildActionMask = 2147483647; 231 | files = ( 232 | BFCFF56919A138A700D16DD9 /* ViewController.swift in Sources */, 233 | BF5D184619BC6F5A00FA08CD /* MapManager.swift in Sources */, 234 | BFCFF56719A138A700D16DD9 /* AppDelegate.swift in Sources */, 235 | ); 236 | runOnlyForDeploymentPostprocessing = 0; 237 | }; 238 | BFCFF56F19A138A700D16DD9 /* Sources */ = { 239 | isa = PBXSourcesBuildPhase; 240 | buildActionMask = 2147483647; 241 | files = ( 242 | BFCFF57A19A138A700D16DD9 /* MaptestTests.swift in Sources */, 243 | ); 244 | runOnlyForDeploymentPostprocessing = 0; 245 | }; 246 | /* End PBXSourcesBuildPhase section */ 247 | 248 | /* Begin PBXTargetDependency section */ 249 | BFCFF57519A138A700D16DD9 /* PBXTargetDependency */ = { 250 | isa = PBXTargetDependency; 251 | target = BFCFF56019A138A600D16DD9 /* Maptest */; 252 | targetProxy = BFCFF57419A138A700D16DD9 /* PBXContainerItemProxy */; 253 | }; 254 | /* End PBXTargetDependency section */ 255 | 256 | /* Begin PBXVariantGroup section */ 257 | BFCFF56A19A138A700D16DD9 /* Main.storyboard */ = { 258 | isa = PBXVariantGroup; 259 | children = ( 260 | BFCFF56B19A138A700D16DD9 /* Base */, 261 | ); 262 | name = Main.storyboard; 263 | sourceTree = ""; 264 | }; 265 | /* End PBXVariantGroup section */ 266 | 267 | /* Begin XCBuildConfiguration section */ 268 | BFCFF57B19A138A700D16DD9 /* Debug */ = { 269 | isa = XCBuildConfiguration; 270 | buildSettings = { 271 | ALWAYS_SEARCH_USER_PATHS = NO; 272 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 273 | CLANG_CXX_LIBRARY = "libc++"; 274 | CLANG_ENABLE_MODULES = YES; 275 | CLANG_ENABLE_OBJC_ARC = YES; 276 | CLANG_WARN_BOOL_CONVERSION = YES; 277 | CLANG_WARN_CONSTANT_CONVERSION = YES; 278 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 279 | CLANG_WARN_EMPTY_BODY = YES; 280 | CLANG_WARN_ENUM_CONVERSION = YES; 281 | CLANG_WARN_INT_CONVERSION = YES; 282 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 283 | CLANG_WARN_UNREACHABLE_CODE = YES; 284 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 285 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 286 | COPY_PHASE_STRIP = NO; 287 | ENABLE_STRICT_OBJC_MSGSEND = YES; 288 | ENABLE_TESTABILITY = YES; 289 | GCC_C_LANGUAGE_STANDARD = gnu99; 290 | GCC_DYNAMIC_NO_PIC = NO; 291 | GCC_OPTIMIZATION_LEVEL = 0; 292 | GCC_PREPROCESSOR_DEFINITIONS = ( 293 | "DEBUG=1", 294 | "$(inherited)", 295 | ); 296 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 297 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 298 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 299 | GCC_WARN_UNDECLARED_SELECTOR = YES; 300 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 301 | GCC_WARN_UNUSED_FUNCTION = YES; 302 | GCC_WARN_UNUSED_VARIABLE = YES; 303 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 304 | MTL_ENABLE_DEBUG_INFO = YES; 305 | ONLY_ACTIVE_ARCH = YES; 306 | SDKROOT = iphoneos; 307 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 308 | }; 309 | name = Debug; 310 | }; 311 | BFCFF57C19A138A700D16DD9 /* Release */ = { 312 | isa = XCBuildConfiguration; 313 | buildSettings = { 314 | ALWAYS_SEARCH_USER_PATHS = NO; 315 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 316 | CLANG_CXX_LIBRARY = "libc++"; 317 | CLANG_ENABLE_MODULES = YES; 318 | CLANG_ENABLE_OBJC_ARC = YES; 319 | CLANG_WARN_BOOL_CONVERSION = YES; 320 | CLANG_WARN_CONSTANT_CONVERSION = YES; 321 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 322 | CLANG_WARN_EMPTY_BODY = YES; 323 | CLANG_WARN_ENUM_CONVERSION = YES; 324 | CLANG_WARN_INT_CONVERSION = YES; 325 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 326 | CLANG_WARN_UNREACHABLE_CODE = YES; 327 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 328 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 329 | COPY_PHASE_STRIP = YES; 330 | ENABLE_NS_ASSERTIONS = NO; 331 | ENABLE_STRICT_OBJC_MSGSEND = YES; 332 | GCC_C_LANGUAGE_STANDARD = gnu99; 333 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 334 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 335 | GCC_WARN_UNDECLARED_SELECTOR = YES; 336 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 337 | GCC_WARN_UNUSED_FUNCTION = YES; 338 | GCC_WARN_UNUSED_VARIABLE = YES; 339 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 340 | MTL_ENABLE_DEBUG_INFO = NO; 341 | SDKROOT = iphoneos; 342 | VALIDATE_PRODUCT = YES; 343 | }; 344 | name = Release; 345 | }; 346 | BFCFF57E19A138A700D16DD9 /* Debug */ = { 347 | isa = XCBuildConfiguration; 348 | buildSettings = { 349 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 350 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 351 | CODE_SIGN_IDENTITY = "iPhone Developer"; 352 | INFOPLIST_FILE = Maptest/Info.plist; 353 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 354 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 355 | ONLY_ACTIVE_ARCH = YES; 356 | PRODUCT_BUNDLE_IDENTIFIER = "com.varshylmobile.$(PRODUCT_NAME:rfc1034identifier)"; 357 | PRODUCT_NAME = "$(TARGET_NAME)"; 358 | VALID_ARCHS = "armv7 armv7s arm64"; 359 | }; 360 | name = Debug; 361 | }; 362 | BFCFF57F19A138A700D16DD9 /* Release */ = { 363 | isa = XCBuildConfiguration; 364 | buildSettings = { 365 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 366 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 367 | CODE_SIGN_IDENTITY = "iPhone Developer"; 368 | INFOPLIST_FILE = Maptest/Info.plist; 369 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 370 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 371 | PRODUCT_BUNDLE_IDENTIFIER = "com.varshylmobile.$(PRODUCT_NAME:rfc1034identifier)"; 372 | PRODUCT_NAME = "$(TARGET_NAME)"; 373 | VALID_ARCHS = "armv7 armv7s arm64"; 374 | }; 375 | name = Release; 376 | }; 377 | BFCFF58119A138A700D16DD9 /* Debug */ = { 378 | isa = XCBuildConfiguration; 379 | buildSettings = { 380 | BUNDLE_LOADER = "$(TEST_HOST)"; 381 | FRAMEWORK_SEARCH_PATHS = ( 382 | "$(SDKROOT)/Developer/Library/Frameworks", 383 | "$(inherited)", 384 | ); 385 | GCC_PREPROCESSOR_DEFINITIONS = ( 386 | "DEBUG=1", 387 | "$(inherited)", 388 | ); 389 | INFOPLIST_FILE = MaptestTests/Info.plist; 390 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 391 | PRODUCT_BUNDLE_IDENTIFIER = "com.varshylmobile.$(PRODUCT_NAME:rfc1034identifier)"; 392 | PRODUCT_NAME = "$(TARGET_NAME)"; 393 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Maptest.app/Maptest"; 394 | }; 395 | name = Debug; 396 | }; 397 | BFCFF58219A138A700D16DD9 /* Release */ = { 398 | isa = XCBuildConfiguration; 399 | buildSettings = { 400 | BUNDLE_LOADER = "$(TEST_HOST)"; 401 | FRAMEWORK_SEARCH_PATHS = ( 402 | "$(SDKROOT)/Developer/Library/Frameworks", 403 | "$(inherited)", 404 | ); 405 | INFOPLIST_FILE = MaptestTests/Info.plist; 406 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 407 | PRODUCT_BUNDLE_IDENTIFIER = "com.varshylmobile.$(PRODUCT_NAME:rfc1034identifier)"; 408 | PRODUCT_NAME = "$(TARGET_NAME)"; 409 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Maptest.app/Maptest"; 410 | }; 411 | name = Release; 412 | }; 413 | /* End XCBuildConfiguration section */ 414 | 415 | /* Begin XCConfigurationList section */ 416 | BFCFF55C19A138A600D16DD9 /* Build configuration list for PBXProject "Maptest" */ = { 417 | isa = XCConfigurationList; 418 | buildConfigurations = ( 419 | BFCFF57B19A138A700D16DD9 /* Debug */, 420 | BFCFF57C19A138A700D16DD9 /* Release */, 421 | ); 422 | defaultConfigurationIsVisible = 0; 423 | defaultConfigurationName = Release; 424 | }; 425 | BFCFF57D19A138A700D16DD9 /* Build configuration list for PBXNativeTarget "Maptest" */ = { 426 | isa = XCConfigurationList; 427 | buildConfigurations = ( 428 | BFCFF57E19A138A700D16DD9 /* Debug */, 429 | BFCFF57F19A138A700D16DD9 /* Release */, 430 | ); 431 | defaultConfigurationIsVisible = 0; 432 | defaultConfigurationName = Release; 433 | }; 434 | BFCFF58019A138A700D16DD9 /* Build configuration list for PBXNativeTarget "MaptestTests" */ = { 435 | isa = XCConfigurationList; 436 | buildConfigurations = ( 437 | BFCFF58119A138A700D16DD9 /* Debug */, 438 | BFCFF58219A138A700D16DD9 /* Release */, 439 | ); 440 | defaultConfigurationIsVisible = 0; 441 | defaultConfigurationName = Release; 442 | }; 443 | /* End XCConfigurationList section */ 444 | }; 445 | rootObject = BFCFF55919A138A600D16DD9 /* Project object */; 446 | } 447 | -------------------------------------------------------------------------------- /Maptest/Maptest.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Maptest/Maptest.xcodeproj/project.xcworkspace/xcshareddata/Maptest.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 927418DC-02EA-464B-A881-AEAD680BD6C2 9 | IDESourceControlProjectName 10 | Maptest 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 1715C001856C138B93AD3D0A54BE22322048F0DF 14 | https://github.com/varshylmobile/MapManager.git 15 | 16 | IDESourceControlProjectPath 17 | Maptest/Maptest.xcodeproj 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 1715C001856C138B93AD3D0A54BE22322048F0DF 21 | ../../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/varshylmobile/MapManager.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | 1715C001856C138B93AD3D0A54BE22322048F0DF 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 1715C001856C138B93AD3D0A54BE22322048F0DF 36 | IDESourceControlWCCName 37 | MapManager 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Maptest/Maptest.xcodeproj/project.xcworkspace/xcuserdata/jimmy.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jimmyjose-dev/MapManager/34d89f73a90043ecc9bb949934b4c30a21ffbb71/Maptest/Maptest.xcodeproj/project.xcworkspace/xcuserdata/jimmy.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Maptest/Maptest.xcodeproj/project.xcworkspace/xcuserdata/jimmy.xcuserdatad/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges 6 | 7 | SnapshotAutomaticallyBeforeSignificantChanges 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Maptest/Maptest.xcodeproj/project.xcworkspace/xcuserdata/julio.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jimmyjose-dev/MapManager/34d89f73a90043ecc9bb949934b4c30a21ffbb71/Maptest/Maptest.xcodeproj/project.xcworkspace/xcuserdata/julio.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Maptest/Maptest.xcodeproj/xcuserdata/jimmy.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /Maptest/Maptest.xcodeproj/xcuserdata/jimmy.xcuserdatad/xcschemes/Maptest.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 76 | 82 | 83 | 84 | 85 | 89 | 90 | 91 | 92 | 98 | 99 | 105 | 106 | 107 | 108 | 110 | 111 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /Maptest/Maptest.xcodeproj/xcuserdata/jimmy.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Maptest.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | BFCFF56019A138A600D16DD9 16 | 17 | primary 18 | 19 | 20 | BFCFF57219A138A700D16DD9 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Maptest/Maptest.xcodeproj/xcuserdata/julio.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 | 71 | 72 | -------------------------------------------------------------------------------- /Maptest/Maptest.xcodeproj/xcuserdata/julio.xcuserdatad/xcschemes/Maptest.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 | -------------------------------------------------------------------------------- /Maptest/Maptest.xcodeproj/xcuserdata/julio.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Maptest.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | BFCFF56019A138A600D16DD9 16 | 17 | primary 18 | 19 | 20 | BFCFF57219A138A700D16DD9 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Maptest/Maptest/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // Maptest 4 | // 5 | // Created by Jimmy Jose on 18/08/14. 6 | // Copyright (c) 2014 Varshyl Mobile Pvt. Ltd. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | var window: UIWindow? 14 | } 15 | 16 | -------------------------------------------------------------------------------- /Maptest/Maptest/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 60 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | -------------------------------------------------------------------------------- /Maptest/Maptest/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Maptest/Maptest/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /Maptest/Maptest/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 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | NSLocationUsageDescription 26 | Just press OK or rot in hell 27 | NSLocationWhenInUseUsageDescription 28 | Just press OK or rot in hell 29 | UILaunchStoryboardName 30 | Launch Screen 31 | UIMainStoryboardFile 32 | Main 33 | UIRequiredDeviceCapabilities 34 | 35 | armv7 36 | 37 | UISupportedInterfaceOrientations 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /Maptest/Maptest/Launch Screen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 28 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /Maptest/Maptest/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // Maptest 4 | // 5 | // Created by Jimmy Jose on 18/08/14. 6 | // 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 | import UIKit 27 | import MapKit 28 | 29 | class ViewController: UIViewController,UITextFieldDelegate,MKMapViewDelegate,UITableViewDataSource,UITableViewDelegate,CLLocationManagerDelegate{ 30 | 31 | @IBOutlet var mapView:MKMapView? = MKMapView() 32 | @IBOutlet var textfieldTo:UITextField? = UITextField() 33 | @IBOutlet var textfieldFrom:UITextField? = UITextField() 34 | @IBOutlet var textfieldToCurrentLocation:UITextField? = UITextField() 35 | @IBOutlet var textView:UITextView? = UITextView() 36 | @IBOutlet var tableView:UITableView? = UITableView() 37 | 38 | var tableData = NSArray() 39 | var mapManager = MapManager() 40 | var locationManager: CLLocationManager! 41 | 42 | override func viewDidLoad() { 43 | super.viewDidLoad() 44 | //[CLLocationManager requestWhenInUseAuthorization]; 45 | //[CLLocationManager requestAlwaysAuthorization] 46 | textfieldTo?.delegate = self 47 | textfieldFrom?.delegate = self 48 | self.mapView?.delegate = self 49 | self.mapView!.showsUserLocation = true 50 | } 51 | 52 | func mapViewWillStartLocatingUser(mapView: MKMapView) { 53 | } 54 | 55 | func mapView(mapView: MKMapView, rendererForOverlay overlay: MKOverlay) -> MKOverlayRenderer { 56 | if overlay is MKPolyline { 57 | let polylineRenderer = MKPolylineRenderer(overlay: overlay) 58 | polylineRenderer.strokeColor = UIColor.blueColor() 59 | polylineRenderer.lineWidth = 5 60 | print("done") 61 | return polylineRenderer 62 | } 63 | return MKOverlayRenderer() 64 | } 65 | 66 | func numberOfSectionsInTableView(tableView: UITableView) -> Int{ 67 | return 1 68 | } 69 | 70 | func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int{ 71 | return tableData.count 72 | } 73 | 74 | 75 | func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell{ 76 | let cell: UITableViewCell = UITableViewCell(style: UITableViewCellStyle.Subtitle, reuseIdentifier: "direction") 77 | 78 | let idx:Int = indexPath.row 79 | 80 | let dictTable:NSDictionary = tableData[idx] as! NSDictionary 81 | let instruction = dictTable["instructions"] as! String 82 | let distance = dictTable["distance"] as! NSString 83 | let duration = dictTable["duration"] as! NSString 84 | let detail = "distance:\(distance) duration:\(duration)" 85 | 86 | 87 | cell.textLabel!.text = instruction 88 | cell.backgroundColor = UIColor.clearColor() 89 | cell.textLabel!.font = UIFont(name: "Helvetica Neue Light", size: 15.0) 90 | cell.selectionStyle = UITableViewCellSelectionStyle.None 91 | 92 | //cell.textLabel.font= [UIFont fontWithName:"Helvetica Neue-Light" size:15]; 93 | cell.detailTextLabel!.text = detail 94 | 95 | return cell 96 | } 97 | 98 | @IBAction func usingGoogleButtonPressed(sender:UIButton){ 99 | 100 | var origin = textfieldFrom?.text 101 | var destination = textfieldTo?.text 102 | origin = origin?.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()) 103 | destination = destination?.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()) 104 | 105 | guard let 106 | letorigin = origin, 107 | letdestination = destination 108 | where !letorigin.isEmpty && !letdestination.isEmpty else { 109 | print("enter to and from") 110 | return 111 | } 112 | 113 | self.view.endEditing(true) 114 | 115 | mapManager.directionsUsingGoogle(from: origin!, to: destination!) { (route,directionInformation, boundingRegion, error) -> () in 116 | 117 | if(error != nil){ 118 | print(error) 119 | } 120 | else{ 121 | let pointOfOrigin = MKPointAnnotation() 122 | pointOfOrigin.coordinate = route!.coordinate 123 | pointOfOrigin.title = directionInformation?.objectForKey("start_address") as! NSString as String 124 | pointOfOrigin.subtitle = directionInformation?.objectForKey("duration") as! NSString as String 125 | 126 | let pointOfDestination = MKPointAnnotation() 127 | pointOfDestination.coordinate = route!.coordinate 128 | pointOfDestination.title = directionInformation?.objectForKey("end_address") as! NSString as String 129 | pointOfDestination.subtitle = directionInformation?.objectForKey("distance") as! NSString as String 130 | 131 | let start_location = directionInformation?.objectForKey("start_location") as! NSDictionary 132 | let originLat = start_location.objectForKey("lat")?.doubleValue 133 | let originLng = start_location.objectForKey("lng")?.doubleValue 134 | 135 | let end_location = directionInformation?.objectForKey("end_location") as! NSDictionary 136 | let destLat = end_location.objectForKey("lat")?.doubleValue 137 | let destLng = end_location.objectForKey("lng")?.doubleValue 138 | 139 | let coordOrigin = CLLocationCoordinate2D(latitude: originLat!, longitude: originLng!) 140 | let coordDesitination = CLLocationCoordinate2D(latitude: destLat!, longitude: destLng!) 141 | 142 | pointOfOrigin.coordinate = coordOrigin 143 | pointOfDestination.coordinate = coordDesitination 144 | if let web = self.mapView { 145 | dispatch_async(dispatch_get_main_queue()) { 146 | self.removeAllPlacemarkFromMap(shouldRemoveUserLocation: true) 147 | web.addOverlay(route!) 148 | web.addAnnotation(pointOfOrigin) 149 | web.addAnnotation(pointOfDestination) 150 | web.setVisibleMapRect(boundingRegion!, animated: true) 151 | self.tableView?.delegate = self 152 | self.tableView?.dataSource = self 153 | self.tableData = directionInformation?.objectForKey("steps") as! NSArray 154 | self.tableView?.reloadData() 155 | } 156 | } 157 | } 158 | } 159 | } 160 | 161 | @IBAction func usingAppleButtonPressed(sender:UIButton){ 162 | let destination = textfieldToCurrentLocation?.text 163 | guard let letdestination = destination where !letdestination.isEmpty else { 164 | print("enter to and from") 165 | return 166 | } 167 | 168 | self.view.endEditing(true) 169 | 170 | locationManager = CLLocationManager() 171 | locationManager.delegate = self 172 | // locationManager.locationServicesEnabled 173 | locationManager.desiredAccuracy = kCLLocationAccuracyBest 174 | 175 | 176 | if (locationManager.respondsToSelector(Selector("requestWhenInUseAuthorization"))) { 177 | //locationManager.requestAlwaysAuthorization() // add in plist NSLocationAlwaysUsageDescription 178 | locationManager.requestWhenInUseAuthorization() // add in plist NSLocationWhenInUseUsageDescription 179 | } 180 | } 181 | 182 | func getDirectionsUsingApple() { 183 | let destination = textfieldToCurrentLocation?.text 184 | mapManager.directionsFromCurrentLocation(to: destination!) { (route, directionInformation, boundingRegion, error) -> () in 185 | if (error != nil) { 186 | print(error!) 187 | } 188 | else { 189 | if let web = self.mapView { 190 | dispatch_async(dispatch_get_main_queue()) { 191 | self.removeAllPlacemarkFromMap(shouldRemoveUserLocation: true) 192 | web.addOverlay(route!) 193 | web.setVisibleMapRect(boundingRegion!, animated: true) 194 | 195 | self.tableView?.delegate = self 196 | self.tableView?.dataSource = self 197 | self.tableData = directionInformation?.objectForKey("steps") as! NSArray 198 | self.tableView?.reloadData() 199 | 200 | } 201 | } 202 | } 203 | } 204 | } 205 | 206 | func locationManager(manager: CLLocationManager, 207 | didChangeAuthorizationStatus status: CLAuthorizationStatus) { 208 | var hasAuthorised = false 209 | var locationStatus:NSString = "" 210 | switch status { 211 | case CLAuthorizationStatus.Restricted: 212 | locationStatus = "Restricted Access" 213 | case CLAuthorizationStatus.Denied: 214 | locationStatus = "Denied access" 215 | case CLAuthorizationStatus.NotDetermined: 216 | locationStatus = "Not determined" 217 | default: 218 | locationStatus = "Allowed access" 219 | hasAuthorised = true 220 | } 221 | 222 | if(hasAuthorised == true) { 223 | getDirectionsUsingApple() 224 | } 225 | else { 226 | print("locationStatus \(locationStatus)") 227 | } 228 | } 229 | 230 | func removeAllPlacemarkFromMap(shouldRemoveUserLocation shouldRemoveUserLocation:Bool){ 231 | if let mapView = self.mapView { 232 | for annotation in mapView.annotations{ 233 | if shouldRemoveUserLocation { 234 | if annotation as? MKUserLocation != mapView.userLocation { 235 | mapView.removeAnnotation(annotation as MKAnnotation) 236 | } 237 | } 238 | } 239 | } 240 | } 241 | } 242 | 243 | -------------------------------------------------------------------------------- /Maptest/MaptestTests/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 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Maptest/MaptestTests/MaptestTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MaptestTests.swift 3 | // MaptestTests 4 | // 5 | // Created by Jimmy Jose on 18/08/14. 6 | // Copyright (c) 2014 Varshyl Mobile Pvt. Ltd. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import XCTest 11 | 12 | class MaptestTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | XCTAssert(true, "Pass") 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measureBlock() { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | MapManager 2 | ===================== 3 | 4 | Map manager is a MapKit wrapper to provide route direction drawing written entirely in Swift 5 | ---------------------------------- 6 | 7 | **Updated for XCode 7.0 and iOS 9.0.1** 8 | 9 | **Features:** 10 | > 1) Closure support 11 | > 12 | > 2) Get directions using Apple service 13 | > 14 | > 3) Get directions using Google service 15 | 16 | 17 | ---------- 18 | 19 | 20 | **Try this too:** 21 | https://github.com/varshylmobile/LocationManager 22 | 23 | 24 | ---------- 25 | 26 | 27 | Screenshot 28 | ========== 29 | **Currently these methods are available** 30 | 31 | ![Screenshot](http://imgur.com/qhytrPs.png) 32 | 33 | ---------- 34 | 35 | ![Screenshot](http://imgur.com/BpZ8XPx.png) 36 | 37 | 38 | 39 | Sample code 40 | ----------- 41 | 42 | **Directions using Apple service** 43 | 44 | var latOrigin = 37.331789 45 | var lngOrigin = -122.029620 46 | var coordinateOrigin = CLLocationCoordinate2D(latitude: latOrigin, longitude: lngOrigin) 47 | var latDestination = 37.231789 48 | var lngDestination = -122.029620 49 | var coordinateDestination = CLLocationCoordinate2D(latitude: latDestination, longitude: lngDestination) 50 | 51 | mapManager.directions(from: coordinateOrigin, to: coordinateDestination) { (route, directionInformation, boundingRegion, error) -> () in 52 | 53 | if (error? != nil) { 54 | 55 | println(error!) 56 | }else{ 57 | 58 | if let web = self.mapView?{ 59 | 60 | dispatch_async(dispatch_get_main_queue()) { 61 | 62 | web.addOverlay(route!) 63 | web.setVisibleMapRect(boundingRegion!, animated: true) 64 | 65 | } 66 | 67 | } 68 | } 69 | 70 | } 71 | 72 | 73 | **Directions using Google service** 74 | 75 | var origin = "Toronto" 76 | var destination = "Montreal" 77 | 78 | mapManager.directionsUsingGoogle(from: origin, to: destination) { (route, directionInformation, boundingRegion, error) -> () in 79 | 80 | if(error != nil){ 81 | 82 | println(error!) 83 | }else{ 84 | 85 | if let web = self.mapView?{ 86 | 87 | dispatch_async(dispatch_get_main_queue()) { 88 | web.addOverlay(route!) 89 | web.setVisibleMapRect(boundingRegion!, animated: true) 90 | } 91 | 92 | } 93 | 94 | } 95 | } 96 | 97 | ---------- 98 | 99 | Roadmap 100 | --------------- 101 | 102 | - Refactor code and use MKGeodesicPolyline 103 | - Add few more features 104 | 105 | 106 | ---------- 107 | 108 | Contributors 109 | --------------- 110 | ***All contributors will receive virtual high fives from me and for the heck of it lets forget you are a south paw*** 111 | 112 | ![enter image description here](https://dl.dropbox.com/s/n32dq4fle8fh7l4/internet-high-five.jpg) 113 | 114 | 115 | 116 | ---------- 117 | 118 | Other Repos you might like 119 | -------------------------- 120 | 121 | 1) https://github.com/varshylmobile/LocationManager 122 | 123 | > CLLocationManager wrapper in Swift, performs location update, 124 | > geocoding and reverse geocoding using Apple and Google service 125 | > 126 | 127 | 2) https://github.com/varshylmobile/VMXMLParser 128 | 129 | > NSXMLParser wrapper in Swift 130 | 131 | 3) https://github.com/varshylmobile/RateMyApp 132 | 133 | > RateMyApp is a Swift class to provide gentle reminders to app user to 134 | > rate your app 135 | 136 | 4) https://github.com/varshylmobile/TableViewCellFlip 137 | 138 | > Vertical and Horizontal flip animation for table view cell 139 | 140 | 141 | ---------- 142 | Contact Us 143 | --------------- 144 | 145 | Have any questions or suggestions feel free to write at jimmy@varshyl.com (Jimmy Jose) 146 | http://www.varshylmobile.com/ 147 | 148 | ---------- 149 | ## License 150 | 151 | The MIT License (MIT) 152 | 153 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 154 | 155 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 156 | 157 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 158 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 159 | 160 | 161 | 162 | [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/varshylmobile/mapmanager/trend.png)](https://bitdeli.com/free "Bitdeli Badge") 163 | 164 | --------------------------------------------------------------------------------