gokulgovind / GLNotificationBar

GLNotificationBar is a ios10 style notification bar, can be used to handle push notification in active state.
MIT License
301 stars 44 forks source link

For detailed style, show the detailed view as the default action. #9

Closed internalG closed 7 years ago

internalG commented 7 years ago

The detailed view only can be shown by swipe down gesture. If user action is nil, the detailed view should be shown by tap. But below code won't work.

    @IBAction func didSelectmessage(_ tapgesture: UITapGestureRecognizer) {
        if (notificationBar != nil) {
            UIView.animate(withDuration: 0.5, animations: {
                notificationBar.frame.origin = CGPoint(x: 0, y: -BAR_HEIGHT)
                }, completion: { (yes) in
                    notificationBar.removeFromSuperview()
            })
        }
        closeMessage(nil)
        if ((messageDidSelect) != nil) {
            messageDidSelect(true)
        } else {
            setUpDetailedNotificationBar(header.text, body: body.text, action: [])
        }
    }
gokulgovind commented 7 years ago

hi @internalG , You mean when notification bar's preferred style is set to simpleBanner. It should open as detail view when user taps on notification..? If so it should't be like that right.

Use of style simpleBanner is just to notify user about something, developer can handle other things .

If i was wrong feel free to comment back.

internalG commented 7 years ago

I mean the detailed style. But the latest update of var messageDidSelect:((Bool) -> Void)? is a workaround for that. Thank you!