dpbataller
dpbataller

Reputation: 1207

import classes with Swift iOS

I'm trying Swift and I'm having some troubles.. I have a TableViewController.swift and also a DataModel.swift but I don't know how to import DataModel class into TableViewController to use in it. I'm trying with

import DPBDataModel.swift  

but it doesn't works (No such module)

Thanks for your replies!

Upvotes: 11

Views: 18565

Answers (2)

Priyanka
Priyanka

Reputation: 543

We need not to import any class in swift like objective c Simply instantiate your class & you can use it.

Upvotes: 7

Zedenem
Zedenem

Reputation: 2559

Try just using your DataModel class into TableViewController without importing anything ;-)

Upvotes: 16

Related Questions