SWRevealViewController icon indicating copy to clipboard operation
SWRevealViewController copied to clipboard

Swift Version

Open Rufy86 opened this issue 8 years ago • 29 comments

is it possible to have a swift version?

Rufy86 avatar Aug 15 '17 09:08 Rufy86

What for? You can use this ObjC library in a Swift project...

iDevelopper avatar Aug 15 '17 10:08 iDevelopper

Yes but this library don't work in Xcode 9. I've open and issue about this.

after that, every code is coded in swift by compiler. than, why to have again a library written in OBJ-C? therefore this library is not updated from 2 years

Rufy86 avatar Aug 15 '17 10:08 Rufy86

I know but I am not the developer of this library. Why not working on Xcode 9? I have Xcode 8.3.3. What is the issue?

iDevelopper avatar Aug 15 '17 10:08 iDevelopper

If I'm working on Xcode 9 is because I've reasons. if you aren't the developer of this library, please, don't intrude into the conversation. my issues are for developers of this library. I this is a great library and Whether this library is maintained and converted into swift can have a great potential for improvement

Rufy86 avatar Aug 15 '17 11:08 Rufy86

I know perfectly this library and I helped a lot of developer. It is why I answer. It is allowed, right? I asked you what are the issues on Xcode 9, I not asked you why do you use Xcode 9...

iDevelopper avatar Aug 15 '17 11:08 iDevelopper

I also know the developer and I don't think there will be a swift version. You are welcome to fork it!

iDevelopper avatar Aug 15 '17 11:08 iDevelopper

I'm sorry. I did not understand correctly.

I've open an issue about this problem, anyway they are these: 1)Console say me this:Unknown class SWRevealViewController in Interface Builder file.

2)if I connect button to swrevealviewcontroller action, the app crash with this error:Undefined symbols for architecture arm64: "OBJC_CLASS$_SWRevealViewController" referred from:

Rufy86 avatar Aug 15 '17 11:08 Rufy86

Ok, I don't think it is relative to Xcode 9, but I will install it to test.

iDevelopper avatar Aug 15 '17 11:08 iDevelopper

also know the developer and I don't think there will be a swift version

This is so sad.

You are welcome to fork it! I hope to use it again in objective-c because I'm not a genius of swift and unfortunately I've no time to try to make it in swift, but if I have no choice..........

I don't think it is relative to Xcode 9 in Xcode 8.x.x i've no problem

Rufy86 avatar Aug 15 '17 11:08 Rufy86

anyway, thank you for your interest about this

Rufy86 avatar Aug 15 '17 11:08 Rufy86

Downloading Xcode 9, but my connection is very slow. Do you drag the .h and .m in your project or do you use Cocoapods? (Cocoapods version is not up to date). The latest version is 2.4 and you can see it in the .h

iDevelopper avatar Aug 15 '17 11:08 iDevelopper

I drag the .h and .m file. I don’t use cocoapod because I don’t like it

Rufy86 avatar Aug 15 '17 12:08 Rufy86

Tested and works!

In your storyboard check it is like this screenshot:

2017-08-16_07-01-22

And Product->Clean And Alt+Product->Clean Build Forder...

iDevelopper avatar Aug 16 '17 05:08 iDevelopper

I'm sorry but the problem still

this is the error: Undefined symbols for architecture x86_64: "OBJC_CLASS$_SWRevealViewController", referenced from: objc-class-ref in MyClassViewController.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Rufy86 avatar Aug 16 '17 09:08 Rufy86

Ok this is the 2) point. How did you connect your button? Can you elaborate? What is your code for that?

iDevelopper avatar Aug 16 '17 09:08 iDevelopper

I connect the button by Storyboard @IBOutlet weak var menuButton: UIBarButtonItem!

this is the code that when there is, don't build. but when I comment this if everything work

        if self.revealViewController() != nil {
            menuButton.target = self.revealViewController()
            menuButton.action = #selector(SWRevealViewController.revealToggle(_:))
            self.view.addGestureRecognizer(self.revealViewController().panGestureRecognizer())
        }

Rufy86 avatar Aug 16 '17 09:08 Rufy86

Only link error? No compil errors?

iDevelopper avatar Aug 16 '17 10:08 iDevelopper

That's right.

Now I've tried to open the project with Xcode 8. same problem. Now I'm trying to do the opposite. create it in Xcode 8 and open it with Xcode 9

Rufy86 avatar Aug 16 '17 10:08 Rufy86

If I create a the project with Xcode 8 and I open it with Xcode 9 work. I have also 45 warning but work. or build without error

Rufy86 avatar Aug 16 '17 10:08 Rufy86

Did you try to delete the derived data folder?

iDevelopper avatar Aug 16 '17 10:08 iDevelopper

No. How I do it?

Rufy86 avatar Aug 16 '17 10:08 Rufy86

Go to Xcode->Preferences

Tab: Locations

Click on the arrow and in the finder delete all the folder for this application:

2017-08-16_13-01-47

iDevelopper avatar Aug 16 '17 11:08 iDevelopper

I've found the problem. problem

when you add the .h and .m file Though the target flag is checked, the flag don't be checked. when I've checked, The problem has disappeared.

however, a swift version I think be better!

anyway, thank you very much for your help

Rufy86 avatar Aug 16 '17 14:08 Rufy86

nothing. the first problem still again

Unknown class _TtC38MyProjectName22SWRevealViewController in Interface Builder file.

Rufy86 avatar Aug 16 '17 15:08 Rufy86

Found it! 29348069-2e66462c-8251-11e7-911b-95f2433a9576

without check work perfectly

Rufy86 avatar Aug 16 '17 15:08 Rufy86

Yes when you drag a .m .h into a project there is a dialog box where you can check the targets. Well done! For the Swift version, I do not think there will be one except a fork. However, I have a similar library (see my profile) and I have a Swift version (not yet on line) but soon. I can send you the files if you want.

iDevelopper avatar Aug 16 '17 15:08 iDevelopper

If you are interested, open an issue to https://github.com/iDevelopper/PBRevealViewController

iDevelopper avatar Aug 16 '17 16:08 iDevelopper

Same issue. Any Solution?

rajeevjaiswal avatar Sep 17 '17 14:09 rajeevjaiswal

Solved. viewcontroller.m file target membership was not checked

rajeevjaiswal avatar Sep 17 '17 14:09 rajeevjaiswal