To use Swift class in Objective C , follow given steps :
1. Create one Objective C class named User.
2. A popup display with "Would You like to configure an Objective-C bridging Header". Choose Create Bridging Header.
4. Set Product Module Name : ProjectName
8. Set Objective-C Bridging Header : SwiftInObjectiveC/SwiftInObjectiveC-Bridging-Header.h
10. Clean and Run your Project
|
Import into Swift |
Import into Objective-C |
Swift code |
No Import Statement |
#import |
Objective-C Code |
No Import Statement; Objective-C |
#import "Header.h" |