An open API service indexing awesome lists of open source software.

https://github.com/sdwebimage/sdwebimagemapkitplugin

A SDWebImage plugin to support MapKit integration
https://github.com/sdwebimage/sdwebimagemapkitplugin

Last synced: 6 months ago
JSON representation

A SDWebImage plugin to support MapKit integration

Awesome Lists containing this project

README

          

# SDWebImageMapKitPlugin

[![CI Status](https://img.shields.io/travis/SDWebImage/SDWebImageMapKitPlugin.svg?style=flat)](https://travis-ci.org/SDWebImage/SDWebImageMapKitPlugin)
[![Version](https://img.shields.io/cocoapods/v/SDWebImageMapKitPlugin.svg?style=flat)](https://cocoapods.org/pods/SDWebImageMapKitPlugin)
[![License](https://img.shields.io/cocoapods/l/SDWebImageMapKitPlugin.svg?style=flat)](https://cocoapods.org/pods/SDWebImageMapKitPlugin)
[![Platform](https://img.shields.io/cocoapods/p/SDWebImageMapKitPlugin.svg?style=flat)](https://cocoapods.org/pods/SDWebImageMapKitPlugin)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-brightgreen.svg?style=flat)](https://github.com/SDWebImage/SDWebImageMapKitPlugin)
[![SwiftPM compatible](https://img.shields.io/badge/SwiftPM-compatible-brightgreen.svg?style=flat)](https://swift.org/package-manager/)
[![codecov](https://codecov.io/gh/SDWebImage/SDWebImageMapKitPlugin/branch/master/graph/badge.svg)](https://codecov.io/gh/SDWebImage/SDWebImageMapKitPlugin)

## What's for
SDWebImageMapKitPlugin is a plugin for [SDWebImage](https://github.com/rs/SDWebImage/) framework, which provide the [MapKit](https://developer.apple.com/documentation/mapkit) integration and category.

SDWebImage previously have a subspec to hold these integration code, however, since this is not the core feature of SDWebImage, due to the project maintain issue, we move the MapKit integration into a standalone framework.

## Requirements

+ iOS 8+
+ macOS 10.10+
+ tvOS 9.2+
+ Xcode 11+

## Installation

#### CocoaPods

SDWebImageMapKitPlugin is available through [CocoaPods](https://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod 'SDWebImageMapKitPlugin'
```

#### Carthage

SDWebImageMapKitPlugin is available through [Carthage](https://github.com/Carthage/Carthage).

```
github "SDWebImage/SDWebImageMapKitPlugin"
```

#### Swift Package Manager (Xcode 11+)

SDWebImageMapKitPlugin is available through [Swift Package Manager](https://swift.org/package-manager).

```swift
let package = Package(
dependencies: [
.package(url: "https://github.com/SDWebImage/SDWebImageMapKitPlugin.git", from: "0.1")
]
)
```

## Usage

+ Objective-C

```objective-c
MKAnnotationView *annotationView;
NSURL *imageURL;
[annotationView sd_setImageWithURL:imageURL];
```

+ Swift

```swift
let annotationView: MKAnnotationView
let imageURL: URL
annotationView.sd_setImage(with: imageURL)
```

## Demo

If you have some issue about usage, SDWebImageMapKitPlugin provide a demo for iOS && macOS platform. To run the demo, clone the repo and run the following command.

```bash
cd Example/
pod install
open SDWebImageMapKitPlugin.xcworkspace
```

After the Xcode project was opened, click `Run` to build and run the demo.

## Screenshot

The annotation pin icon is from [icons8.com](https://icons8.com/icon/19326/map-pin)

## Author

DreamPiggy

## License

SDWebImageMapKitPlugin is available under the MIT license. See the LICENSE file for more info.