im new to the swift and xcode world, so i'm having a problem trying to integrate a package to my project.
I want to add Alamofire dependency, with the following commands:
Inside my root project folder:
swift init
this creates the Package.swift file, i add the dependency inside, run then:
swift build
Everything seems to be ok, but im my project when i try to import my library:
import Alamofire
I get an error, it says that the module is not recognized.
So my question here is, what is the correct steps to integrate Package Manager and a dependency on a existing project without crashing everything.
UPDATE:
swift build
outputs:
Resolved version: 4.3.0
Compile Swift Module 'Alamofire' (17 sources)
Compile Swift Module 'Sample' (1 sources)
And my Package.swift is:
import PackageDescription
let package = Package(
name: "Sample",
dependencies: [
.Package(url: "https://github.com/Alamofire/Alamofire.git", majorVersion: 4)
]
)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…