marty-suzuki / SAHistoryNavigationViewController

SAHistoryNavigationViewController realizes iOS task manager like UI in UINavigationContoller. Support 3D Touch!
MIT License
1.57k stars 91 forks source link

Is it usable in a objective-c project? #10

Closed appfabtech closed 9 years ago

appfabtech commented 9 years ago

Thanks

marty-suzuki commented 9 years ago

Hi, @pcecchetti! Thanks for your question.

You can use SAHistoryNavigationViewController in objective-c project.

How to use

You have to add SAHistoryNavigationViewController directory in your objective-c project.

<# ProductName #>-Swift.h is automatically generated in you project, so you import <# ProductName #>-Swift.h in .h or .m file where you want to use SAHistoryNavigationViewController. (If you can not import <# ProductName #>-Swift.h, please try once to build your project without import it. Then you might be able to import.)

This is sample code for Objective-C

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
ViewController *viewControlelr = [storyboard instantiateViewControllerWithIdentifier:@"ViewController"];

SAHistoryNavigationViewController *navigationController = [[SAHistoryNavigationViewController alloc] initWithRootViewController:viewControlelr];
[self presentViewController:navigationController animated:true completion:nil];

In addiotion, this is link for Apple Official Document of Using Swift from Objective-C.

Thank you.

marty-suzuki commented 8 years ago

You need to import "[Your Project Name]-Swift.h" in you objective-c files.

bridge-header.h is used to import objective-c class from swift class. xxx-Swift.h is used to import swift class from objective-c class.

On 2015年11月7日(土) at 19:06 pepejeria notifications@github.com wrote:

I manually added the SAHistoryNavigationViewController directory to my Objective-C project (I also have a -Bridging-Header.h file), but I am getting a "Unknown class SAHistoryNavigationViewController in Interface Builder file." error. Do you know what could be the cause of this problem?

— Reply to this email directly or view it on GitHub https://github.com/szk-atmosphere/SAHistoryNavigationViewController/issues/10#issuecomment-154688361 .