Swiftpack.co - c-villain/YandexMapsMobile as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by c-villain.
c-villain/YandexMapsMobile 4.5.1
Yandex Maps Mobile full Swift package
⭐️ 23
🕓 3 weeks ago
iOS
.package(url: "https://github.com/c-villain/YandexMapsMobile.git", from: "4.5.1")

YandexMapsMobile

Latest release

contact: @lexkraev Telegram Group

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).

Requirements

  • iOS 12.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:

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

Recommedations to use

Using on Apple silicon without Rosetta mode
  1. You should init YMKMapView with vulkanPreferred: 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

  1. Call YMKMapKit.sharedInstance() in AppDelegate 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"
libraries:
    "resolv",
    "c++"

as in the screenshot:

Screenshot 2024-02-09 at 23 33 46
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:

Screenshot 2023-12-01 at 18 18 24

or via XcodeGen insert into your project.yml:

settings:
  OTHER_LDFLAGS: -ObjC

For more details look here.

Special thanks

to Igor Makarov for his contributing in the release v.4.0.1

Communication

👨🏻‍💻 Feel free to subscribe to channel SwiftUI dev in telegram.

If you like this repository, please do :star: to make this useful for others.

GitHub

link
Stars: 23
Last commit: 3 weeks ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

4.5.1
3 weeks ago

updated to 4.5.1

Release notes you can find here

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics