-
Notifications
You must be signed in to change notification settings - Fork 2
2. Buttons
Interactive and fun UIs are all the rage. They really do bring a new level of interaction to the screen. Just swap your UIButton's class out for CBButton and you're good to go. If you need to adjust the animations for a different feel, just make a few changes in the Attributes Instepctor.
To handle selections, do the same things you would wiht your UIButton.
-
bouncy
: Enable bouncy animation when the button is touched. -
popWhenSelected
: If true, the popAnimation will run automatically when selected is set to true. -
damping
: The spring damping to apply the bounce animation -
shrinkScale
: The percentage to scale down towhen selected from the initial value (0-1) -
popScale
: The percentage to scale up to when the popAnimation is run (1+) -
cornerRadius
: Round the corners of the view to whatever radius you wish -
circleCrop
: Let autolayout do the work, CornerRadius will be set to 50% anytime your view changes size -
borderWidth
: Well, set the width of the border -
borderColor
: And the color of the border
Inspired by Facebooks Paper, this button renders various icon and animates transitions between them with core animation. And it's a subclass of CBButton
so you get all the bouncy goodness.
-
None
: No icon is displayed -
Hamburger
: The classic bar hamburger -
Add
: A close (X) icon -
AngleLeft
: A close (X) icon -
AngleRight
: A right pointing cheveron (>) -
ArrowLeft
: A left pointing arrow -
ArrowRight
: A right pointing Arrow
setIconType(icon:animated:)
: Update the icon with a CBIconType and optionally animate the transition
Ever wanted a button with more than an image to the left and text to the right? Well here you go, CBButtonView. All the functionality of a UIButton with the subview of a UIView, plus the animation of CBButton. If you're in the storyboard, just drop a UIView in, add your views then drop your IBActions to the controller.