Binary Framework as Swift Package with Yandex mobile maps (full version).
Yandex mobile maps NaviKit SDK version you can find here.
Yandex mobile maps lite version you can find here.
🎉 Works on Apple silicone without Rosetta mode (you can find manual here).
- iOS 12.0
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
:
dependencies: [
.package(url: "https://github.com/c-villain/YandexMapsMobile", from: "4.2.2"),
],
or via XcodeGen insert into your project.yml
:
name: YourProjectName
options:
deploymentTarget:
iOS: 12.0
packages:
YandexMapsMobile:
url: https://github.com/c-villain/YandexMapsMobile
from: 4.2.2
targets:
YourTarget:
type: application
...
dependencies:
- package: YandexMapsMobile
Using on Apple silicon without Rosetta mode
- You should init
YMKMapView
withvulkanPreferred: true
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
- Call
YMKMapKit.sharedInstance()
inAppDelegate
as in example
/**
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:
frameworks:
"CoreFoundation",
"Foundation",
"CoreLocation",
"UIKit",
"OpenGLES",
"SystemConfiguration",
"CoreGraphics",
"QuartzCore",
"Security",
"CoreTelephony",
"CoreMotion",
"DeviceCheck"
libraries:
"resolv",
"c++"
as in the screenshot:
![Screenshot 2024-02-09 at 23 33 46](https://private-user-images.githubusercontent.com/6235615/303773600-5eb59561-9ddb-45d0-84b3-5051fefce4d3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ2MDQ0NjQsIm5iZiI6MTcyNDYwNDE2NCwicGF0aCI6Ii82MjM1NjE1LzMwMzc3MzYwMC01ZWI1OTU2MS05ZGRiLTQ1ZDAtODRiMy01MDUxZmVmY2U0ZDMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgyNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MjVUMTY0MjQ0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZDEzYzkxOTBjMWE0Nzc5NmExYzg3YzBkODAyZGU3Y2ZiYzMzZTM0NWRhZmNkYWJlMDg5YjZiNTJlYjk1YzBlMyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.Rh_7GFOewrVxC_5EgVxqEHsMIKh5kOx9HRdRwnY1auY)
YandexMapsMobile as subpackage
If you use YandexMapsMobile
as subdependency in your own package you should probably add linkerSettings
to the target for successful building:
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":
![Screenshot 2024-08-14 at 12 50 31](https://private-user-images.githubusercontent.com/6235615/357765646-abd65454-0cf2-444c-b97e-943de410db62.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ2MDQ0NjQsIm5iZiI6MTcyNDYwNDE2NCwicGF0aCI6Ii82MjM1NjE1LzM1Nzc2NTY0Ni1hYmQ2NTQ1NC0wY2YyLTQ0NGMtYjk3ZS05NDNkZTQxMGRiNjIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgyNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MjVUMTY0MjQ0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MTRkZmIzZGE2NjFlNWQwZmJiM2RkYmYwNGRmNGUyNjNjN2Q3MmNjOWVlZmMyY2ZhMWZhMWIzZDFmY2YzNmNkNCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.wxWrW567NTRy16pAe9VvfuOcTPybTjfKc5PcM9SXf80)
or via XcodeGen insert into your project.yml
:
settings:
OTHER_LDFLAGS: -ObjC -framework "DeviceCheck"
For more details look here.
to Igor Makarov for his contributing in the release v.4.0.1
👨🏻💻 Feel free to subscribe to channel SwiftUI dev in telegram.
If you like this repository, please do ⭐ to make this useful for others.