Giter VIP home page Giter VIP logo

fmswipify's Introduction

FMSwipify

CI Status Version License Platform

Overview

A framework that is meant to make your life easier when working with nested Collection Views. The framework also provides a good base for your custom implementations.

                

Usage

  • Controller
import UIKit
import FMSwipify

class ViewController: SwipifyController<YourCell, YourModel> {

    override var cellSource: CellSource { return .nib }
    override var cellSize: CGSize { return CGSize(width: collectionView.frame.width, height: 350)}
    override var data: [[Post]] { return DataStore.store.posts }

    let config = Config(
        sectionTitleFont: .systemFont(ofSize: 16, weight: .medium),
        sectionsIcon: DataStore.store.icons,
        sectionIconSize: .init(width: 30, height: 30),
        sectionsBackgroundColor: .red,
        sectionsSelectedColor: .white,
        sectionsUnselectedColor: UIColor(white: 0, alpha: 0.6),
        sectionsSelectorColor: .white,
        sectionSelectorType: .bar
    )

    override func viewDidLoad() {
        super.viewDidLoad()
        setConfig(config)
    }
}
  • Cell
import FMSwipify

class YourCell: SwipifyBaseCell<YourModel> {

    @IBOutlet weak var titleLabel: UILabel!
    @IBOutlet weak var subTitleLabel: UILabel!

    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
        guard let yourModel = item else {return}
        titleLabel.text = yourModel.title
        subTitleLabel.text = yourModel.subTitle
    }

}
  • Model
struct YourModel {
    let title: String
    let subTitle: String
}

Configuration API

* -- Must be defined

Attribute Description Default value
sectionsTitle Sets the title of each section empty
sectionTitleFont Sets the font your section title systemFont(ofSize: 15, weight: .regular)
sectionsIcon Sets the icon of each section empty
sectionIconSize Sets the size of your section icon CGSize(width: 30, height: 30)
sectionsBackgroundColor Sets the background of the section banner .white
sectionsSelectedColor Sets color of the section's selected state .black
sectionsUnselectedColor Sets color of the section's unselected state .lightGray
sectionsSelectorColor Sets the color of the selector .black
sectionSelectorType Specifies whether the selector is a bar or bubble .bar
cellSource Specifies whether the cell comes from nib or code .nib
* cellSize Sets the size of your cell .zero

Requirements

Swift 4.0+ and iOS 9.0+

Installation

FMSwipify is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'FMSwipify'

Authors

FranckNdame, [email protected] Ahmad Karkouti, [email protected]

Contributing

Forks, patches and other feedback are welcome.

Development

This library is still in early development, more features and ideas are currently being engineered.

License

FMSwipify is available under the MIT license. See the LICENSE file for more info.

FMSwipify

fmswipify's People

Contributors

franckndame avatar ahmadkarkouti avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.