• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Swift Framework in a Swift MacOSX Application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Swift Framework in a Swift MacOSX Application


  • Subject: Swift Framework in a Swift MacOSX Application
  • From: Thomas Wetmore <email@hidden>
  • Date: Sun, 22 Feb 2015 23:53:10 -0500

I am having a problem getting an app to resolve a class in a custom framework. This is my first attempt to build an all Swift framework as one project in a workspace and have the framework embedded in an app built from another project in the workspace.

I have a new Xcode workspace. There are two new projects, both all Swift: 1) a cocoa app named TesterApp, and 2) a framework named StandardKit. One of the classes in StandardKit is named Concordance.

Concordance.swift is in the list of files to compile in the StandardKit framework. The StandardKit framework is in TesterApp’s Linked Frameworks and Libraries list. When I change code in the StandardKit to introduce a compiler error, and then build TesterApp, the compiler first recompiles the framework and shows the error, proving that the dependent compilation is working right. There was a StandardKit.h file automatically generated that is part of the framework, but there is nothing in it that file than the boilerplate. (Should the new Swift classes in the framework be mentioned them that file in any way?)

When I look into the package contents of the TesterApp (when I build it without the reference to the Concordance class), and look in the Contents/Frameworks directory, I see the StandardKit.framework bundle and its contents, and they look good as far as I can tell.

I have tried this with Xcode 6.2 and 6.3. I am running Mac OS X 10.10.2

The main window controller in the app has the following code:

———————————————-
import Cocoa
import StandardKit    <<—- Concordance is one of the classes in the StandardKit framework.

class MainWindowController : NSWindowController {
    @IBAction func testButtonPushed (sender: AnyObject) { test() }
}

func test () {
    var c: Concordance = Concordance()  <<—- error: Use of undeclared type ‘Concordance’
}
————————————

Can anyone give advice on what I am doing incorrectly, or what I am not doing that I should be doing?

Thanks,

Tom Wetmore


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Swift Framework in a Swift MacOSX Application
      • From: Quincey Morris <email@hidden>
  • Prev by Date: Re: Automatically close current running program in emulator
  • Next by Date: Re: Swift Framework in a Swift MacOSX Application
  • Previous by thread: Re: Automatically close current running program in emulator
  • Next by thread: Re: Swift Framework in a Swift MacOSX Application
  • Index(es):
    • Date
    • Thread