- August 12, 2025
- Mins Read
At the begin, I didn’t encapsulate code, @luxorules refactor code into class and improve it to support not only image, then I encapsulate my code into class. So, there are two choices.
Here is CardContainerView API reference. CardContainerView supports custom card size, pan gesture.
Example:
let cardContainerView = CardContainerView(frame: aFrame)// with defalut card size.
cardContainerView.dataSource = id<CardContainerDataSource>
Done.
public protocol CardContainerDataSource: class{
func numberOfCards(for cardContainerView: UICardContainerView) -> Int
func cardContainerView(_ cardContainerView: UICardContainerView, imageForCardAt index: Int) -> UIImage?
}
CardAnimationView supports custom card size, pan gesture.
Usage is simple also:
let cardAnimationView = CardAnimationView.init(frame: aFrame)// with defalut card size.
cardAnimationView.dataSourceDelegate = id<CardAnimationViewDataSource>
It adds a little complexity to exchange for: custom card view(not only image).
protocol CardAnimationViewDataSource : class {
func numberOfVisibleCards() -> Int
func numberOfCards() -> Int
// Return view displayed in the CardAnimationView. If reusedView is not nil,
// you could configure and return it to reuse it.
func cardNumber(number:Int, reusedView:BaseCardView?) -> BaseCardView
}
Classes:
Recognize your user's voice elegantly without having to figure out authorization and audio engines. SwiftSpeech Examples Features Installation Getting Started ...
Example To run the example project, clone the repo, and run pod install from the Example directory first. Requirements iOS 14.0 Installation ...
SlidingRuler is a Swift package containing a SwiftUI control that acts like an linear infinite slider or a finite, more precise ...
SkeletonUI aims to bring an elegant, declarative syntax to skeleton loading animations. Get rid of loading screens or spinners and ...