![](/img/trans.png)
[英]How to import XMPPFramewrok files manually in Cocoa Touch Framework in Swift 4?
[英]import jwt from swift cocoa touch framework
我正在研究swift cocoa touch framework
以從移動應用程序創建可重用框架。
我的框架需要使用https://github.com/vapor/jwt.git
jwt
項目
我嘗試創建Package.swift
,然后添加.package(url:"https://github.com/vapor/jwt.git", from: "3.0.0")
,然后運行swift package resolve
在我的代碼中,我像這樣導入jwt庫
import JWT
import Foundation
但是我得到了錯誤No such module 'JWT'
我是新手,很快有人可以幫忙嗎?
我的Package.swift在這里
// swift-tools-version:4.2
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "edoc-sdk-swift",
products: [
// Products define the executables and libraries produced by a package, and make them visible to other packages.
.library(
name: "edoc-sdk-swift",
targets: ["edoc-sdk-swift"]),
],
dependencies: [
.package(url:"https://github.com/vapor/jwt.git", from: "3.0.0")
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "edoc-sdk-swift",
dependencies: ["JWT"]),
.testTarget(
name: "edoc-sdk-swiftTests",
dependencies: ["edoc-sdk-swift"]),
]
)
您應該檢查兩件事:
JWT
而不是jwt
。 Package.swift
中的.target
是否包含"JWT"
dependencies
謝謝大家的反饋。
現在我可以解決問題了,我為此博客寫了解決方案
https://piggyman007.blogspot.com/2018/12/create-swift-framework-and-include-some.html
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.