Learning iOS Development
A Step By Step Guide Creating Swift Package Manager
It’s Time To Start Moving Away from CocoaPods
In a blogpost from blog.cocaopods.org in 13 August 2024, it was stated as below
TLDR: We’re still keeping it ticking, but we’re being more up-front that CocoaPods is in maintenance mode.
Therefore, for a new iOS project in Xcode, it’s worth exploring Swift Package Manager. I tried it today, and here’s my experience — including some pitfalls and the changes I made.
Disclaimer: I’m not an iOS expert, so there may be a few beginner mistakes, but hopefully, this information will be helpful for those just starting their iOS development journey.
Background
I have a very simple project with snippet of code as below.
import SwiftUI
var doSomething: (String) -> PlugItemView = { data in
return PlugItemView(Content: AnyView(ItemRow(message: data)))
}
struct PlugItemView: View {
let Content: AnyView
var body: some View {
Content
}
}
I plan to move the PlugItemView
to another module (package) using Swift Package Manager.
The steps as below