This Swift library contains a set of usefulf behaviors implemented to simplify your iOS projects. The concept behind this approach is explored in objc.ios Issue 13.
Check out the objc.io issue 13 for extra details, but basically Behaviors allow you to write better code by pushing to the maximum extent concepts like Composition and Single Responsibility Principle. By using Behaviors, you can compose your views with multiple small objects from your InterfaceBuilder and dramatically reduce the amount of lines in your UIViewController
.
The resulting code is more reusable and testable.
This is the list of current and posible future behaviors that will be implemented.
-
Animations
- Hide navigation/tabbar on scroll:
NavigationHideScrollBehavior
- Background Parallax: TODO
- Scroll View Parallax: TODO
- Table row appear animation: TODO
- Shake: TODO
- Pull to expand view: TODO
- Hide navigation/tabbar on scroll:
-
Forms
- Autoscrolling on textfield focus:
TextFieldScrollBehavior
- Focus on next control:
TextFieldResponderBehavior
- Move view on top of keyboard:
ViewPositionKeyboardBehavior
- Regex validator:
TextFieldRegexValidatorBehavior
- Email validator:
TextFieldEmailValidatorBehavior
- Phone validator:
TextFieldPhoneValidatorBehavior
- Credit card validator:
TextFieldCreditCardValidatorBehavior
- Button enabler: TODO
- Textfield effects (selected, required, error...): TODO
- Autoscrolling on textfield focus:
-
Others
- Scroll offset listener:
ScrollingTriggerBehavior
- Keyboard lister:
KeyboardTriggerBehavior
- Delegate multiplexor: TODO
- Autolayout view visibility gone: TODO
- Scroll offset listener:
Made available under the MIT License.
Forks, patches and other feedback are always welcome.
Behaviors is brought to you by Angel Garcia Olloqui. You can contact me on:
Project Page: Behaviors
Personal webpage: angelolloqui.com
Twitter: @angelolloqui
LinkedIn: angelolloqui