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

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

iOS Swift Today Extension: import class from container app?

No Such module whenever import any class swift ios

Using a custom swift framework from a swift project

Create and import swift framework

Swift - Import my swift class

Calling class in swift from kotlin/native framework

How to import opencv2 framework in iOS Swift

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

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

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

Function from another class ios swift not executed

iOS reloading a UITableView from a Swift class/object

Opening a view from a custom class Swift IOS

create a swift ios framework

Spectrogram from AVAudioPCMBuffer using Accelerate framework in Swift

Import Framework in Swift Project, Xcode

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

Application Class in IOS Swift

import swift linked objc class in swift

Manage a UIPickerView from an External Class - Using Swift

Access SKCameraNode from a different class using Swift

using IBOutlet from another class in swift

Not able to import UserNotifications in iOS Swift

How to import private framework headers in a Swift framework?

Cannot Import Firebase Into Swift Class

Using Accelerate framework in Swift

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

How do I use a private iOS framework from Swift?