Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question #3

Closed
yunxiaocloud opened this issue May 13, 2015 · 2 comments
Closed

Question #3

yunxiaocloud opened this issue May 13, 2015 · 2 comments

Comments

@yunxiaocloud
Copy link

how to run in Objective C project? It is not working in Objective C code even if setting the bridge file.

@udayasri
Copy link

udayasri commented Jul 6, 2015

It works for me ( Xcode 6.4 ) .. I have created a new swift file in my project called 'CCMRadarView.swift' ,
( you will be prompted to add an Objective-C bridging header & I accepted it ) & add the CCMRadarView.swift code in to it .

But I have to change the class declaration " @IBDesignable class CCMRadarView: UIView" to "@objc class CCMRadarView: UIView " as I'm using the swift code inside my objc code.

Then in my UIViewController.h / .m I have import the class as #import "Project_Name-Swift.h" ( if your project name has spaces - "Project Name " or hyphens -"Project-Name" you need to add underscore " Project_Name" when importing the class. )

Then in your .m file -(void)viewDidAppear:(BOOL)animated{ } you can call "startAnimation" method . It will show the animation ..

( In your build phases "project module name" should match with your "Project_Name" )

Hope this works for you ...

@cacmartinez
Copy link
Owner

I have updated the project to support objective-c, and added instructions of how to import it in your projects

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants