Handy UIControl subclasses. (Think Three20/NimbusKit of UIControls.)

Overview

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.

You might also like...
Media view which subclasses UIImageView, and can display & load images, videos, GIFs, and audio and from the web, and has functionality to minimize from fullscreen, as well as show GIF previews for videos.
Media view which subclasses UIImageView, and can display & load images, videos, GIFs, and audio and from the web, and has functionality to minimize from fullscreen, as well as show GIF previews for videos.

I've built out the Swift version of this library! Screenshots Description ABMediaView can display images, videos, as well as now GIFs and Audio! It su

Luminous provides you a lot of information about the system and a lot of handy methods to quickly get useful data on the iOS platform.
Luminous provides you a lot of information about the system and a lot of handy methods to quickly get useful data on the iOS platform.

Luminous Example To run the example project, clone the repo, and run pod install from the Example directory first. Requirements iOS 8+ Swift 5 Xcode 1

A handy collection of more than 500 native Swift extensions to boost your productivity.

SwifterSwift is a collection of over 500 native Swift extensions, with handy methods, syntactic sugar, and performance improvements for wide range of

Handy Combine extensions on NSObject, including Set<AnyCancellable>.
Handy Combine extensions on NSObject, including SetAnyCancellable.

Storable Description If you're using Combine, you've probably encountered the following code more than a few times. class Object: NSObject { var c

SharkUtils is a collection of Swift extensions, handy methods and syntactical sugar that we use within our iOS projects at Gymshark.

SharkUtils is a collection of Swift extensions, handy methods and syntactical sugar that we use within our iOS projects at Gymshark.

A handy collection of more than 500 native Swift extensions to boost your productivity.

SwifterSwift is a collection of over 500 native Swift extensions, with handy methods, syntactic sugar, and performance improvements for wide range of

Review page interaction - handy and pretty way to ask for review.
Review page interaction - handy and pretty way to ask for review.

RPInteraction Overview Review page interaction - handy and pretty way to ask for review. Inspired by dribbble shot. Requirements iOS8 Installation RPI

A handy collection of Swift method and Tools to build project faster and more efficient.

SwifterKnife is a collection of Swift extension method and some tools that often use in develop project, with them you might build project faster and

Luminous provides you a lot of information about the system and a lot of handy methods to quickly get useful data on the iOS platform.
Luminous provides you a lot of information about the system and a lot of handy methods to quickly get useful data on the iOS platform.

Luminous Example To run the example project, clone the repo, and run pod install from the Example directory first. Requirements iOS 8+ Swift 5 Xcode 1

Handy RxSwift extensions on NSObject, including rx.disposeBag.
Handy RxSwift extensions on NSObject, including rx.disposeBag.

NSObject+Rx If you're using RxSwift, you've probably encountered the following code more than a few times. class MyObject: Whatever { let disposeBag

A handy class for iOS to use UILabel as a countdown timer or stopwatch just like in Apple Clock App.
A handy class for iOS to use UILabel as a countdown timer or stopwatch just like in Apple Clock App.

MZTimerLabel Purpose MZTimerLabel is a UILabel subclass, which is a handy way to use UILabel as a countdown timer or stopwatch just like that in Apple

A Swift package that adds some handy functions to String and NSMutableAttributedString

StringBooster StringBooster is a simple Swift package containing a few useful ex

TypeStyle is a handy app for iPhone and iPad that generates text using different styles and decorations. It is a native Swift iOS app.
TypeStyle is a handy app for iPhone and iPad that generates text using different styles and decorations. It is a native Swift iOS app.

TypeStyle TypeStyle is a handy app for iPhone and iPad that generates text using different styles and decorations. It is a native Swift iOS app. Featu

Snitch - A handy library to access useful information about your application from the Home Screen
Snitch - A handy library to access useful information about your application from the Home Screen

Snitch Access your app's useful information from Home Screen Table of Contents I

Review page interaction - handy and pretty way to ask for review
Review page interaction - handy and pretty way to ask for review

RPInteraction Overview Review page interaction - handy and pretty way to ask for review. Inspired by dribbble shot. Requirements iOS8 Installation RPI

Comments
  • Write Tests for STASegmentedControl

    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.

    opened by Stunner 0
  • Resizing Text Field Animations no Longer Smooth

    Resizing Text Field Animations no Longer Smooth

    As mentioned in commit b967a180249514ab0d44c199c702842b5ac6a772 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.

    opened by Stunner 0
  • Implement Method That Allows for Broadcasting When STAButton State Changes

    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).

    enhancement 
    opened by Stunner 2
Owner
Aaron
iOS Developer and FOSS enthusiast.
Aaron
A custom UIControl which functions like UISlider where you can set multiple intervals with different step values for each interval.

MultiStepSlider A custom UIControl which functions like UISlider where you can set multiple intervals with different step values for each interval. Th

Susmita Horrow 25 Apr 28, 2022
A custom stretchable header view for UIScrollView or any its subclasses with UIActivityIndicatorView and iPhone X safe area support for content reloading. Built for iOS 10 and later.

Arale A custom stretchable header view for UIScrollView or any its subclasses with UIActivityIndicatorView support for reloading your content. Built f

Putra Z. 43 Feb 4, 2022
A fully customisable subclass of the native UIControl which allows you to create beautiful buttons without writing any line of code.

A fully customisable subclass of the native UIControl which allows you to create beautiful buttons without writing any line of code. Preview You'll be

Lorenzo Greco 2.3k Dec 31, 2022
A UIControl subclass that makes it easy to create empty states.

AZEmptyState Making empty state simple. Screenshots Installation Cocoa Pods: pod 'AZEmptyState' Manual: Simply drag and drop the Sources folder to you

Antonio Zaitoun 88 Oct 2, 2022
SMNumberWheel is a subclass of UIControl written in Swift, which is ideal for picking numbers using a rotating wheel.

SMNumberWheel version: 1.0.3 [![CI Status](http://img.shields.io/travis/Sina Moetakef/SMNumberWheel.svg?style=flat)](https://travis-ci.org/Sina Moetak

null 26 Mar 15, 2022
A custom UIControl which functions like UISlider where you can set multiple intervals with different step values for each interval.

MultiStepSlider A custom UIControl which functions like UISlider where you can set multiple intervals with different step values for each interval. Th

Susmita Horrow 25 Apr 28, 2022
A custom stretchable header view for UIScrollView or any its subclasses with UIActivityIndicatorView and iPhone X safe area support for content reloading. Built for iOS 10 and later.

Arale A custom stretchable header view for UIScrollView or any its subclasses with UIActivityIndicatorView support for reloading your content. Built f

Putra Z. 43 Feb 4, 2022
UITextField and UITextView subclasses with placeholders that change into floating labels when the fields are populated with text.

Deprecated Please use JVFloatLabeledTextField instead or feel free to chime in on an issue if you'd like to take over the repo. RPFloatingPlaceholders

rob phillips 1.1k Jan 5, 2023
Generates Swift NSManagedObject subclasses

MotoSwift. Managed Objects to Swift. Generates Swift NSManagedObject subclasses. Benefits Why is it better than Xcode generation? Xcode generates prop

null 14 Apr 29, 2022
OTOperations - Useful Swift NSOperation and NSOperationQueue subclasses

OTOperations Useful Swift NSOperation (Operation) and NSOperationQueue (Operatio

Steffan Andrews 2 Feb 23, 2022