0

I have the following set of files in my project:

Filestructurepic

The IAPHelper class uses the objective-c through a bridging header. I was wondering if I could use the IAPHelper class in both my app and its app extension like this:

(Setting IAPHelper's target membership)

IAPHelper_Membership

Without making KeychainWrapper being a member of both classes.

comrade
  • 4,590
  • 5
  • 33
  • 48
Foobar
  • 7,458
  • 16
  • 81
  • 161

1 Answers1

0

No it does not seem to work.

I made TestClassOne

import Foundation

class TestClassOne {
static internal func addOneOne() -> Int {
    return 2;
}


}

TestClassOne is only part of one target.

I made TestClassTwo

import Foundation

class TestClassTwo {
internal static func callTestClassOne() -> Int {

    let i = TestClassOne.addOneOne()
    return i


}

}

TestClassTwo belonged too both targets. I would keep on getting the error TestClassOne not recognized when the TestClassOne file was set to only one target but once I set the TestClassOne file to both targets that error stopped appearing.

Foobar
  • 7,458
  • 16
  • 81
  • 161