All Projects → siam-biswas → Transfiguration

siam-biswas / Transfiguration

Licence: MIT License
Mystical way to transform data into reusable view in Swift

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Transfiguration

Pagingkit
PagingKit provides customizable menu UI. It has more flexible layout and design than the other libraries.
Stars: ✭ 1,030 (+7257.14%)
Mutual labels:  uitableview, uicollectionview, uicollectionviewlayout
iOSEasyList
A data-driven UICollectionView and UITableView framework for building fast and flexible lists
Stars: ✭ 29 (+107.14%)
Mutual labels:  uitableview, uicollectionview, uicollectionviewlayout
Squaremosaiclayout
An extandable mosaic UICollectionViewLayout with a focus on extremely flexible customizations 🔶
Stars: ✭ 243 (+1635.71%)
Mutual labels:  uitableview, uicollectionview, uicollectionviewlayout
Closures
Swifty closures for UIKit and Foundation
Stars: ✭ 1,720 (+12185.71%)
Mutual labels:  uitableview, uicollectionview, uipickerview
Cyanic
Declarative, state-driven UI framework
Stars: ✭ 32 (+128.57%)
Mutual labels:  uitableview, uicollectionview
JQCollectionViewAlignLayout
A custom layout object based on flow layout. Added supports for horizontal, vertical alignment and RTL direction of collection view items.(available for both UICollectionView and NSCollectionView)
Stars: ✭ 69 (+392.86%)
Mutual labels:  uicollectionview, uicollectionviewlayout
TinyCoordinator
The Swift version of ThinningCoordinator focus on lighter view controllers.
Stars: ✭ 18 (+28.57%)
Mutual labels:  uitableview, uicollectionview
CPCollectionViewWheelLayout
An interesting wheel layout of collection view.Swift version:https://github.com/ParsifalC/CPCollectionViewKit
Stars: ✭ 16 (+14.29%)
Mutual labels:  uicollectionview, uicollectionviewlayout
Tabanimated
A skeleton screen framework based on native for iOS. (一个由iOS原生组件映射出骨架屏的框架,包含快速植入,低耦合,兼容复杂视图等特点,提供国内主流骨架屏动画的加载方案,同时支持上拉加载更多、自定制动画。)
Stars: ✭ 2,909 (+20678.57%)
Mutual labels:  uitableview, uicollectionview
HDEmptyView
一个Swift语言封装的EmptyView显示库,可作用于WKWebView、UITableView、UICollectionView 无网络提醒或者空数据提醒
Stars: ✭ 29 (+107.14%)
Mutual labels:  uitableview, uicollectionview
CollectionLayouts
A collection of UICollectionViewLayouts
Stars: ✭ 64 (+357.14%)
Mutual labels:  uicollectionview, uicollectionviewlayout
IQListKit
Model driven UITableView/UICollectionView
Stars: ✭ 51 (+264.29%)
Mutual labels:  uitableview, uicollectionview
CPCollectionViewWheelLayoutSwift
New url:https://github.com/ParsifalC/CPCollectionViewKit Objective-C Version:https://github.com/ParsifalC/CPCollectionViewWheelLayout
Stars: ✭ 16 (+14.29%)
Mutual labels:  uicollectionview, uicollectionviewlayout
AUPickerCell
Embedded picker view for table cells.
Stars: ✭ 19 (+35.71%)
Mutual labels:  uitableview, uipickerview
ExcelCollectionViewLayout
An Excel-like UICollectionView's layout.
Stars: ✭ 32 (+128.57%)
Mutual labels:  uicollectionview, uicollectionviewlayout
PagedLists
Paginated UITableView and UICollectionViews for iOS.
Stars: ✭ 69 (+392.86%)
Mutual labels:  uitableview, uicollectionview
CollectionViewMultiColumnLayout
A tiled waterfal/mosaic UICollectionViewLayout with support for explicit columns.
Stars: ✭ 13 (-7.14%)
Mutual labels:  uicollectionview, uicollectionviewlayout
ScaledCenterCarousel
A carousel-based layout for UICollectionView with scaled center item.
Stars: ✭ 16 (+14.29%)
Mutual labels:  uicollectionview, uicollectionviewlayout
ios ui recipe showcase
iOSアプリ開発 - UI実装であると嬉しいレシピブック掲載サンプル
Stars: ✭ 54 (+285.71%)
Mutual labels:  uitableview, uicollectionview
Rglistkit
RGListKit is a Protocol & MVVM based framework to easily populate a UITableView or UICollectionView via single api.
Stars: ✭ 178 (+1171.43%)
Mutual labels:  uitableview, uicollectionview

Transfiguration

SPM compatible Carthage compatible CocoaPods Platform UITableView UICollectionView UIPickerView

Mystical way to transform data into reusable view in Swift

Transfiguration is a solution for creating data driven iOS applications with minimal block of codes. It helps you to represent your data set with reusable views like UITableView, UICollectionView or UIPickerView with minimum effort.

Usage

Scenario One

Lets say you have an array with alphabets and you want to represent them in UITableView. For doing that with Transfiguration all you have to do is bind your data with your tableView and attach the view configurations with closures.

class ViewController: UITableViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        tableView.bind(["A","B","C"]).configure{ view, container, indexPath, data in
            view.textLabel?.text = data[indexPath.row].name
        }

    }

}

Scenario Two

Now you want to represent your alphabets array with UICollectionView. The necceserry step is pretty much same as the previous with an aditional mentioning of your custom View Type and size configuration

class CustomCell : UICollectionViewCell { ... }

class ViewController: UICollectionViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
       collectionView.bind(["A","B","C"]).configure(CustomCell.self){ view, container, indexPath, data in
            view.setupData(data: data[indexPath.row])
        }.size{ container, indexPath, data in
            return CGSize(width: 100, height: 100)
        }

    }

}

Scenario Three

Now finally you have a UIPickerView and you want to populate that with your alphabets array. Lets see the way to do it.

pickerView.bind(["A","B","C"]).title{ container, indexPath, data in
    return data[indexPath.row]
}

These are the very basic usage of Transfiguration. For getting idea about some more complex scenarios please check the Example files.

Transfigurable

By wrapping your data with Transfigurable, you can access all available data operations. It basically sets an observer for your data operations so that you never have to call the reloadData() or relevent functios from your view layer. You can also controll animations and force reload while executing this operations.

Available Operations
Append Section
Insert Section
Update Section
Remove Section
Append Item
Insert Item
Update Item
Delete Item
Clear All

Sectionable

The data holder you are binding with your list or grid view must be conformed by Sectionable. You can make your custom sections by conforming to the Sectionable protocol. Also for composing different types of data section you can use Ènum.

class CustomSection: Sectionable {

    var header:String?
    var footer:String?
    var count: Int
    
}
enum CompositionSections: Sectionable {
   case image,video,text
}

Operatable

Operatable gives your Sectionable data some ability for data operations like append, insert, update & remove.

class CustomSection: Sectionable,Operatable { 
   var data: [String]
}
enum CompositionSections: Sectionable,Operatable { .... }

Identifiable

By conforming to Identifiable your Sectionable data can gets a unique identity and priority for precise data operations.

class CustomSection: Sectionable,Operatable,Identifiable {
    var identifier: String
    var priority: Int?
}
enum CompositionSections: Sectionable,Operatable,Identifiable { .... }

Custom Layouts

Transfiguration comes with some cool custom layouts for UICollectionView.

Available Layouts
UICollectionViewWaterfallLayout
UICollectionViewTagLayout
UICollectionViewStackLayout
UICollectionViewCardLayout
UICollectionViewGridLayout
let layout = UICollectionViewWaterfallLayout()
layout.numberOfColumns = 2
let viewController = UICollectionViewController(collectionViewLayout: layout)
         
let layout = UICollectionViewTagLayout()
layout.scrollDirection = .horizontal
let collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout)
         

Checkout the Example files for the demostration of all custom layouts.

Dynamic Sizing

If you already have experience working with UICollectionView , then you must know that how hard it is to represent dynamic sizeable views with it. Now with a default sizing configuration provided by Transfiguration, working with Collections will be much easy and fun.

collectionView.bind(["A","B","C"]).configure(CustomCell.self){ view, container, indexPath, data in

    view.setupData(data: data[indexPath.row])

}.sizingView{ container, indexPath, data in
    
    let view = CustomCell.sizing
    view.setupData(data: data[indexPath.row])
    return view.contanerView
        
}

While using the sizing configuration , please ensure that your view has all required auto layout setup for dynamic height or width. Also it is recommended to use a Static instance of your dynamic cell for better performance.

Installation

CocoaPods

You can use CocoaPods to install Transfiguration by adding it to your Podfile:

platform :ios, '8.0'
use_frameworks!

target 'MyApp' do
    pod 'Transfiguration'
end

Carthage

You can use Carthage to install Transfiguration by adding it to your Cartfile:

github "siam-biswas/Transfiguration"

If you use Carthage to build your dependencies, make sure you have added Transfiguration.framework to the "Linked Frameworks and Libraries" section of your target, and have included them in your Carthage framework copying build phase.

Swift Package Manager

You can use The Swift Package Manager to install Transfiguration by adding the proper description to your Package.swift file:

import PackageDescription

let package = Package(
    name: "YOUR_PROJECT_NAME",
    dependencies: [
        .package(url: "https://github.com/siam-biswas/Transfiguration.git", from: "2.0.0"),
    ]
)

Manually

To use this library in your project manually you may:

  1. for Projects, just drag all the (.swift) files from (Source\Transfiguration) to the project tree
  2. for Workspaces, include the whole Transfiguration.xcodeproj

License

This project is licensed under the terms of the MIT license. See the LICENSE file for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].