当前位置: 动力学知识库 > 问答 > 编程问答 >

How to add my class reference in classes which I have downloaded from pod? IOS Objective-c

问题描述:

I Will have to do some customization in the third party code I have downloaded via pod.

In my last application, I have used MFSideMenu's library. Where I had to stop some screen to swipe from the left. So I have gone with manually download the "MFSideMenu" update the method as

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch {

UINavigationController *centerNav =self.centerViewController;

if ([[centerNav topViewController] isKindOfClass:[XXX class]]) {

return NO;

}

if([gestureRecognizer isKindOfClass:[UITapGestureRecognizer class]] &&

self.menuState != MFSideMenuStateClosed) return YES;

if([gestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]]) {

if([gestureRecognizer.view isEqual:[self.centerViewController view]])

return [self centerViewControllerPanEnabled];

if([gestureRecognizer.view isEqual:self.menuContainerView])

return [self sideMenuPanEnabled];

// pan gesture is attached to a custom view

return YES;

}

return NO;

}

In that case, should I use pod like pod 'MFSideMenu', '0.5.5' OR I should go with manually for this library?

If the pod is a good choice than how to import any of my class? in above example, I use the class name as XXX. As if I import any class in a pod it shows me an error of class not found.

Thank you

Ashwin

网友答案:

You should manually add that library into your project. If you don't do it like that, whenever you 'pod update' your changes will be gone. If your changes not local things you can ask for contribution to improve the project. Another option is forking. You can fork the project and make your changes. You should update your podfile like this:

pod 'MFSideMenu', :git => 'https://github.com/your forkedlibrary/MFSideMenu.git', :commit => 'lastcommitid'
分享给朋友:
您可能感兴趣的文章:
随机阅读: