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

https://github.com/cuadros-code/project-14-swiftui-bucketlist

Project 14 Bucket List
https://github.com/cuadros-code/project-14-swiftui-bucketlist

Last synced: 8 months ago
JSON representation

Project 14 Bucket List

Awesome Lists containing this project

README

          

# Bucket List

## Struct Comparable
- Add protocol `Comparable`

```swift
struct User: Identifiable, Comparable {

let id = UUID()
var firstName: String
var lastName: String

// Required when add Comparable protocol
static func < (lhs: User, rhs: User) -> Bool {
lhs.firstName < rhs.firstName
}

}
```

- Use
```swift
let users = [
User(firstName: "Kevin", lastName: "Cuadros"),
User(firstName: "Andres", lastName: "Montes"),
User(firstName: "Camila", lastName: "Torrez")
].sorted()
```

## Map

- Marker Types
```swift
Marker(location.name, coordinate: location.coordinate)
```

```swift
Annotation(location.name, coordinate: location.coordinate) {
Text(location.name)
.font(.headline)
.padding()
.background(.blue.gradient)
.foregroundStyle(.white)
.clipShape(.capsule)
}
.annotationTitles(.hidden)
```