Skip to content

Commit

Permalink
Merge branch 'release/0.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Alirezaa committed Jul 27, 2019
2 parents a988fb2 + 38e866e commit 47b7042
Show file tree
Hide file tree
Showing 21 changed files with 1,724 additions and 455 deletions.
2 changes: 1 addition & 1 deletion .jazzy.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# MapirServices document generator jazzy settings

copyright: Copyright 1398 Map
author: Alireza Asadi
author: Map
xcodebuild_arguments: [-target, MapirServices-iOS]
clean: true
output: ./Documentation
2 changes: 0 additions & 2 deletions Example/Resources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>MAPIRAccessToken</key>
<string>sag</string>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
Expand Down
47 changes: 24 additions & 23 deletions Example/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class ViewController: UIViewController {
let size = CGSize(width: 300, height: 250)
let marker = MPSStaticMapMarker(coordinate: coordinates, style: MPSStaticMapMarker.Style.red, label: "mapir")

mps.getStaticMap(center: coordinates,
mps.staticMap(center: coordinates,
size: size,
zoomLevel: 15,
markers: [marker]) { (result) in
Expand All @@ -60,23 +60,23 @@ class ViewController: UIViewController {
}
}

mps.getReverseGeocode(for: coordinates) { (result) in
mps.reverseGeocode(for: coordinates) { (result) in
switch result {
case .success(let reverse):
print("getReverseGeocode method for (\(coordinates.latitude), \(coordinates.longitude)) was successful.")
print("---> address is: \(reverse.address ?? "nil")")
case .failure(let error):
print("getReverseGeocode failed with error: \(error.localizedDescription)")
print("getReverseGeocode failed with error: \(error)")
}
}

mps.getFastReverseGeocode(for: coordinates) { (result) in
mps.fastReverseGeocode(for: coordinates) { (result) in
switch result {
case .success(let reverse):
print("getFastReverseGeocode method for (\(coordinates.latitude), \(coordinates.longitude)) was successful.")
print("---> address is: \(reverse.address ?? "nil")")
case .failure(let error):
print("getFastReverseGeocode failed with error: \(error.localizedDescription)")
print("getFastReverseGeocode failed with error: \(error)")
}
}

Expand All @@ -88,10 +88,10 @@ class ViewController: UIViewController {
let origins = [pointA, pointB]
let destinations = [pointC, pointD]

mps.getDistanceMatrix(from: origins, to: destinations, options: .sorted) { (result) in
mps.distanceMatrix(from: origins, to: destinations, options: .sorted) { (result) in
switch result {
case .failure(let error):
print("getDistanceMatrix failed with error: \(error.localizedDescription)")
print("getDistanceMatrix failed with error: \(error)")
case .success(let distanceMartix):
print("getDistanceMatrix method was successful.")
print("---> address is: \(distanceMartix)")
Expand All @@ -100,39 +100,40 @@ class ViewController: UIViewController {

let stringToSearch = "ساوجی نیا"

mps.getSearchResult(for: stringToSearch, around: coordinates, selectionOptions: [.poi, .roads], filter: .city("تهران")) { (result) in
mps.search(for: stringToSearch, around: coordinates, selectionOptions: [.poi, .roads], filter: .city("تهران")) { (result) in
switch result {
case .success(let searchResult):
print("getSearchResult method was successful.")
print("---> Search result is: \(searchResult)")
case .failure(let error):
print("getSearchResult failed with error: \(error.localizedDescription)")
print("getSearchResult failed with error: \(error)")
}
}

mps.getAutocompleteSearchResult(for: stringToSearch, around: coordinates, selectionOptions: [.poi, .roads]) { (result) in
mps.autocomplete(for: stringToSearch, around: coordinates, selectionOptions: [.poi, .roads]) { (result) in
switch result {
case .success(let searchResult):
print("getAutocompleteSearchResult method was successful.")
print("---> Autocomplete search result is: \(searchResult)")
case .failure(let error):
print("getAutocompleteSearchResult failed with error: \(error.localizedDescription)")
print("getAutocompleteSearchResult failed with error: \(error)")
}
}

mps.getRoute(from: pointA,
to: [pointB, pointC],
routeType: .drivingNoExclusion,
routeOptions: .calculateAlternatives) { (result) in
switch result {
case .success(let route):
print("getRoute method was successful.")
print("---> Route result is: \(route)")
case .failure(let error):
print("getRoute failed with error: \(error)")
}
}
mps.route(from: pointA,
to: [pointB, pointC],
routeMode: .drivingNoExclusion,
routeOptions: .calculateAlternatives) { (result) in

switch result {
case .success(let (waypoint, route)):
print("getRoute method was successful.")
print("---> Waypoint result(s) is: \(waypoint)")
print("---> Route result(s) is: \(route)")
case .failure(let error):
print("getRoute failed with error: \(error)")
}
}
}

/// LoadView
Expand Down
41 changes: 23 additions & 18 deletions MapirServices.podspec
Original file line number Diff line number Diff line change
@@ -1,36 +1,41 @@
Pod::Spec.new do |s|

s.name = "MapirServices"
s.version = "0.1.0"
s.version = "0.2.0"
s.summary = "a SDK to access services of map.ir."

s.homepage = "https://support.map.ir/"
s.social_media_url = 'https://twitter.com/map_ir_Official'
s.license = { :type => "MIT", :file => "LICENSE" }

s.author = { "Map.ir" => "[email protected]" }
s.source = { :git => "https://github.com/map-ir/ios-sdk-v1-services-beta", :tag => s.version }
s.author = { "Map.ir" => "[email protected]",
"Alireza Asadi" => "[email protected]" }
s.documentation_url = 'https://support.map.ir/developers/iservice/'
s.source = { :git => "https://github.com/map-ir/ios-sdk-v1-services-beta", :tag => s.version.to_s }

s.platform = :ios
s.ios.deployment_target = "10.0"
s.module_name = "MapirServiecs"

# ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
# --- iOS ------------------------------------------------- #
s.ios.deployment_target = '9.0'
s.ios.framework = 'UIKit'

s.source_files = "Sources/**/*.swift"
# --- macOS ----------------------------------------------- #
s.osx.deployment_target = '10.10'
s.osx.framework = 'AppKit'

# ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
# --- watchOS --------------------------------------------- #
s.watchos.deployment_target = '3.0'
s.watchos.framework = 'UIKit'

s.resources = ['MapirServices/Resources/*/*', 'MapirServices/Resources/*']
# --- tvOS ------------------------------------------------ #
s.tvos.deployment_target = '9.0'
s.tvos.framework = 'UIKit'

# ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
s.requires_arc = true
s.module_name = "MapirServiecs"
s.swift_version = '5.0'
s.source_files = "Sources/**/*.{swift, h}"

s.requires_arc = true
s.frameworks = "Foundation", "CoreLocation"

s.dependency "Polyline", "~> 4.2.1"

s.swift_version = '5.0'


s.frameworks = "Foundation", "CoreLocation"

end
Loading

0 comments on commit 47b7042

Please sign in to comment.