What is TORoundedButton?

TORoundedButton is an open source UI control of a standard user button. Its design consists of displaying text on top of a solid rectangle with rounded corners. This UI style has started becoming more and more common in iOS 11 and above, but while Apple has an official one they use internally, it is not possible to achieve this effect without heavily modifying UIButton.

TORoundedButton has been crafted to be as graphically performant as possible, with specific codepaths created for whether the button is opaque (eg, it is displayed over a solid color that never changes), or if it is transparent (Displayed over dynamic content that changes)

TORoundedButton is not simply a subclass of UIButton. Instead, it is a subclass of UIControl with all button graphics and behaviors re-engineered from scratch.

Features:

  • A completely custom implementation; no UIButton hacking.
  • Implemented with guidance from Core Animation engineers at WWDC 2019.
  • Extremely flexible with many options for configuring the look and feel of the button.
  • Integrates with Interface Builder for visual configuration.
  • When necessary for dynamic background content, it uses Core Animation’s cornerRadius feature to still allow a performant, dynamically clipped button.
  • Elegantly cancels and resumes animations when the user slides their finger on and off the button.
  • Piggy-backs off most standard UIView properties in order to minimize the learning curve.
  • Includes dynamic color code to generate a ‘tapped’ shade of the normal color, saving you extra effort.
  • Fully compatible with Swift, with the class name RoundedButton.

Overview

  • Pricing: Free
  • Resource Link: https://github.com/TimOliver/TORoundedButton
  • Resource Maker: Tim Oliver
  • Mobile Platform Destination: iOS Apps
  • Mobile Platform Support: Native iOS
  • Programming Languages: Objective-C
  • iOS Versions Supported: iOS 10.0+, iOS 11.0+, iOS 12.0+
  • CocoaPods: TORoundedButton
  • Carthage: TimOliver/TORoundedButton