Import a swift into another swift

0

I want to import a swift file into another swift file, how to proceed?

Using Xcode 7.0 beta 3 via Swift 2 in an unsuccessful attempt

    
asked by anonymous 31.07.2015 / 20:12

3 answers

1

Unlike Object-C, swift works as if it were Java, it automatically checks the classes you have in the project, interpreting them as an object.

So you can declare an object:

let meni = Meni()

From the instantiated class you can pick up your methods.

    
10.08.2015 / 17:32
0

To call a class inside another class we do not use import . Within the class ViewController you create a variable and place the value. Example: let meni = Meni()

    
06.08.2015 / 00:11
0

Use swift import when you want to include packages:

import UIKit 
import Foundation
import MeuFramework        //Caso tenha criado o seu próprio framework

.swift files already included in your project will be recognized automatically, just call the desired resource without worrying about importing it into another file. But it is essential that he be present in some way in his project.

    
02.09.2015 / 14:17