Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to import a class present inside a custom framework in swift

I have a custom frame work and it contains some public class.But i cannot able to use that public class. In objective C we can import as

#import <XYZ/XYZCustomCell.h>

but how is it possible in swift

like image 808
Kiran P Nair Avatar asked Mar 15 '16 04:03

Kiran P Nair


1 Answers

You import a module using the "import" keyword, it works the following way:

import XYZ

If you want to import a struct/function/enum only, you can do this:

import struct XYZ.SomeStruct
import func XYZ.someFunc

That syntax fits for typealias, struct, class, enum, protocol, var, or func.

like image 99
binchik Avatar answered Sep 18 '22 02:09

binchik