AFDropdownNotification
Dropdown notification view for iOS
Installation
If you're using CocoaPods, just add this line to your Podfile:
pod 'AFDropdownNotification', '~> 1.0'
If you're not, import these files to your project:
AFDropdownNotification.h
AFDropdownNotification.m
Usage
First of all, init your AFDropdownNotification class and set your main class as AFDropdownNotificationDelegate
:
You can configure the title text with the titleText
property, the subtitle text with subtitleText
, an optional left image defined as image
, and two optional buttons, with topButtonText
and bottomButtonText
. For example:
If you want to hide the notification by tapping it, set dimissOnTap
to YES:
To present it, you can choose if you want to use UIKit dynamics (which will include a subtle bounce) or a regular lineal UIKit animation:
Finally, to handle the buttons taps, implement the two methods defined by the delegate, -dropdownNotificationTopButtonTapped
and -dropdownNotificationBottomButtonTapped
.
Also, you can use blocks: