2
votes

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?

1
steps you did for objective-c bridging? - Uttam Sinha
1 - create a Bridge-Header.h file 2 - add #import "../root/to/the/file" to it 3 - add bridge-header in Build Settings (objective-C Bridging Header in Swift Compiler - Code Generation) And there is no problem to create all things programatically. Problem is only to use in storyboard - soling

1 Answers

4
votes

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