iOS import swift class from swift using framework

Artem Kislitsyn

How do I import a Swift class from a framework?

  1. I have Xcode Workspace
  2. I create a Cocoa touch framework with using Swift
  3. I create a Swift class named TestClass in that Cocoa touch framework
  4. I create a Tabbed Base iOS application
  5. I import my framework in that tabbed iOS application using import FrameWorkTest

The application project compiler can't find TestClass. How can I import TestClass for use in the main application?

It says that TestClass is not defined. I also want to add an extension in FrameWork an then use it.

https://github.com/ArtemKyslicyn/-SwiftImportFrameworkTest

I'm using this Tutorial http://www.swift-studies.com/blog/2014/6/30/creating-a-pure-swift-framework-for-both-ios-and-mac

I'm on Xcode version 6.0 seed

Thanks

Artem Kislitsyn

Here's one solution I found:

  1. Create new iOS project
  2. Press on project
  3. Press + to add target
  4. In the resulting window, choose cocoa touch framework
  5. Press on project and press add dependency and add framework
  6. Success!

screenshot illustrating the success

I used the solution here: https://github.com/ArtemKyslicyn/-SwiftImportFrameworkTest in the project named AddingFrameWork

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Swift - Import my swift class

Import Framework in Swift Project, Xcode

Cannot Import Firebase Into Swift Class

How to import private framework headers in a Swift framework?

How to import opencv2 framework in iOS Swift

Create and import swift framework

iOS Swift Today Extension: import class from container app?

iOS reloading a UITableView from a Swift class/object

Using Accelerate framework in Swift

Manage a UIPickerView from an External Class - Using Swift

Spectrogram from AVAudioPCMBuffer using Accelerate framework in Swift

create a swift ios framework

How do I use a private iOS framework from Swift?

Not able to import UserNotifications in iOS Swift

Migrating from `POPSpringAnimation` to native iOS framework in Swift 4

iOS Swift framework: How to import Objective C code into swift framework properly?

Application Class in IOS Swift

No Such module whenever import any class swift ios

Calling class in swift from kotlin/native framework

iOS Swift: Send log information to iOS app from iOS framework

Function from another class ios swift not executed

Using a custom swift framework from a swift project

Is there class/library/framework to call web service in SWIFT language in iOS?

Opening a view from a custom class Swift IOS

using IBOutlet from another class in swift

Access SKCameraNode from a different class using Swift

Conditionally import a framework (such as Speech) based on iOS Version in Swift?

import swift linked objc class in swift

How to export a swift class that I made from one file and import it to another using the cocoa framework without Xcode?