Code Monkey home page Code Monkey logo

Comments (4)

morganbigot avatar morganbigot commented on August 28, 2024

Hi,
I would need exactly the same behaviour when i click on the description and on the button.
Is there any way to do that ?

Regards,
Morgan

from lgplusbuttonsview.

johnny51925 avatar johnny51925 commented on August 28, 2024

@morganbigot

I fixed this function now

`- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
{

UIView *view = nil;

for (LGPlusButton *button in _buttonsArray)
{
    CGPoint newPoint = [self convertPoint:point toView:button];

    view = [button hitTest:newPoint withEvent:event];
    if (view) break;
}

if(!view){
    for (LGPlusButtonDescription *description in _descriptionsArray)
    {
        CGPoint newPoint = [self convertPoint:point toView:description];

        view = [description hitTest:newPoint withEvent:event];
        if (view) break;
    }
}

if (!view && _coverColor && !_coverView.isHidden)
{
    CGPoint newPoint = [self convertPoint:point toView:_coverView];

    view = [_coverView hitTest:newPoint withEvent:event];
}

return view;

}`
By Adding these code, then you can add UITapGestureRecognizer function on the Description label with userInteractionEnabled = YES

from lgplusbuttonsview.

morganbigot avatar morganbigot commented on August 28, 2024

Thank you!

Le 3 mars 2016 à 17:55, johnny51925 [email protected] a écrit :

@morganbigot

I fixed this function now

`- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
{
//NSLog(@"\nself = %@\nsuper = %@\nsubviews = %@\nsupersubviews = %@\n\n", self, [super hitTest:point withEvent:event], self.subviews, self.superview.subviews);

UIView *view = nil;

for (LGPlusButton *button in _buttonsArray)
{
CGPoint newPoint = [self convertPoint:point toView:button];

view = [button hitTest:newPoint withEvent:event];
if (view) break;

}

if(!view){
for (LGPlusButtonDescription *description in _descriptionsArray)
{
CGPoint newPoint = [self convertPoint:point toView:description];

    view = [description hitTest:newPoint withEvent:event];
    if (view) break;
}

}

if (!view && _coverColor && !_coverView.isHidden)
{
CGPoint newPoint = [self convertPoint:point toView:_coverView];

view = [_coverView hitTest:newPoint withEvent:event];

}

return view;
}

`

By Adding these code, then you can add UITapGestureRecognizer function on the Description label with userInteractionEnabled = YES


Reply to this email directly or view it on GitHub.

from lgplusbuttonsview.

morganbigot avatar morganbigot commented on August 28, 2024

Hi,

Will you make an update of the POD with that fix ?

Regards,

from lgplusbuttonsview.

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.