How can I get my custom framework to work in swift repl?

So I am going around and around with this problem trying to import a custom framework in the swift repl. I have followed the instructions here: https://stackoverflow.com/questions/26892483/can-i-import-my-project-code-into-the-swift-repl/27882120#27882120. It seems self explanatory but each time I import my framework I get an error

Tab completion on the import statement in the repl confirms that my framework is not there.


I am using Xcode Version 10.2.1 on macOS 10.14.5.


Steps to reproduce:

I create a Cocoa Framework, put a .swift file in it that has a public class and public class func that says "Hello", under Product>Scheme>Edit Scheme> Run I chose Release. In Terminal I start the repl with 'swift -F <drag Framework from Xcode navigator panel to Terminal>' hit enter.

Welcome to Apple Swift version 5.0.1 (swiftlang-1001.0.82.4 clang-1001.0.46.4).

Type :help for assistance.

Try to import my framework then get the error:

error: repl.swift:1:8: error: no such module 'MyFramework'

import MyFramework

^

I have even moved the framework from DerivedData to ~/Desktop but that doesn't seem to matter.

Please help!

Thank you.

Accepted Answer

I figured it out. The -F flag is the DIRECTORY where the swift process looks for the framework. I was passing the actual framework as the argument. DUH! Hope this helps someone.

How can I get my custom framework to work in swift repl?
 
 
Q