ergunemr / BottomPopup

BottomPopup provides a popup-like presentation style to any view controller
MIT License
875 stars 88 forks source link

Method does not override any method from its superclass #33

Open maxhis opened 4 years ago

maxhis commented 4 years ago

I subclass the BottomPopupViewController and override the following 3 methods. I can be built on my local, but failed on the build server with Fastlane. The following errors occurred:


❌  PositionSelectViewController.swift:58:19: method does not override any method from its superclass

    override func getPopupHeight() -> CGFloat {
                                       ^

❌  PositionSelectViewController.swift:62:19: method does not override any method from its superclass

    override func getPopupPresentDuration() -> Double {
    ~~~~~~~~      ^

❌  PositionSelectViewController.swift:66:19: method does not override any method from its superclass

    override func getPopupDismissDuration() -> Double {

The weird thing is it can be built if I delete the override keyword of the methods(of course the functions take no effects), which lead build fail on my local.

Both my local Mac and the build server running Xcode Version 11.3.1 (11C504) with CocoaPods version 1.8.4.

Invested two days for the issue, and can't get it to work on both sides. Any help or advice will be appreciated.

sanket003 commented 4 years ago

Use this instead,

override var popupHeight: CGFloat
{
    return 100.0
}

override var popupTopCornerRadius: CGFloat
{
    return 10.0
}
maxhis commented 4 years ago

@sanket003 It seems a Swift version issue, I'm using 5.0 and the BottomPopup is using 4.2. The 3 methods are actually properties in BottomPopupViewController.

My workaround is to copy the source code of the library, instead of using CocoaPods. Ugly but works. The override properties look like:

override var popupHeight: CGFloat {
    get {
        return vkScreenHeight * 0.8
    }
}

override var popupPresentDuration: Double {
    get {
        return 0.25
    }
}

override var popupDismissDuration: Double {
    get {
        return 0.25
    }
}
maxhis commented 4 years ago

@sanket003 Are you still using CocoaPods for the library?

sanket003 commented 4 years ago

@sanket003 Are you still using CocoaPods for the library?

Yes. I'm using CocoaPods.