A general problem with starting a new project in a new language is that most of the times you are missing the libraries, classes etc. you feel comfortable with.
Same happens with making the switch from Objective-C to Swift.
But there is a solution that is called “bridging header”, that brings Objective-C into Swift.
Using it , its not that complicated.
- create a .h file in your project, e.g. projectname-bridging-header.h
- open the Build Settings in your project targets and search for “bridging“
- add your filename (here: projectname-bridging-header.h) to the “Objective-C Bridging Header” including the path the file can be found (e.g. projectname/projectname-bridging-header.h)
- open your projectname-bridging-header.h and add your import lines as you would do in a normal Objective-C header (e.g. #import “foo.h”)
Now you can access and use the new available classes in the Swift way.