New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XCode 8 beta 3 No known instance method for selector 'mdLayer:didFinishEffect:' #94

Closed
PWDream opened this Issue Jul 22, 2016 · 6 comments

Comments

Projects
None yet
7 participants
@PWDream

PWDream commented Jul 22, 2016

I use pod manager the project,but the project have a error in XCode 8 beta 3 No known instance method for selector 'mdLayer:didFinishEffect:'.Can you help me? Thank you.

@freakmoder

This comment has been minimized.

Show comment
Hide comment
@freakmoder

freakmoder Jul 22, 2016

experienced the same behaviour here

freakmoder commented Jul 22, 2016

experienced the same behaviour here

@NeilNie

This comment has been minimized.

Show comment
Hide comment
@NeilNie

NeilNie Aug 3, 2016

I have the same issue as well. Here is my fix for this problem.
@protocol MDLayerDelegate <NSObject> @optional - (void)mdLayer:(MDRippleLayer *)layer didFinishEffect:(CFTimeInterval)duration; @end @property (nullable, assign) id delegate;

In the .m file:
- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag { if (anim == [self animationForKey:@"opacityAnim"]) { self.opacity = 0; } else if (flag) { if (_userIsHolding) { _effectIsRunning = false; if (self.delegate) { [self.delegate mdLayer:self didFinishEffect:anim.duration]; } } else { [self clearEffects]; } } }

You can also refer to this link which is a different fix:
aa739ca

NeilNie commented Aug 3, 2016

I have the same issue as well. Here is my fix for this problem.
@protocol MDLayerDelegate <NSObject> @optional - (void)mdLayer:(MDRippleLayer *)layer didFinishEffect:(CFTimeInterval)duration; @end @property (nullable, assign) id delegate;

In the .m file:
- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag { if (anim == [self animationForKey:@"opacityAnim"]) { self.opacity = 0; } else if (flag) { if (_userIsHolding) { _effectIsRunning = false; if (self.delegate) { [self.delegate mdLayer:self didFinishEffect:anim.duration]; } } else { [self clearEffects]; } } }

You can also refer to this link which is a different fix:
aa739ca

@jlaws

This comment has been minimized.

Show comment
Hide comment
@jlaws

jlaws Aug 28, 2016

This is cleaner than @NeilNie's fix.

Update line 135 of MDRippleLayer.m

if ([self.delegate conformsToProtocol:@protocol(MDLayerDelegate)] &&
[self.delegate respondsToSelector:@selector(mdLayer:didFinishEffect:)]) {
id delegate = (id)self.delegate;
[delegate mdLayer:self didFinishEffect:anim.duration];
}

jlaws commented Aug 28, 2016

This is cleaner than @NeilNie's fix.

Update line 135 of MDRippleLayer.m

if ([self.delegate conformsToProtocol:@protocol(MDLayerDelegate)] &&
[self.delegate respondsToSelector:@selector(mdLayer:didFinishEffect:)]) {
id delegate = (id)self.delegate;
[delegate mdLayer:self didFinishEffect:anim.duration];
}

@amphora-ken

This comment has been minimized.

Show comment
Hide comment
@amphora-ken

amphora-ken Sep 11, 2016

Since the method is optional, checking conformance doesn't help. Here's my approach:

  if (self.delegate && [self.delegate respondsToSelector:@selector(mdLayer:didFinishEffect:)]) {
        [(id<MDLayerDelegate>) self.delegate mdLayer:self didFinishEffect:anim.duration];
  }

amphora-ken commented Sep 11, 2016

Since the method is optional, checking conformance doesn't help. Here's my approach:

  if (self.delegate && [self.delegate respondsToSelector:@selector(mdLayer:didFinishEffect:)]) {
        [(id<MDLayerDelegate>) self.delegate mdLayer:self didFinishEffect:anim.duration];
  }
@ernesto

This comment has been minimized.

Show comment
Hide comment
@ernesto

ernesto Oct 17, 2016

Using pod 'MaterialControls' the issue persist. How fix?

ernesto commented Oct 17, 2016

Using pod 'MaterialControls' the issue persist. How fix?

@pxbachs

This comment has been minimized.

Show comment
Hide comment
@pxbachs

pxbachs Oct 18, 2016

Contributor

Thanks all. Plz checkout latest code.

Contributor

pxbachs commented Oct 18, 2016

Thanks all. Plz checkout latest code.

@pxbachs pxbachs closed this Oct 18, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment