GithubHelp home page GithubHelp logo

Comments (6)

james-ff avatar james-ff commented on June 25, 2024

+1 Would also like to see this added

from bryxbanner.

harlanhaskins avatar harlanhaskins commented on June 25, 2024

Hmm...the didTapBlock should absolutely be doing this. I'll investigate -- this is a promised feature though!

from bryxbanner.

ThoseGuysInTown avatar ThoseGuysInTown commented on June 25, 2024

This is how I'm trying to use it now:

let banner = Banner(
   title: "\(lastComment!.title) just commented!",
   backgroundColor: UIColor.blue()
)
banner.dismissesOnTap = true
banner.springiness = .None
banner.show(duration: 1.5)
banner.didTapBlock?({
   print("tapped")
}())

Also tried:

banner.didTapBlock?(test())

func test() -> () {
   print("block")
}

from bryxbanner.

james-ff avatar james-ff commented on June 25, 2024

Is this coming / being fixed soon? Would really like to use this library but not having this feature makes it not possible for us at the moment.

from bryxbanner.

spottedparrot avatar spottedparrot commented on June 25, 2024

@ThoseGuysInTown, I successfully detect and act on the user tapping on banner using the following code in swift, I think you need to setup the didtapblock before doing the show:

      `  // show a thumbs down icon in the banner:
        banner = Banner(title: title, subtitle: messageString, image: UIImage(named: "info"), backgroundColor: middleColor)
        banner.dismissesOnTap = true

    // Setup the did tab on banner block to goto the specified tab:
        banner.didTapBlock = {
            self.appDelegate.appLog.debug("Banner tapped, going to tab index \(gotoTabIndexOnTap).")

            let switchEvent = SwitchToTabIndexEvent(destTabIndex: gotoTabIndexOnTap)

            SwiftEventBus.post("SwitchToTabIndexEvent", sender: switchEvent)
        }

    banner.show(duration: 3.0)

`

from bryxbanner.

ThoseGuysInTown avatar ThoseGuysInTown commented on June 25, 2024

Thanks! This works well

from bryxbanner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.