Giter Club home page Giter Club logo

kinder's Introduction



Written on Swift for iOS 7.0+.

It's a UIViewController, allows you to vote, to leave an opinion or know a point of view. The user must make a choice for each content, two possible, or view more information if necessary (dislike / like or deny / accept). Each content is represented by a KinderCarView. The user has the choice between gesture or buttons. Kinder is similar to the Tinder system.


Kinder is available on CocoaPods. Just add the following to your project Podfile: ``` pod 'Kinder', '~> 1.0.0' ```



Kinder to a stack of content, only three of them are displayed. Kinder uses delegations to informs action or seek more content. You can gradually add content (Lazy loading).


Kinder protocol: ================ Your parent control, must implement this protocol to make action. For example call a web service for like or dislike, and load more content. ```swift protocol KinderDelegate { func acceptCard(card: KinderModelCard?) func cancelCard(card: KinderModelCard?) // action signal func signalReload() // signal to load more data func reloadCard() -> [KinderModelCard]? //return your datas to the Kinder controller } ```

Kinder Model:

Kinder deals with model. If you have special model because you use an API or something else, you can juste inherited of the KinderModelCard. This model is important because all the content you will passe throw Kinder must be a KinderModelCard.

protocol KinderModelCard {
    var image: UIImage! { get set }
    var content: String! { get set }
    var desc: String! { get set }
}
class CustomModel: NSObject, KinderModelCard {
    var image: UIImage!
    var content: String!
    var desc: String!
    var id: String!
    var isVoted: Bool!
}

Referencing to the example project. If you have any questions do not hesitate. And do not hesitate to contribute, to build something more impressive than that have already.

Currently used in the Adok application for iOS:


kinder's People

Contributors

remirobert avatar

Watchers

 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.