简体   繁体   中英

Swift Playground 4: Import Swift Package

I'm using Swift Playgrounds App on Mac, which is different than Swift Playgrounds inside the Xcode.

I'm interested in using a UIKit-based Swift Package in my Playground, but couldn't find anything similar to Package.swift file or a menu item to add a package:

Is there an option to connect an external Swift Package stored in a git repository or are only local modules allowed?

操场

What I would try do is open the playground file in the finder. You can open the playground book as a folder and see the contents of the playgrounds there and paste the swift package there.

I add the GitHub hosted packages by tapping the add file button and selecting package from the menu and pasting the GitHub link into the pop up. It will ask you to select the version you want to use.

I'm guessing in the Mac interface that will be in the File menu.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM