https://github.com/surfstudio/surf-yandex-maps-ios-sdk-full
https://github.com/surfstudio/surf-yandex-maps-ios-sdk-full
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/surfstudio/surf-yandex-maps-ios-sdk-full
- Owner: surfstudio
- Created: 2024-05-03T13:38:30.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-04T09:28:08.000Z (about 1 year ago)
- Last Synced: 2025-01-25T22:57:36.558Z (9 months ago)
- Language: Swift
- Size: 8.79 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# YandexMapsMobile, Full version
Binary Framework as Swift Package with Yandex mobile maps (full version).
Yandex mobile maps lite version you can find [here](https://github.com/surfstudio/surf-yandex-maps-ios-sdk).
🎉 Works on Apple silicone without Rosetta mode.
## Requirements
- iOS 13.0
## Swift Package Manager
To integrate YandexMapsMobile into your project using SwiftPM do this 👇🏻
- File > Swift Packages > Add Package Dependency
- Add `https://github.com/surfstudio/surf-yandex-maps-ios-sdk-full.git`
- Select "Up to Next Major" with "4.8.0"
or add the following code to your `Package.swift`:
```swift
dependencies: [
.package(url: "https://github.com/surfstudio/surf-yandex-maps-ios-sdk-full.git", revision: "4.8.0"),
],
```
or via [XcodeGen](https://github.com/yonaskolb/XcodeGen) insert into your `project.yml`:
```yaml
name: YourProjectName
options:
deploymentTarget:
iOS: 13.0
packages:
YandexMapsMobile:
url: https://github.com/surfstudio/surf-yandex-maps-ios-sdk-full
from: 4.8.0
targets:
YourTarget:
type: application
...
dependencies:
- package: YandexMapsMobile
```
## Recommedations to use
Using on Apple silicon without Rosetta mode
1. You should init `YMKMapView` with `vulkanPreferred: true`
```swift
YMKMapView.init(frame: .zero, vulkanPreferred: isM1Simulator())
....
#if targetEnvironment(simulator)
public static func isM1Simulator() -> Bool {
return TARGET_CPU_ARM64 != 0
}
#else
public static func isM1Simulator() -> Bool { false }
#endif
```
2. Call `YMKMapKit.sharedInstance()` in `AppDelegate` as in [example](https://github.com/yandex/mapkit-ios-demo/blob/master/MapKitDemo/AppDelegate.swift)
```swift
/**
If you create instance of YMKMapKit not in application:didFinishLaunchingWithOptions:
you should also explicitly call YMKMapKit.sharedInstance().onStart()
*/
YMKMapKit.sharedInstance()
```
Latest recommendations for project settings
to build project you should add following *linker flags* in the *Build Settings* tab:
```yaml
frameworks:
"CoreFoundation",
"Foundation",
"CoreLocation",
"UIKit",
"OpenGLES",
"SystemConfiguration",
"CoreGraphics",
"QuartzCore",
"Security",
"CoreTelephony",
"CoreMotion"
libraries:
"resolv",
"c++"
```
as in the screenshot:
YandexMapsMobile as subpackage
If you use `YandexMapsMobile` as subdependency in your own package you should probably add `linkerSettings` to the target for successful building:
```swift
targets: [
.target(
name: "Your target",
dependencies: [
.product(name: "YandexMapsMobile", package: "surf-yandex-maps-ios-sdk-full")
],
linkerSettings: [ // <===== ‼️LOOK HERE‼️
.linkedFramework("CoreLocation"),
.linkedFramework("CoreTelephony"),
.linkedFramework("SystemConfiguration"),
.linkedFramework("CoreMotion"),
.linkedFramework("DeviceCheck"),
.linkedLibrary("c++"),
.unsafeFlags(["-ObjC"]),
]),
]
```
## Special thanks
Based on work in this [repo](https://github.com/c-villain/YandexMapsMobile) ❤️