Coder Social home page Coder Social logo

Comments (4)

Daltron avatar Daltron commented on August 20, 2024

Hi @ed-mejia! 😄 Could you send me a working example replicating this issue so I can see whats going on?

from notificationbanner.

ed-mejia avatar ed-mejia commented on August 20, 2024

Hi @Daltron !!!,

I couldn't put together a sample (bit short of time), but I can explain what's the issue and how I did work around it.

calling banner.show(on: target) will cause the banner view to be added as a subView of the target viewController, that's ok if you are dealing with UIViewControllers but if you have a UITableViewController or UICollectionViewController the view will be a scrollView and the banner will scroll with it.

In my case I have a static registration form with a UITableViewController so as soon as the user scrolls to the bottom to finish up all the fields the banner is gone at the top of the scrollView.

I tried to "hack" the banner view to support this case but I couldn't find any clean solution with the short time I had, so what I did was to create a UIViewController called "container" and move my UITableViewController as a child controller of the container, after that when displaying the banner I do something like this:

let target = self is UITableViewController ? self.parent : self        
banner.show(on: target)

This works pretty good, I don't know if the actual bannerView could handle internally this due to the nature of UITableViewControllers/UICollectionControllers views?

from notificationbanner.

Daltron avatar Daltron commented on August 20, 2024

@ed-mejia Thanks for the in depth explanation. I understand what is going on. What I what do if I were you would be create a custom UIView object and put your table view inside that and then assign that custom view like so viewController.view = customView.

from notificationbanner.

Daltron avatar Daltron commented on August 20, 2024

Going to close for now due to no activity.

from notificationbanner.

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.