How to import Swift code to Objective-C -


i have written library on swift sclalertview-swift , wasn't able import current project on (objective-c)

is there ways import it?

#import "sclalertview.swift" - 'sclalertview.swift' file not found 

you need import targetname-swift.h. note it's target name - other answers make mistake of using class name.

this single file autogenerated header defines objective-c interfaces swift classes in project either annotated @objc or inherit nsobject.

if target name contain spaces, replace them underscores (e.g. "my project" becomes "my_project-swift.h")


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -