Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
p-larson authored May 31, 2021
1 parent d485856 commit edbbc8f
Showing 1 changed file with 50 additions and 5 deletions.
55 changes: 50 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
# SwiftUICardStack
# 🗂 SwiftUICardStack

A nifty way to organize & navigate a collection of views.
<img src="https://github.com/p-larson/SwiftUICardStack/blob/main/Example/SwiftUICardStack-Example/Demo%20Film/Simulator%20Screen%20Recording%20-%20iPhone%2012%20-%202021-05-28%20at%2019.37.27.gif" align="right"></img>

<img src="https://github.com/p-larson/SwiftUICardStack/blob/main/Example/SwiftUICardStack-Example/Demo%20Film/Simulator%20Screen%20Recording%20-%20iPhone%2012%20-%202021-05-28%20at%2019.37.49.gif" align="right"></img>

Create an *easy to peek* SwiftUI View to showcase your own data, catalog, images, or anything you'd like.

## Contents

- [🔭 Supported Platforms](#supported-platforms)
- [📦 Package](#package)
- [🔨 Example](#usage)
- [🧨 Extra](#extra)

## Supported Platforms

You can use the `CardStack` SwiftUI view in the following platforms:

- macOS 10.12+ 🖥
- iOS 14.0+ 📱
- tvOS 14.0+ 📺

## Package

Expand All @@ -19,7 +38,7 @@ Add a dependency in your `Package.swift`
.package(url: "https://github.com/p-larson/SwiftUICardStack", branch: "main")
```

## Basic Usage
## Usage

### Simple example

Expand All @@ -34,7 +53,13 @@ CardStack(items: data) { item in
```


### More Advanced Example

### A More Advanced Example

See Full Example Usage @ [SwiftUICardStack/Example](/Example/SwiftUICardStack-Example)

<details>
<summary> Show psuedo code </summary>

```swift
import SwiftUICardStack
Expand Down Expand Up @@ -79,4 +104,24 @@ CardStack(

```

### See Full Example Usage @ [SwiftUICardStack/Example](/Example/SwiftUICardStack-Example)
</details>

## Extra

### My Favorite Line of Code from the Package 💕

Line 17 of [Sources/SwiftUICardStack/CardStackSource.swift](/Sources/SwiftUICardStack/CardStackSource.swift)

```swift
private(set) lazy var views: Array<AnyView> = items.map(builder).map(\.eraseToAnyView)
```

**Why this is my favorite**

*I use the power of KeyPaths to type erase the data set in a short and sweet one liner!*

See [View#eraseToAnyView](/Sources/SwiftUICardStack/Common.swift)

### License

Open Source 😎

0 comments on commit edbbc8f

Please sign in to comment.