SlideMenuControllerSwift icon indicating copy to clipboard operation
SlideMenuControllerSwift copied to clipboard

Swift 4 : Declarations from extensions cannot be overridden yet

Open KrishnendraPrakash opened this issue 8 years ago • 13 comments

Integrate in Xcode Version 9.0 beta 3. Issue: Declarations from extensions cannot be overridden yet

Please see screenshot. screen shot 2017-07-24 at 1 23 29 pm

KrishnendraPrakash avatar Jul 24 '17 08:07 KrishnendraPrakash

I am getting the same problem with XCode 9.0 Beta 5. Any solution yet?

ravi8x avatar Aug 11 '17 09:08 ravi8x

@ravi8x How are you showing menu on the view controllers which is not pushed but instead presented? Any solution?

abhijithExperion avatar Aug 19 '17 20:08 abhijithExperion

@abhijithExperion No Abhijith. I have written my own Slider Menu class with very minimal functionalities.

ravi8x avatar Aug 20 '17 04:08 ravi8x

this is a very easily reproducible "bug"; just check out the current branch and import the library to a project using Swift 4 (e.g. XCode 4 Beta 1-4). Probably it is an easy fix...

andylamp avatar Aug 21 '17 00:08 andylamp

@andylamp I am using with pods pod 'SlideMenuControllerSwift' What changes required when using pod with swift 4, XCode - Version 9.0 beta 3 (9M174d). Thanks

KrishnendraPrakash avatar Aug 21 '17 07:08 KrishnendraPrakash

@KrishnendraPrakash the solution, albeit with warnings, for now it seems to be that you have to put the following:

    @objc public func openLeft() {
      slideMenuController()?.openLeft()
    }
  
  
    @objc public func openRight() {
        slideMenuController()?.openRight()    }
  
  
    @objc public func closeLeft() {
        slideMenuController()?.closeLeft()
    }
  
  
    @objc public func closeRight() {
        slideMenuController()?.closeRight()
    }

Specifically, these are located in lines 1055-1075 in SlideMenuController.swift -- they should work but XCode will complain about deprecated functionality... but it's a temporary solution for the time being.

Hope this helps...

andylamp avatar Aug 21 '17 12:08 andylamp

Anybody know if there will be a release for Swift4?

We need the solution via pods installation

KeimyPlaza avatar Aug 22 '17 11:08 KeimyPlaza

Not compatible with swift4

akshayiosdeveloper avatar Aug 31 '17 10:08 akshayiosdeveloper

@akshayiosdeveloper as I said, you can alter the source file as indicated in my previous answer and it will run just fine...

andylamp avatar Aug 31 '17 12:08 andylamp

@akshayiosdeveloper you can use too branch of Swift 4 if you use as pod.

https://github.com/dekatotoro/SlideMenuControllerSwift/tree/swift4

@andylamp I hope you MR is comming soon.

KeimyPlaza avatar Aug 31 '17 13:08 KeimyPlaza

@andylamp You are right but if we use Pod file, It will auto update when we update our other pod files, right ?

arun-perk avatar Oct 12 '17 07:10 arun-perk

@arun-perk you can use the pods git branch tool in order to have a specific version, this can be done easily like so:

platform :ios, '11.0'

target 'YourAppName' do
  use_frameworks!
  # more pods...
    pod 'SlideMenuControllerSwift', :git => 'https://github.com/dekatotoro/SlideMenuControllerSwift.git', :branch => 'swift4''
  # even more pods...
end

Hope this helps.

andylamp avatar Oct 12 '17 20:10 andylamp

Update your pod screen shot 2018-02-10 at 23 48 22 https://guides.cocoapods.org/using/getting-started.html " sudo gem update cocoapods " in terminal

Note : it work for me 👍

jerrypm avatar Feb 10 '18 16:02 jerrypm