xcode6 - How do I import a Swift file from another Swift file? -
i want include swift class file, test
primenumbermodel.swift
import foundation class primenumbermodel { }
primenumbermodeltests.swift
import xctest import primenumbermodel // gives me "no such module 'primenumbermodel'" class primenumbermodeltests: xctestcase { let testobject = primenumbermodel() // "use of unresolved identifier 'primenumbermodel'" }
both swift files in same directory.
i had same problem, in xctestcase
files, not in normal project files.
to rid of
use of unresolved identifier 'primenumbermodel'
i needed import
base module in test file. in case target called 'myproject' added import myproject
, class recognised.
Comments
Post a Comment