Latest 1.1.0
License MIT
Platforms ios 9.0
Frameworks UIKit


## Basic Overview
Showcase is a UIView based view to display any views in the frame, like you display figures in a shelf or showcase.

## Feature
– Protocol based – Type-safe for view and model, does not require overriding any special view.
– Looping – Loop first cell to last cell or last cell to first cell being reused.
– Paging – Can enable showcase cell size paging.
– Layout – Customize your own layout.

## Installation

### [CocoaPods](
Add the following to your Podfile:

target ‘TargetName’ do
pod ‘Showcase’

### [Carthage](
Add the following to your Package.swift:
github “h-yuya/Showcase”

## How to Use
Configure UIView in the storyboard and set custom class to `Showcase`
#### First, make a view you want to display and model are needed for configuration of the view conform to `ReusableView` and `ReusableModel` protocol.
import UIKit
import Showcase

struct ColorModel: ReusableModel {
let color: UIColor

init(color: UIColor) {
self.color = color

final class ColorView: ReusableView {
typealias Model = ColorModel

func configure(with model: ColorModel) {
backgroundColor = model.color

override func awakeFromNib() {

private extension ColorView {
func configureAppearance() {
layer.cornerRadius = 30
clipsToBounds = true
– `typealias Model`
– `Model` is a model to configure the view
– `typealias` it to any model conforming to `ReusableModel` .

– `func configure(with model: Model)`
– As its name suggests, configure the view with `Model`

#### Second, configure showcase in the ViewController.
import UIKit
import Showcase

final class ColorViewController: UIViewController {
// UIView is the super class of Showcase
@IBOutlet fileprivate weak var showcase: Showcase!
fileprivate let colors: [UIColor] = [.red, .green, .blue, .yellow, .gray]

override func viewDidLoad() {

private extension ColorViewController {
func configure() {
let models =

showcase.layout.direction = .horizontal
showcase.layout.itemSize = .init(width: 300, height: 300)

// registered view is able to be used for resetting showcase.
showcase.register(byNibName: ColorView.self)

// Type-safely reset the showcase. You can call this method any number of times.
// views used for resetting must be registered before resetting.
showcase.reset(ColorView.self, models: models)

// The type is used as the identifier for reuse
#### Everything has done. Let’s watch the demo.


Do you want to do paging with each view sizes??
OK, add just `showcase.isPagingEnabled = true` before resetting.


## Layout

Showcase have a layout property. You can design your layout easily.
These are all properties layout has.
### Showcase.layout
– `direction`: LayoutDirection => .horizontal or .vertical
– `itemSize`: CGSize => item size
– `lineSpacing`: CGFloat => spacing between each cell
– `path`: PathProtocol => path, view’s orbit drawn by scrolling
– `transform`: TransformProtocol? => view’s shape is transformed by scrolling

The Speciality is `path` and `transform` property.
### Definition & Feature of PathProtocol and TransformProtocol
public protocol PathProtocol {
func normalizedPath(withCoordinate value: CGFloat) -> CGFloat
public protocol TransformProtocol {
func transform(withScrollingRate rate: CGFloat) -> CATransform3D
– Normalized coordinate
– Can create your own designed path, conforming to PathProtocol

Latest podspec

    "name": "Showcase",
    "version": "1.1.0",
    "summary": "Showcase is a UIView based view to display views in the frame, like you display figures in a sheld or showcase",
    "description": "Type-safely resettingnLooping for last cell to first cell.nPaging can be enabled with each cell size.nLayout makes Showcase much customizable. You can create your own path and transform.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "h-yuya": "[email protected]"
    "source": {
        "git": "",
        "tag": "1.1.0"
    "platforms": {
        "ios": "9.0"
    "source_files": "Sources/**/*",
    "frameworks": "UIKit",
    "pushed_with_swift_version": "3.2"

Pin It on Pinterest

Share This