Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/map-ir/mapir-ios-sdk-services
A wrapper to access services of Map.ir in a Swift-y way.
https://github.com/map-ir/mapir-ios-sdk-services
cocoapods ios swift xcode
Last synced: 4 days ago
JSON representation
A wrapper to access services of Map.ir in a Swift-y way.
- Host: GitHub
- URL: https://github.com/map-ir/mapir-ios-sdk-services
- Owner: map-ir
- License: mit
- Created: 2019-07-17T08:50:36.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-06-09T15:06:09.000Z (over 4 years ago)
- Last Synced: 2024-09-17T22:35:35.669Z (4 months ago)
- Topics: cocoapods, ios, swift, xcode
- Language: Swift
- Homepage: https://support.map.ir
- Size: 1.61 MB
- Stars: 2
- Watchers: 6
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MapirServices
ℹ️ MapirServices framework, brings you easy access to Map.ir APIs and services.
## Example
The example application is the best way to see `MapirServices` in action. Simply open the `MapirServices.xcodeproj` and run the `MapirServices Swift Example` scheme.
## Installation
### CocoaPods
MapirServices is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
pod 'MapirServices'
```### Carthage
[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.
To integrate MapirServices into your Xcode project using Carthage, specify it in your `Cartfile`:
```ogdl
github "map-ir/mapir-ios-sdk-services"
```Run `carthage update` to build the framework and drag the built `MapirServices.framework` into your Xcode project.
On your application targets’ “Build Phases” settings tab, click the “+” icon and choose “New Run Script Phase” and add the Framework path as mentioned in [Carthage Getting started Step 4, 5 and 6](https://github.com/Carthage/Carthage/blob/master/README.md#if-youre-building-for-ios-tvos-or-watchos)
### Swift Package Manager
To integrate using Apple's [Swift Package Manager](https://swift.org/package-manager/), add the following as a dependency to your `Package.swift`:
```swift
dependencies: [
.package(url: "https://github.com/map-ir/mapir-ios-sdk-services", from: "1.0.0")
]
```### Manually
If you prefer not to use any of the a forementioned dependency managers, you can integrate MapirServices into your project manually. Simply drag the `Sources` Folder into your Xcode project. (not recommended)
## Usage
1. Get an access token from [App Registration](https://corp.map.ir/registration/) site.
2. Add a key-value pair of your access token to your project's `info.plist`. Key must be "`MapirAPIKey`" and set the access token as value.
3. First import SDK using
```swift
import MapirServices
```
4. Create an instance of a class you need.
```swift
// It's used for geocoding addresses (not available at this moment) and reverse-geocoding coordintes.
let geocoder = Geocoder()
// Can be used to search over Map.ir data of places and any other geographical place.
let search = Search()
// `Directions` brings routing features to you.
// Using `Directions` you can find multiple routes between multiple waypoints, considering restrictions and traffic situation.
let directions = Directions()
// Use `Geofence` to manipulate fences that are associated with you API Key on Map.ir.
let geofence = Geofence()
// `MapSnapshotter` is used to create static image of piece of the map.
let snapshotter = MapSnapshotter()
// It's used to calculate the distance and duration between multiple origins and multiple destinations.
let distanceMatrix = DistanceMatrix()
```
## LicenseSee LICENSE file.