Giter VIP home page Giter VIP logo

yandexmapsmobile's Introduction

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 ⭐ to make this useful for others.

yandexmapsmobile's People

Contributors

c-villain avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

yandexmapsmobile's Issues

+[YMKMapKit setApiKey:]: unrecognized selector sent to class

Стянул к себе либу, Подключил, но ни в какую не хочет заводится.

Падает на первом же методе setApiKey. Использую версию 4.2.2.

Нашёл инфу, что в пакет нужно добавь настройку линковки: yandex/mapkit-ios-demo#130, нужно ли добавлять что то еще в сам проект?

2023-05-16 18:12:50.224686+0300 [18014:145964] +[YMKMapKit setApiKey:]: unrecognized selector sent to class 0x103c8ec60
2023-05-16 18:12:50.232871+0300 [18014:145964] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[YMKMapKit setApiKey:]: unrecognized selector sent to class 0x103c8ec60'
*** First throw call stack:
(
0 CoreFoundation 0x0000000180437330 __exceptionPreprocess + 172
1 libobjc.A.dylib 0x0000000180051274 objc_exception_throw + 56
2 CoreFoundation 0x0000000180445d3c __CFExceptionProem + 0
3 CoreFoundation 0x000000018043b224 forwarding + 1308
4 CoreFoundation 0x000000018043d50c _CF_forwarding_prep_0 + 92
5 0x0000000102aa54f8 $s811AppDelegateC11application_29didFinishLaunchingWithOptionsSbSo13UIApplicationC_SDySo0j6LaunchI3KeyaypGSgtF + 280
6 0x0000000102aa6a64 $s811AppDelegateC11application_29didFinishLaunchingWithOptionsSbSo13UIApplicationC_SDySo0j6LaunchI3KeyaypGSgtFTo + 196
7 UIKitCore 0x00000001126d3ac0 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 292
8 UIKitCore 0x00000001126d5008 -[UIApplication _callInitializationDelegatesWithActions:forCanvas:payload:fromOriginatingProcess:] + 2776
9 UIKitCore 0x00000001126d9c08 -[UIApplication _runWithMainScene:transitionContext:completion:] + 856
10 UIKitCore 0x0000000111e2e240 -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] + 148
11 UIKitCore 0x00000001126d6c7c -[UIApplication _compellApplicationLaunchToCompleteUnconditionally] + 44
12 UIKitCore 0x00000001126d6fcc -[UIApplication _run] + 832
13 UIKitCore 0x00000001126daf3c UIApplicationMain + 124
14 libswiftUIKit.dylib 0x0000000106904454 $s5UIKit17UIApplicationMainys5Int32VAD_SpySpys4Int8VGGSgSSSgAJtF + 100
15 0x0000000102aa5380 $sSo21UIApplicationDelegateP5UIKitE4mainyyFZ + 120
16 0x0000000102aa52f8 $s811AppDelegateC5$mainyyFZ + 44
17 0x0000000102aa6c88 main + 28
18 dyld 0x00000001056dd514 start_sim + 20
19 ??? 0x00000001057d9f28 0x0 + 4387086120
20 ??? 0x0669800000000000 0x0 + 462041174270541824
)
libc++abi: terminating due to uncaught exception of type NSException

Cannot find 'YMKSearchBusinessPhotoObjectMetadata' in scope

Подключил версию библиотеки 4.3.2 к легаси проекту
При использовании класса "YMKSearchBusinessPhotoObjectMetadata" выводиться ошибка "Cannot find 'YMKSearchBusinessPhotoObjectMetadata' in scope".
Яндекс подтвердили что этот класс устарел, но нигде в документации я не нашел аналоги как можно получить метаданные изображений обьекта на карте. Есть ли информация на аналогичные классы или методы в новых версиях библиотеки?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.