https://github.com/timonus/tjbutton
A UIButton that does more
https://github.com/timonus/tjbutton
Last synced: 3 months ago
JSON representation
A UIButton that does more
- Host: GitHub
- URL: https://github.com/timonus/tjbutton
- Owner: timonus
- License: bsd-3-clause
- Created: 2021-04-09T15:47:19.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2024-08-08T02:49:58.000Z (almost 2 years ago)
- Last Synced: 2025-10-10T03:49:08.284Z (8 months ago)
- Language: Objective-C
- Size: 16.6 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TJButton
*A UIButton that does more*
`UIButton` is a surprisingly powerful class, but there are some common things I've found repeating over and over again in apps that I wished were available. This class adds some of those things, namely.
- Setting a background color per-control state (`-setBackgroundColor:forState:`)
- Setting a tint color per-control state (`-setTintColor:forState:`)
- Hit target expansion (`-setHitOutsets:`)
Also, not strictly related to `UIButton`, but I also find myself adding a corner radius, stroke width/color, and using `kCACornerCurveContinuous` if available (iOS 13+). I turned this all into a handy category method on `UIView`: `-tj_applyCornerRadius:borderWidth:borderColor:`.