LTHRadioButton alternatives and similar libraries
Based on the "UI" category.
Alternatively, view LTHRadioButton alternatives based on common mentions on social networks and blogs.
-
Lottie
An iOS library to natively render After Effects vector animations -
iCarousel
A simple, highly customisable, data-driven 3D carousel for iOS and Mac OS -
IQKeyboardManager
Codeless drop-in universal library allows to prevent issues of keyboard sliding up and cover UITextField/UITextView. Neither need to write any code nor any setup required and much more. -
SVProgressHUD
A clean and lightweight progress HUD for your iOS and tvOS app. -
AsyncDisplayKit
Smooth asynchronous user interfaces for iOS apps. -
DZNEmptyDataSet
A drop-in UITableView/UICollectionView superclass category for showing empty datasets whenever the view has no content to display -
IGListKit
A data-driven UICollectionView framework for building fast and flexible lists. -
FSCalendar
A fully customizable iOS calendar library, compatible with Objective-C and Swift -
Material
A UI/UX framework for creating beautiful applications. -
TTTAttributedLabel
A drop-in replacement for UILabel that supports attributes, data detectors, links, and more -
animated-tab-bar
:octocat: RAMAnimatedTabBarController is a Swift UI module library for adding animation to iOS tabbar items and icons. iOS library made by @Ramotion -
folding-cell
:octocat: 📃 FoldingCell is an expanding content cell with animation made by @Ramotion -
NVActivityIndicatorView
A collection of awesome loading animations -
SkeletonView
☠️ An elegant way to show users that something is happening and also prepare them to which contents they are awaiting -
LTMorphingLabel
[EXPERIMENTAL] Graceful morphing effects for UILabel written in Swift. -
MGSwipeTableCell
An easy to use UITableViewCell subclass that allows to display swippable buttons with a variety of transitions. -
SWTableViewCell
An easy-to-use UITableViewCell subclass that implements a swippable content view which exposes utility buttons (similar to iOS 7 Mail Application) -
FlatUIKit
A collection of awesome flat UI components for iOS. -
SwiftMessages
A very flexible message bar for iOS written in Swift. -
JTAppleCalendar
The Unofficial Apple iOS Swift Calendar View. Swift calendar Library. iOS calendar Control. 100% Customizable -
XLForm
XLForm is the most flexible and powerful iOS library to create dynamic table-view forms. Fully compatible with Swift & Obj-C. -
ViewAnimator
ViewAnimator brings your UI to life with just one line -
JVFloatLabeledTextField
UITextField subclass with floating labels - inspired by Matt D. Smith's design: http://dribbble.com/shots/1254439--GIF-Mobile-Form-Interaction?list=users -
TPKeyboardAvoiding
A drop-in universal solution for moving text fields out of the way of the keyboard in iOS -
FSPagerView
FSPagerView is an elegant Screen Slide Library. It is extremely helpful for making Banner View、Product Show、Welcome/Guide Pages、Screen/ViewController Sliders. -
SVPullToRefresh
Give pull-to-refresh & infinite scrolling to any UIScrollView with 1 line of code. -
AMScrollingNavbar
Scrollable UINavigationBar that follows the scrolling of a UIScrollView -
Koloda
KolodaView is a class designed to simplify the implementation of Tinder like cards on iOS. -
SwipeCellKit
Swipeable UITableViewCell/UICollectionViewCell based on the stock Mail.app, implemented in Swift. -
Alerts & Pickers
Advanced usage of UIAlertController and pickers based on it: Telegram, Contacts, Location, PhotoLibrary, Country, Phone Code, Currency, Date... -
SCLAlertView-Swift
Beautiful animated Alert View. Written in Swift -
Macaw
Powerful and easy-to-use vector graphics Swift library with SVG support -
TextFieldEffects
Custom UITextFields effects inspired by Codrops, built using Swift -
ViewDeck
An implementation of the sliding menu found in various iOS apps. -
SwiftEntryKit
SwiftEntryKit is a presentation library for iOS. It can be used to easily display overlays within your iOS apps. -
PageMenu
A paging menu controller built from other view controllers placed inside a scroll view (like Spotify, Windows Phone, Instagram) -
Material Components
[In maintenance mode] Modular and customizable Material Design UI components for iOS -
SideMenu
Simple side/slide menu control for iOS, no code necessary! Lots of customization. Add it to your project in 5 minutes or less. -
SWRevealViewController
A UIViewController subclass for presenting side view controllers inspired on the FaceBook and Wunderlist apps, done right ! -
expanding-collection
:octocat: ExpandingCollection is an animated material design UI card peek/pop controller. iOS library made by @Ramotion -
CSStickyHeaderFlowLayout
UICollectionView replacement of UITableView. Do even more like Parallax Header, Sticky Section Header. Made for iOS 7.
Appwrite - The Open Source Firebase alternative introduces iOS support
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of LTHRadioButton or a related project?
README
LTHRadioButton
Slightly inspired by Google's material radio button.
The clip below has 3 sections: full speed, 25% and 10%, but after converting it to GIF, it actually made it longer, so the 10% part takes a really long time. Here's an mp4 link; try with Chrome if Safari doesn't work - for me it doesn't.
How to install
Swift Package Manager
NOTE: These instructions are intended for usage on Xcode 11 and higher. Xcode 11 is the first version of Xcode that integrates Swift Package Manager and makes it way easier to use than it was at the command line. If you are using older versions of Xcode, we recommend using CocoaPods.
- Go to File > Swift Packages > Add Package Dependency...
- Paste the URL to the
LTHRadioButton
repo on GitHub (https://github.com/rolandleth/LTHRadioButton.git) into the search bar, then hit the Next button: - Select what version you want to use, then hit next (Xcode will automatically suggest the current version Up to Next Major).
- Select the
LTHRadioButton
library and then hit finish. - You're done!
CocoaPods
CocoaPods is a dependency manager for Cocoa projects. You can install it with the following terminal command:
gem install cocoapods
To integrate LTHRadioButton
into your Xcode project using CocoaPods, specify it in your Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!
target '<Your Target Name>' do
pod 'LTHRadioButton'
end
Then, run the following terminal command:
pod install
Manual
Drag LTHRadioButton.swift
from the source
folder into your Xcode project.
How to use
The initializer takes up to 3 params: a diameter
, a selectedColor
, and a deselectedColor
. All of them are optional:
diameter
defaults to18
selectedColor
defaults to a light bluedeselectedColor
defaults toUIColor.lightGray
It doesn't use Auto Layout internally, but after initialization it will have a proper size, so you can simply create constraints based on its frame.width
and frame.height
.
Properties
selectedColor
and deselectedColor
have been made publicly customizable for cases like a tableView
with alternating row and radio colors, where the tableView
might dequeue a cell with one color for displaying a cell with a different color.
isSelected
- Indicates whether the radio button is selected.
useTapGestureRecognizer
- Indicates whether a tap gesture recognizer should be added to the control when setting callbacks. This defaults to true
just so that onSelect
and onDeselect
can add the gesture recognizer automatically, but the recognizer is not added by default.
- Settings this to
true
will also add the requiredUITapGestureRecognizer
if needed. - Settings this to
false
will also remove theUITapGestureRecognizer
if it was previously added.
Methods
init(diameter: CGFloat = 18, selectedColor: UIColor? = nil, deselectedColor: UIColor? = nil) // Colors default internally if nil.
func select(animated: Bool = true) // Selects the radio button.
func deselect(animated: Bool = true) // Deselects the radio button.
Callbacks
You can make use of the onSelect
and onDeselect
methods to add closures to be run when selecting/deselecting the control. Since these closures make most sense for taps and because there are no recognizers by default, these methods will also add one (and only one) UITapGestureRecognizer
to the control to handle the taps; the closure calls happen right as the animations begin.
If you'd like to use the callbacks but don't need the tap gesture recognizer, you can set useTapGestureRecognizer
to false
.
Example
let radioButton = LTHRadioButton(selectedColor: .red)
container.addSubview(radioButton)
radioButton.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
radioButton.centerYAnchor.constraint(equalTo: container.centerYAnchor),
radioButton.leadingAnchor.constraint(equalTo: container.leadingAnchor, constant: 16),
radioButton.heightAnchor.constraint(equalToConstant: radioButton.frame.height),
radioButton.widthAnchor.constraint(equalToConstant: radioButton.frame.width)]
)
radioButton.onSelect {
print("I'm selected.")
}
radioButton.onDeselect {
print("I'm deselected.")
}
[...]
radioButton.select() // I'm selected.
[...]
radioButton.deselect(animated: false) // I'm deselected.
Apps using this control
If you're using this control, I'd love hearing from you!
License
Licensed under MIT. If you'd like (or need) a license without attribution, don't hesitate to contact me.
*Note that all licence references and agreements mentioned in the LTHRadioButton README section above
are relevant to that project's source code only.