-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
68 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,86 @@ | ||
# Backpack-SwiftUI/Badge | ||
# Backpack-SwiftUI/MapMarker | ||
|
||
[![Cocoapods](https://img.shields.io/cocoapods/v/Backpack-SwiftUI.svg?style=flat)](hhttps://cocoapods.org/pods/Backpack-SwiftUI) | ||
[![class reference](https://img.shields.io/badge/Class%20reference-iOS-blue)](https://backpack.github.io/ios/versions/latest/swiftui/Structs/BPKBadge.html) | ||
[![view on Github](https://img.shields.io/badge/Source%20code-GitHub-lightgrey)](https://github.com/Skyscanner/backpack-ios/tree/main/Backpack-SwiftUI/Badge) | ||
|
||
## Default | ||
[![class reference](https://img.shields.io/badge/Class%20reference-iOS-blue) Price Marker](https://backpack.github.io/ios/versions/latest/swiftui/Structs/BPKPriceMapMarker.html) | ||
[![class reference](https://img.shields.io/badge/Class%20reference-iOS-blue) Pointer Marker](https://backpack.github.io/ios/versions/latest/swiftui/Structs/BPKPointerMapMarker.html) | ||
[![class reference](https://img.shields.io/badge/Class%20reference-iOS-blue) Poi Marker](https://backpack.github.io/ios/versions/latest/swiftui/Structs/BPKPoiMapMarker.html) | ||
[![view on Github](https://img.shields.io/badge/Source%20code-GitHub-lightgrey)](https://github.com/Skyscanner/backpack-ios/tree/main/Backpack-SwiftUI/MapMarker) | ||
|
||
| Day | Night | | ||
| --- | --- | | ||
| <img src="https://raw.githubusercontent.com/Skyscanner/backpack-ios/main/screenshots/iPhone-swiftui_badge___default_lm.png" alt="" width="375" /> |<img src="https://raw.githubusercontent.com/Skyscanner/backpack-ios/main/screenshots/iPhone-swiftui_badge___default_dm.png" alt="" width="375" /> | | ||
| <img src="https://raw.githubusercontent.com/Skyscanner/backpack-ios/main/screenshots/iPhone-swiftui_map-markers___default_lm.png" alt="" width="375" /> |<img src="https://raw.githubusercontent.com/Skyscanner/backpack-ios/main/screenshots/iPhone-swiftui_map-markers___default_dm.png" alt="" width="375" /> | | ||
|
||
## Usage | ||
|
||
### Basic text badge | ||
If you don't specify a `.badgeStyle(<style>)` it will use the `.default` type | ||
## Price Marker | ||
|
||
The Price Marker receives a price string and a status. The status can be one of the following: | ||
|
||
```swift | ||
public enum BPKPriceMapMarkerStatus { | ||
case `default` | ||
case focused | ||
case viewed | ||
case disabled | ||
} | ||
``` | ||
|
||
### Default Price Marker | ||
|
||
```swift | ||
BPKPriceMapMarker(status: .default, price: "£123") | ||
``` | ||
|
||
### Focused Price Marker | ||
|
||
```swift | ||
BPKPriceMapMarker(status: .focused, price: "£123") | ||
``` | ||
|
||
### Viewed Price Marker | ||
|
||
```swift | ||
BPKPriceMapMarker(status: .viewed, price: "£123") | ||
``` | ||
|
||
### Disabled Price Marker | ||
|
||
```swift | ||
BPKPriceMapMarker(status: .disabled, price: "Sold out") | ||
``` | ||
|
||
## Pointer Marker | ||
|
||
```swift | ||
BPKPointerMapMarker() | ||
``` | ||
|
||
## Poi Marker | ||
|
||
The Poi Marker receives an icon and a status. The status can be one of the following: | ||
|
||
```swift | ||
import Backpack_SwiftUI | ||
public enum BPKPoiMapMarkerStatus { | ||
case `default` | ||
case focused | ||
case disabled | ||
} | ||
``` | ||
|
||
BPKBadge("Hello World") | ||
### Default Poi Marker | ||
|
||
BPKBadge("Hello World") | ||
.badgeStyle(.destructive) | ||
```swift | ||
BPKPoiMapMarker(status: .default, icon: .landmark) | ||
``` | ||
|
||
### Badge with icon | ||
If you don't specify a `.badgeStyle(<style>)` it will use the `.default` type | ||
### Focused Poi Marker | ||
|
||
```swift | ||
import Backpack_SwiftUI | ||
BPKPoiMapMarker(status: .focused, icon: .landmark) | ||
``` | ||
|
||
BPKBadge("Hello World", icon: .tickCircle) | ||
### Disabled Poi Marker | ||
|
||
BPKBadge("Hello World", icon: .tickCircle) | ||
.badgeStyle(.destructive) | ||
``` | ||
```swift | ||
BPKPoiMapMarker(status: .disabled, icon: .landmark) | ||
``` |