Compiled swift module to be used in swift REPL


(CK TUNG) #1

How can I use a compiled swift module to be use in swift REPL or playground ?

such as in swift REPL
import MyModule

P.S. I could use it in swift package manager by adding it as a dependency in the Package.swift


(CK TUNG) #2

I found out I could use
swift -F build/Debug
if the module is build as a target framework
But how to put this framework to use in swift playground ?

···

TUNG CK via swift-users <swift-users@swift.org> 於 14 Jul 2016 1:33 PM 寫道:

How can I use a compiled swift module to be use in swift REPL or playground ?

such as in swift REPL
import MyModule

P.S. I could use it in swift package manager by adding it as a dependency in the Package.swift

_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users


(Zhao Xin) #3

You can create a folder named Sources in your .playground file package and
put your frameworks there. I guess you didn't use Xcode. Or you will find
it yourself.

<img src=’/uploads/default/original/1X/212cc6887ca37f79d6a5cd6209dfcd49ab2dc99c.png’ width=‘609’ height=‘329’>

Zhaoxin

···

On Thu, Jul 14, 2016 at 3:36 PM, TUNG CK via swift-users < swift-users@swift.org> wrote:

I found out I could use
swift -F build/Debug
if the module is build as a target framework
But how to put this framework to use in swift playground ?

> TUNG CK via swift-users <swift-users@swift.org> 於 14 Jul 2016 1:33 PM
寫道:
>
> How can I use a compiled swift module to be use in swift REPL or
playground ?
>
> such as in swift REPL
> import MyModule
>
> P.S. I could use it in swift package manager by adding it as a
dependency in the Package.swift
>
> _______________________________________________
> swift-users mailing list
> swift-users@swift.org
> https://lists.swift.org/mailman/listinfo/swift-users
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users


(CK TUNG) #4

Thanks for you info.

No matter I put the framework under Sources or Resouces, it can't import in playground

···

Zhao Xin <owenzx@gmail.com> 於 14 Jul 2016 3:50 PM 寫道:

You can create a folder named Sources in your .playground file package and put your frameworks there. I guess you didn't use Xcode. Or you will find it yourself.

<屏幕快照 2016-07-14 下午3.49.47.png>

Zhaoxin

On Thu, Jul 14, 2016 at 3:36 PM, TUNG CK via swift-users <swift-users@swift.org> wrote:
I found out I could use
swift -F build/Debug
if the module is build as a target framework
But how to put this framework to use in swift playground ?

> TUNG CK via swift-users <swift-users@swift.org> 於 14 Jul 2016 1:33 PM 寫道:
>
> How can I use a compiled swift module to be use in swift REPL or playground ?
>
> such as in swift REPL
> import MyModule
>
> P.S. I could use it in swift package manager by adding it as a dependency in the Package.swift
>
> _______________________________________________
> swift-users mailing list
> swift-users@swift.org
> https://lists.swift.org/mailman/listinfo/swift-users
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users


(Zhao Xin) #5

You can download this.
https://static.realm.io/downloads/swift/realm-swift-1.0.2.zip

You can find example applications for both iOS and OS X in our release zip

under examples/, demonstrating how to use many features of Realm like
migrations, how to use it with UITableViewControllers, encryption,
command-line tools and much more.

​You can learn what they did it. They use a playground wrapper to do it.

Zhaoxin​

···

On Thu, Jul 14, 2016 at 4:59 PM, TUNG CK <cktung@mac.com> wrote:

[image: image1.PNG]
Thanks for you info.

No matter I put the framework under Sources or Resouces, it can't import
in playground

Zhao Xin <owenzx@gmail.com> 於 14 Jul 2016 3:50 PM 寫道:

You can create a folder named Sources in your .playground file package and
put your frameworks there. I guess you didn't use Xcode. Or you will find
it yourself.

<屏幕快照 2016-07-14 下午3.49.47.png>

Zhaoxin

On Thu, Jul 14, 2016 at 3:36 PM, TUNG CK via swift-users < > swift-users@swift.org> wrote:

I found out I could use
swift -F build/Debug
if the module is build as a target framework
But how to put this framework to use in swift playground ?

> TUNG CK via swift-users <swift-users@swift.org> 於 14 Jul 2016 1:33 PM
寫道:
>
> How can I use a compiled swift module to be use in swift REPL or
playground ?
>
> such as in swift REPL
> import MyModule
>
> P.S. I could use it in swift package manager by adding it as a
dependency in the Package.swift
>
> _______________________________________________
> swift-users mailing list
> swift-users@swift.org
> https://lists.swift.org/mailman/listinfo/swift-users
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users