Skip to content

Instantly share code, notes, and snippets.

@ytyubox
Last active May 18, 2019 12:23
Show Gist options
  • Save ytyubox/e7d599e544560a5e56148fbbf3f2b876 to your computer and use it in GitHub Desktop.
Save ytyubox/e7d599e544560a5e56148fbbf3f2b876 to your computer and use it in GitHub Desktop.

Objective-C and Swift

OC project injecting Swift

#import "_projectName_-Swift.h"
@property (nonatomic, strong) _swiftClass_ *property;

Swift project injecting OC

New a header file

  1. Build Settings
  2. Swift Compiler - Code Generation
  3. Objective-C Briding Header: projectName/projectName-Bridging-Header.h
 // _projectName_-Briging-Header.h
#import "_OCClass_.h"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment