This package is a simple way of adding What’s New pages to your app. The pages
are dynamically created based on the number of items passed to the WhatsNewView.
How to use:
In your target’s General Settings, make sure your app Display Name is set as you want it.
Create the content for each What’s New page you want displayed. You can use What’s New BulletPoint struct to add bullet points with images, bold titles and explanatory text. The compnent will use whatever accent color you set for the page.
struct WhatsNewPageView: View {
var body: some View {
VStack (alignment: .leading, spacing: 10){
BulletPointView(title: "We now have SEARCH!!!",
imageName: "paintbrush.fill",
text: "Search to find books that have been on previous best seller lists.")
BulletPointView(title: "More bugs squashed.",
imageName: "myTruck",
text: "And the hits keep coming")
Spacer()
}
.padding()
.accentColor(Color.red)
}
}
... same for each additional page
Import WhatsNew into your startup file.
In your @main struct, create a state variable to control display of WhatsNew pages.
Instantiate a WhatsNew class. You can use the (alwaysShow: true) parameter to always display WhatsNew content for testing.
Add the .onAppear modifier to check for updates in the version number of the app. Add .sheet modifier to your ContentView() call to display the What’s new compomnent.
import SwiftUI
import WhatsNew
@main
struct PackageTesterApp: App {
let whatsNew = WhatsNew(alwaysShow: true)
@State private var showWhatsNew = false
var body: some Scene {
WindowGroup {
ContentView()
.onAppear(perform: {
whatsNew.checkForUpdate(showWhatsNew: $showWhatsNew)
})
.sheet(isPresented: $showWhatsNew) {
WhatsNewView {
WhatsNewPageView()
WhatsNewPageView2()
}
}
}
}
}
WhatsNew
This package is a simple way of adding What’s New pages to your app. The pages are dynamically created based on the number of items passed to the WhatsNewView.
How to use:
In your target’s General Settings, make sure your app Display Name is set as you want it.
Create the content for each What’s New page you want displayed. You can use What’s New BulletPoint struct to add bullet points with images, bold titles and explanatory text. The compnent will use whatever accent color you set for the page.
Import WhatsNew into your startup file.
In your @main struct, create a state variable to control display of WhatsNew pages.
Instantiate a WhatsNew class. You can use the (alwaysShow: true) parameter to always display WhatsNew content for testing.
Add the .onAppear modifier to check for updates in the version number of the app. Add .sheet modifier to your ContentView() call to display the What’s new compomnent.
And that should do it!