Skip to content

Commit

Permalink
Merge pull request #44 from dscyrescotti/feature/carousel-stack
Browse files Browse the repository at this point in the history
Feature/carousel stack
  • Loading branch information
dscyrescotti authored Oct 2, 2022
2 parents 90cc80f + 82808a1 commit 601a1f3
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 4 deletions.
Binary file modified Assets/ShuffleIt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 29 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,33 @@
</table>

## 💡 Features
- [CarouselStack](#carouselstack)
- [ShuffleStack](#shufflestack)
> For now, **ShuffleIt** only provides **ShuffleStack** view. (🚨 Spoiler Alert - There will be very soon various types of stack views coming.)
> For now, **ShuffleIt** only provides **CarouselStack** and **ShuffleStack** views. (🚨 Spoiler Alert - There will be very soon various types of stack views coming.)
### CarouselStack <a id="carouselstack"></a>
**CarouselStack** is a stack view with sliding behaviour on the stack of content views with carousel effect. Just like **ShuffleStack**, it doesn't render all content views but it renders at most five content views which is enough to display content views with sliding animation. Besides, it provides customizablae modifiers to modify the view's appearance so that it is easy to adjust to what is desired.

#### Usage
```swift
let colors: [Color] = [.blue, .brown, .black, .cyan, .green, .indigo, .pink, .purple, .red, .orange, .yellow]
var body: some View {
CarouselStack(
colors,
initialIndex: 0
) { color in
color
.frame(height: 200)
.cornerRadius(16)
}
}
```
<details>
<summary>Preview</summary>
<img src="https://github.com/dscyrescotti/ShuffleIt/blob/main/Assets/Previews/CarouselStack-Preview.gif?raw=true" alt="CarouselStack-Preview" width="30%"/>
</details>

To explore more about **CarouselStack**, check out the [documentation](https://dscyrescotti.github.io/ShuffleIt/documentation/shuffleit/carouselstack/).

### ShuffleStack <a id="shufflestack"></a>
**ShuffleStack** is a stack view with shuffling behaviour on the stack of content views which will be useful as a banner. Not like normal stack view, it only renders three content views visible on the screen and switches data of content views based on the current index. As it comes with a bunch of modifiers, it is highly customizable to get the desired appearance.
Expand All @@ -61,6 +86,8 @@ var body: some View {

To explore more about **ShuffleStack**, check out the [documentation](https://dscyrescotti.github.io/ShuffleIt/documentation/shuffleit/shufflestack/).

> Starting from Version 2.0.0, there are some changes which rename some modifiers and some types of ShuffleStack. Please check out [documentation](https://dscyrescotti.github.io/ShuffleIt/documentation/shuffleit/shufflestack/) to update your code accordingly.
## ⚠️ Requirements
- iOS 15+, macOS 12+, watchOS 8+, tvOS 15+
> ShuffleIt is developed using Xcode 13.3.1. Make sure you are using Xcode 13.3.1 and above.
Expand All @@ -70,7 +97,7 @@ To explore more about **ShuffleStack**, check out the [documentation](https://ds
Add it as a dependency within your Package.swift.
```
dependencies: [
.package(url: "https://github.com/dscyrescotti/ShuffleIt.git", from: "1.0.1")
.package(url: "https://github.com/dscyrescotti/ShuffleIt.git", from: "2.0.0")
]
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ final class CarouselStackTests: BaseTestCase {
.carouselStyle(.finiteScroll),
size: .init(width: 300, height: 800)
)
self.wait(for: [exp], timeout: 0.2)
self.wait(for: [exp], timeout: 0.3)
}
#endif
}
2 changes: 1 addition & 1 deletion Tests/ShuffleItTests/ShuffleStack/ShuffleStackTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ final class ShuffleStackTests: BaseTestCase {
.shuffleStyle(.rotateOut),
size: .init(width: 300, height: 800)
)
self.wait(for: [exp], timeout: 0.2)
self.wait(for: [exp], timeout: 0.3)
}
#endif
}

0 comments on commit 601a1f3

Please sign in to comment.