Git Product home page Git Product logo

stacontrols's Introduction

STAControls

Build Status

STAControls is a collection of classes that aim to make dealing with Cocoa's UIControl subclasses more convenient, and to reduce the complexity of the code you write when getting these controls to do things that really ought to be provided out-of-the-box:

  • dismissing the keyboard when the return key is pressed
  • switching to another text field when the return key is pressed
  • having placeholder text reappear when the text field is no longer first responder (and text field is still blank)
  • providing setBackgroundColor:forState: method for UIButton (STAButton)
  • togglable segments in a UISegmentedControl (STASegmentedControl)
  • display an accessory view that allows for fast switching between adjacent UIControls (with system chevrons) & "Done" button
  • max character length (STATextField)
  • easily denote titles in a UIPickerView (STAPickerView)

As well as more advanced things such as:

  • provide a date text field (STADateField)
  • provide an ATM text field (STAATMTextField) which takes in currency input like an ATM machine
  • currency representation support within a text field (STATextField)
  • support for intercepting delegate methods within the subclass (because sometimes you want the UIControl to be aware of when things concerning it change)
  • resizing support to accomodate clear text button view (STAResizingTextField)
  • ReactiveCocoa support

Installation

Note: This project will be put on CocoaPods for version 1, which is currently being worked toward.

Merely copy the STAControls directory into your project.

Usage

Import library for usage with #import "STAControls.h", then merely use as any other UIControl subclass. Consult the header files to see what additional functionality each class provides.

stacontrols's People

Contributors

ajubbal avatar alexclp avatar dhsu123 avatar stunner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

stacontrols's Issues

Write Tests for STASegmentedControl

Currently the test harness merely navigates to the STASegmentedControl view controller and backs. Tests should test the control with both values of the toggleableSegments.

Implement Method That Allows for Broadcasting When STAButton State Changes

If you look at the reference link for the STAButton class. You'll notice that the original author baked in the capability to broadcast when the state of the button changes by hijacking Apple's UIControlEventState... enum, which I am not a fan of.

Implement this broadcasting capability by providing a method that the user of the button can use to register a block that gets called whenever the Button's state changes. The block should have 2 parameters, one for the old state value, and one for the new state value.

Bonus Points if you write a test case for this method (doesn't have to use KIF).

Resizing Text Field Animations no Longer Smooth

As mentioned in commit b967a18 turning off translatesAutoresizingMaskIntoConstraints causes resizing animation of the text field to no longer animate smoothly.

This could potentially be rectified by performing the resize via constraints rather than by manipulating frame values.

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.