All Projects → DianQK → Flix

DianQK / Flix

Licence: mit
iOS reusable form library in Swift.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Flix

Wlemptystate
WLEmptyState is an iOS based component that lets you customize the view when the dataset of a UITableView or a UICollectionView is empty. We created a sample project with the WLEmptyState component to show how you can use it.
Stars: ✭ 305 (-57.93%)
Mutual labels:  uicollectionview, uitableview
Tysnapshotscroll
一句代码保存截图,将 UIScrollView UITableView UICollectionView UIWebView WKWebView 网页 保存 为 长图 查看。Save the scroll view page as an image,support UIScrollView,UITableView,UICollectionView,UIWebView,WKWebView.(Support iOS13)
Stars: ✭ 709 (-2.21%)
Mutual labels:  uicollectionview, uitableview
Livecollections
Automatically perform UITableView and UICollectionView animations between two sets of immutable data. It supports generic data types and is fully thread-safe.
Stars: ✭ 337 (-53.52%)
Mutual labels:  uicollectionview, uitableview
WBListKit
A data-driven UICollectionView&UITableView framework for building fast and flexible lists by declarative syntax.
Stars: ✭ 32 (-95.59%)
Mutual labels:  uitableview, uicollectionview
Owl
A declarative type-safe framework for building fast and flexible lists with UITableViews & UICollectionViews
Stars: ✭ 423 (-41.66%)
Mutual labels:  uicollectionview, uitableview
iOSEasyList
A data-driven UICollectionView and UITableView framework for building fast and flexible lists
Stars: ✭ 29 (-96%)
Mutual labels:  uitableview, uicollectionview
Functionaltabledata
Declarative UITableViewDataSource implementation
Stars: ✭ 347 (-52.14%)
Mutual labels:  uicollectionview, uitableview
Transfiguration
Mystical way to transform data into reusable view in Swift
Stars: ✭ 14 (-98.07%)
Mutual labels:  uitableview, uicollectionview
Lpdmvvmkit
LPDMvvmKit - Elegant MVVM framework in Objective-C.
Stars: ✭ 400 (-44.83%)
Mutual labels:  uicollectionview, uitableview
Stackscrollview
📋 iOS Form UI Builder in Swift (powered by UICollectionView)
Stars: ✭ 382 (-47.31%)
Mutual labels:  form, uicollectionview
MultiSelect
swift
Stars: ✭ 12 (-98.34%)
Mutual labels:  uitableview, uicollectionview
Emptydataset Swift
🎄 DZNEmptyDataSet implement with Swift.A drop-in UITableView/UICollectionView superclass category for showing empty datasets whenever the view has no content to display. DZNEmptyDataSet with Swift.
Stars: ✭ 443 (-38.9%)
Mutual labels:  uicollectionview, uitableview
CollectionAndTableViewCompatible
A set of Swift protocols and Xcode snippets that will make it easy to do clean UITableView code
Stars: ✭ 34 (-95.31%)
Mutual labels:  uitableview, uicollectionview
Baraba
Make your UIScrollView scroll automatically when user is looking 👀 by tracking face using ARKit and AVFoundation
Stars: ✭ 268 (-63.03%)
Mutual labels:  uicollectionview, uitableview
XLRefresh
iOS 下拉刷新工具
Stars: ✭ 25 (-96.55%)
Mutual labels:  uitableview, uicollectionview
Persei
Animated top menu for UITableView / UICollectionView / UIScrollView written in Swift
Stars: ✭ 3,395 (+368.28%)
Mutual labels:  uicollectionview, uitableview
GenericCells
Creating generic UITableViewCells and UICollectionViewCells instead of subclasses.
Stars: ✭ 81 (-88.83%)
Mutual labels:  uitableview, uicollectionview
ios ui recipe showcase
iOSアプリ開発 - UI実装であると嬉しいレシピブック掲載サンプル
Stars: ✭ 54 (-92.55%)
Mutual labels:  uitableview, uicollectionview
Uitableviewdynamiclayoutcacheheight
🖖高性能的自动计算采用 Autolayout 布局的 UITableViewCell 和 UITableViewHeaderFooterView 的高度,内部自动管理高度缓存。
Stars: ✭ 360 (-50.34%)
Mutual labels:  uicollectionview, uitableview
Mylinearlayout
MyLayout is a powerful iOS UI framework implemented by Objective-C. It integrates the functions with Android Layout,iOS AutoLayout,SizeClass, HTML CSS float and flexbox and bootstrap. So you can use LinearLayout,RelativeLayout,FrameLayout,TableLayout,FlowLayout,FloatLayout,PathLayout,GridLayout,LayoutSizeClass to build your App 自动布局 UIView UITab…
Stars: ✭ 4,152 (+472.69%)
Mutual labels:  uicollectionview, uitableview

Flix: iOS form builder in Swift

Travis CI CocoaPods compatible Carthage compatible 中文 README

Flix is a flexible iOS framework for creating dynamic forms with UITableView or UICollectionView.

Features

  • [x] Supports no reused when you need.
  • [x] Supports reused for list when you need.
  • [x] Supports nested forms.
  • [x] Supports add, delete and insert
  • [x] Supports Storyboard design
  • [x] Example app available!
  • [x] Works with UITableView and UICollectionView

Flix focus on combining cells of UICollectionView or UITableView, it don't care about the view layout, business logic. So you can easily build custom form using Flix.

Preview

Requirements

  • Xcode 10.2+
  • Swift 5+
  • RxSwift 5.0+
  • RxDataSources 4.0+

Installation

CocoaPods

pod 'Flix', '~> 4.0'

Principle

Each provider will generate a number of nodes (cells), then combines those providers according to the sequence.

Tutorial - A Simple Settings Page

When creating a settings page, we don't want to some cells be reused, for example Profile Cell, Airplane Mode Cell. This looks like creating a static tableView on Storyboard.

To create one profile cell, we just need to create a UniqueCustomTableViewProvider and configure the style and add some views:

let profileProvider = UniqueCustomTableViewProvider()
profileProvider.itemHeight = { _ in return 80 }
profileProvider.accessoryType = .disclosureIndicator

let avatarImageView = UIImageView( image: #imageLiteral(resourceName: "Flix Icon") ) profileProvider.contentView.addSubview(avatarImageView)

let nameLabel = UILabel() nameLabel.text = "Flix" profileProvider.contentView.addSubview(nameLabel)

let subTitleLabel = UILabel() subTitleLabel.text = "Apple ID, iCloud, iTunes & App Store" profileProvider.contentView.addSubview(subTitleLabel)

self.tableView.flix.build([profileProvider])

Now, we have a profile cell for the settings page, considering we might use this provider on another UITableView. We should make a Class for profileProvider.

We can inherit from UniqueCustomTableViewProvider:

class ProfileProvider: UniqueCustomTableViewProvider {

    let avatarImageView = UIImageView()
    let nameLabel = UILabel()
    let subTitleLabel = UILabel()

    init(avatar: UIImage, name: String) {
        super.init()

        self.itemHeight = { _ in return 80 }
        self.accessoryType = .disclosureIndicator

        avatarImageView.image = avatar
        self.contentView.addSubview(avatarImageView)

        nameLabel.text = name
        self.contentView.addSubview(nameLabel)

        subTitleLabel.text = "Apple ID, iCloud, iTunes & App Store"
        self.contentView.addSubview(subTitleLabel)
    }

}

or just implement the protocol UniqueAnimatableTableViewProvider:

class ProfileProvider: UniqueAnimatableTableViewProvider {

    let avatarImageView = UIImageView()
    let nameLabel = UILabel()
    let subTitleLabel = UILabel()

    init(avatar: UIImage, name: String) {
        avatarImageView.image = avatar
        nameLabel.text = name
        subTitleLabel.text = "Apple ID, iCloud, iTunes & App Store"
    }

    func onCreate(_ tableView: UITableView, cell: UITableViewCell, indexPath: IndexPath) {
        cell.accessoryType = .disclosureIndicator
        cell.contentView.addSubview(avatarImageView)
        cell.contentView.addSubview(nameLabel)
        cell.contentView.addSubview(subTitleLabel)
    }

    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath, value: ProfileProvider) -> CGFloat? {
        return 80
    }

}

But in reality, the profile cell is placed in a section. We can use SectionProfiler:

let profileSectionProvider = SpacingSectionProvider(
    providers: [profileProvider],
    headerHeight: 35,
    footerHeight: 0
)
self.tableView.flix.build([profileSectionProvider])

Then add more providers:

let profileProvider = ProfileProvider(
    avatar: #imageLiteral(resourceName: "Flix Icon"),
    name: "Flix")
let profileSectionProvider = SpacingSectionProvider(
    providers: [profileProvider],
    headerHeight: 35,
    footerHeight: 0)
let airplaneModeProvider = SwitchTableViewCellProvider(
    title: "Airplane Mode",
    icon: #imageLiteral(resourceName: "Airplane"),
    isOn: false)
let wifiProvider = DescriptionTableViewCellProvider(
    title: "Wi-Fi",
    icon: #imageLiteral(resourceName: "Wifi"),
    description: "Flix_5G")
let bluetoothProvider = DescriptionTableViewCellProvider(
    title: "Bluetooth",
    icon: #imageLiteral(resourceName: "Bluetooth"),
    description: "On")
let cellularProvider = DescriptionTableViewCellProvider(
    title: "Cellular",
    icon: #imageLiteral(resourceName: "Cellular"))
let hotspotProvider = DescriptionTableViewCellProvider(
    title: "Personal Hotspot",
    icon: #imageLiteral(resourceName: "Personal Hotspot"),
    description: "Off")
let carrierProvider = DescriptionTableViewCellProvider(
    title: "Carrier",
    icon: #imageLiteral(resourceName: "Carrier"),
    description: "AT&T")
let networkSectionProvider = SpacingSectionProvider(
    providers: [
        airplaneModeProvider,
        wifiProvider,
        bluetoothProvider,
        cellularProvider,
        hotspotProvider,
        carrierProvider
    ],
    headerHeight: 35,
    footerHeight: 0
)
self.tableView.flix.build(
    [profileSectionProvider, networkSectionProvider]
)
    

Until now, we just use one provider to generate one cell. We can also create a provider for a group of cells.

let appSectionProvider = SpacingSectionProvider(
    providers: [AppsProvider(apps: [
        App(icon: Wallet, title: "Wallet"),
        App(icon: iTunes, title: "iTunes"),
        App(icon: Music, title: "Music"),
        App(icon: Safari, title: "Safari"),
        App(icon: News, title: "News"),
        App(icon: Camera, title: "Camera"),
        App(icon: Photos), title: "Photo")
        ])],
    headerHeight: 35,
    footerHeight: 35
)
self.tableView.flix.build([
    profileSectionProvider,
    networkSectionProvider,
    appSectionProvider]
)
    

Look like good.

Actually Flix supports more build list view function, you can easily create a page with all kinds of linkage effects (such as Calendar Events, GitHub Signup). More example are available in the Example Folder.

Contributing

  1. Please fork this project
  2. Implement new methods or changes。
  3. Write appropriate docs and comments in the README.md
  4. Submit a pull request.

Contact

Raise an Issue or hit me up on Twitter @Songxut.

License

Flix is released under an MIT license. See LICENSE for more information.

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].