soling
soling

Reputation: 551

Using an objective-C class as Custom Class in storyboard in swift project

I'm creating an iOS app using swift. I am using storyboard. I would like to use in my project this API, which was written using objective-C :

https://github.com/StefanLage/SLPagingView

I have done the bridging-header logic but problem is, I am not able to create a view controller with custom class SLPagingViewController in "Show the identity inspector"->"Custom class"->"Class". (Xcode just doesn't find it) I only can call this class programmatically in one of my swift file.

Any suggestions for using this API via storyboard?

Upvotes: 2

Views: 1216

Answers (1)

Uttam Sinha
Uttam Sinha

Reputation: 722

I have downloaded the github code and tried using bridging header. It works as expected. Below are the screenshots & code which I added in bridging header file. Hope you did same steps but may be missed something.

//
//  SwiftL1-Bridging-Header.h
//  SwiftL1
//
//  Created by uttamkumar_s on 4/13/15.
//  Copyright (c) 2015 Uttam. All rights reserved.
//

#ifndef SwiftL1_SwiftL1_Bridging_Header_h
#define SwiftL1_SwiftL1_Bridging_Header_h

#import "SLPagingViewController.h"

#endif

enter image description here

enter image description here

enter image description here

Upvotes: 4

Related Questions