简体   繁体   中英

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'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM