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

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -