Git Product home page Git Product logo

Comments (5)

scenee avatar scenee commented on July 17, 2024

Thanks for your request. I'm considering enabling to assign an instance of a custom BackdropView.

[Added]

I've created iss-614 branch to enable to use a custom backdrop view. I also added a custom backrdop view with blur in the Samples example. Just check it.

from floatingpanel.

DigitalVanilla avatar DigitalVanilla commented on July 17, 2024

Thanks πŸ™πŸ»
In this way some more custom behaviour can be added like I did mention in my first post.
In fact I had to override the pod class for the background view to add some code to send the gesture to the parent view controller.

from floatingpanel.

DigitalVanilla avatar DigitalVanilla commented on July 17, 2024

I had, for now, import brutally the pod into the project and updated the backdropview as the follow, maybe you can have some better ideas how to propagate the gesture in the presenting viewcontroller

  
  public var dismissalTapGestureRecognizer: UITapGestureRecognizer!
  
  public var notification: Notification.Name?
  public var presentingViewcontroller: UIViewController?
  
  override public func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
    // little hack to fire back to the floatingpanel controller an extra action, like dismiss the floating panel
    // and at the same time let the event be trig in the presented viewcontroller
    if let pvc = presentingViewcontroller {
      if let n = notification {
        NotificationCenter.default.post(name: n, object: nil)
      }
      
      return pvc.view.hitTest(point, with: event)
    }

    // 1
    if !self.isUserInteractionEnabled || self.isHidden || self.alpha == 0 {
      return nil
    }
    //2
    var hitView: UIView? = self
    if !self.point(inside: point, with: event) {
      if self.clipsToBounds {
        return nil
      } else {
        hitView = nil
      }
    }
    //3
    for subview in self.subviews.reversed() {
      let insideSubview = self.convert(point, to: subview)
      if let sview = subview.hitTest(insideSubview, with: event) {
        return sview
      }
    }
    
    return hitView
  }
}

from floatingpanel.

DigitalVanilla avatar DigitalVanilla commented on July 17, 2024

Thanks for your request. I'm considering enabling to assign an instance of a custom BackdropView.

[Added]

I've created iss-614 branch to enable to use a custom backdrop view. I also added a custom backrdop view with blur in the Samples example. Just check it.

Nice, when will you merge into master ?

from floatingpanel.

scenee avatar scenee commented on July 17, 2024

I will release the BackdropView update in v2.8.2. Thanks.

from floatingpanel.

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.