GithubHelp home page GithubHelp logo

dfbehaviors's Introduction

DFBehaviors

Version License Platform

About

DFBehaviors is a collection of usable Behaviors. Inspired by my friend Krzysztof Zabłocki. His article about Behaviors can be found here: http://www.objc.io/issue-13/behaviors.html

How does it works?

You simply drop NSObject to XIB, change its class to some of Behavior, and connect all needed IBOutlets and/or change settings in interface builder with IBInspectable properties. All behaviors inhertis from UIControl, so you can also observe value change notifications. Both solutions are shown in examples.

DFContactPickerBehavior

With this behavior you can easily get all available info from phone contact, without messing with ABPeoplePicker. Drag and drop DFContactPickerBehavior to XIB, connect value changed handler, and get all needed information. This behavior is shown in example.

DFCollectionViewDataSourceDelegateBehavior

When you need to use collection view, view controller can easily by clustered with logic from data source and delegate. Proper architecture separate this logic with use of composition or inheritance. You can set this behavior as data source and/or delegate and properly feed collection view from it. This behavior is show in example.

DFImagePickerBehavior

When you need to load photo from user photo library or camera, you need to ask user for permission, display proper alerts, show photo album etc. With this behavior you simply shows which button launch operation, and which UIImageView should load taken photo. Thats it. Alternatively you can load image to UIButton, or get UIImage itself by observing ValueDidChange. Everything is shown in the example.

DFSoundPlayerBehavior

Another fast way to play a short sound. All you need is to type in existing sound file path and file type in inspector.

DFTableViewDataSourceDelegateBehavior

Similiar to DFTableViewDataSourceDelegateBehavior, you can use this behavior as composition to pass table view data source and delegate.

Incoming behaviors

What can be usefull? Let me know.

Installation

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

pod "DFBehaviors"

Your feedback

I love to get feedback from you, fell free to post here or let me know through my email.

Author

Cezary Bielecki, [email protected]

License

DFBehaviors is available under the MIT license. See the LICENSE file for more info. Also it is always nice if you let me know that you are using my pod in commercial project :-)

dfbehaviors's People

Watchers

James Cloos avatar Ruslan 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.