slackhq / PanModal

An elegant and highly customizable presentation API for constructing bottom sheet modals on iOS.
MIT License
3.67k stars 529 forks source link

Is it compatible to use in Objective-C project? #110

Open khunshan opened 4 years ago

khunshan commented 4 years ago

### Description

I want to know can we use it in a project based on Objective C non-ARC? Does it use any protocol, extensions or anything which is not supported by Objective C?

What type of issue is this? (place an x in one of the [ ])

Requirements (place an x in each of the [ ])


jayaseelanK126 commented 3 years ago

Yes, you can use, by creating UIViewcontroller Extension in swift and present pan model from view controller extension and call it from your obj c

in UIViewcontroller Extension

@objc func presentPanModelObjc(_ controller: yourViewController)
    {
        presentPanModal(controller)
    }

in Obj c view controller

- (void) yourMethodName
{
[self presentPanModelObjc: yourViewController];
}

This is pan model controller it is also need to be create swift

class  YourViewController: PanModalPresentable {

    var panScrollable: UIScrollView? {
        return nil
    }
}