https://github.com/c-villain/yandexmapsmobile
Yandex Maps Mobile full Swift package
https://github.com/c-villain/yandexmapsmobile
ios swiftpm yandex yandexmapkit yandexmaps
Last synced: 6 months ago
JSON representation
Yandex Maps Mobile full Swift package
- Host: GitHub
- URL: https://github.com/c-villain/yandexmapsmobile
- Owner: c-villain
- Created: 2022-05-05T10:43:03.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-06T10:26:48.000Z (8 months ago)
- Last Synced: 2025-03-26T05:51:07.073Z (7 months ago)
- Topics: ios, swiftpm, yandex, yandexmapkit, yandexmaps
- Language: Swift
- Homepage: https://t.me/swiftui_dev
- Size: 56.6 KB
- Stars: 32
- Watchers: 1
- Forks: 9
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# YandexMapsMobile
[](https://github.com/c-villain/YandexMapsMobile/releases/latest)
[](https://swiftpackageindex.com/c-villain/YandexMapsMobile)
[](https://swiftpackageindex.com/c-villain/YandexMapsMobile)
[](https://swift.org/package-manager/)[](https://t.me/lexkraev)
[](https://telegram.dog/swiftui_dev)Binary Framework as Swift Package with Yandex mobile maps (full version).
Yandex mobile maps NaviKit SDK version you can find [here](https://github.com/c-villain/YandexMapsMobileNaviKit).
Yandex mobile maps lite version you can find [here](https://github.com/c-villain/YandexMapsMobileLite).
🎉 Works on Apple silicone without Rosetta mode (you can find manual [here](https://github.com/c-villain/YandexMapsMobile/releases)).
## 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/c-villain/YandexMapsMobile.git`
- Select "Up to Next Major" with "4.2.2"or add the following code to your `Package.swift`:
```swift
dependencies: [
.package(url: "https://github.com/c-villain/YandexMapsMobile", from: "4.2.2"),
],
```
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/c-villain/YandexMapsMobile
from: 4.2.2
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",
"DeviceCheck"
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: "YandexMapsMobile")
],
linkerSettings: [ // <===== ‼️LOOK HERE‼️
.linkedFramework("CoreLocation"),
.linkedFramework("CoreTelephony"),
.linkedFramework("SystemConfiguration"),
.linkedLibrary("c++"),
.unsafeFlags(["-ObjC"]),
]),
]
```or add in the projects settings -ObjC and framework "DeviceCheck":
or via [XcodeGen](https://github.com/yonaskolb/XcodeGen) [insert](https://github.com/yonaskolb/XcodeGen/issues/639) into your `project.yml`:
```yaml
settings:
OTHER_LDFLAGS: -ObjC -framework "DeviceCheck"
```
For more details look [here](https://github.com/c-villain/YandexMapsMobile/issues/5).## Special thanks
to [Igor Makarov](https://github.com/igor-makarov) for his contributing in the release [v.4.0.1](https://github.com/c-villain/YandexMapsMobile/releases/tag/4.0.1)
## Communication
👨🏻💻 Feel free to subscribe to channel **[SwiftUI dev](https://t.me/swiftui_dev)** in telegram.
If you like this repository, please do :star: to make this useful for others.