AppleWelcomeScreen
AppleWelcomeScreen 是一种创建类似内置 iOS 应用中使用的欢迎屏/引导体验的简单方法。例如,以下是使用 AppleWelcomeScreen 重现的 Notes 欢迎屏
iPhone SE | iPhone X | iPhone 8 Plus |
---|---|---|
![]() |
![]() |
![]() |
用法
提供配置就能开始使用。
let configuration = WelcomeScreenConfiguration(
appName: "My App",
appDescription: "Lorem ipsum dolor sit amet, consecteteur adipiscing elit.",
features: [
WelcomeScreenFeature(
image: UIImage(systemName: "circle.fill")!,
title: "Lorem ipsum",
description: "Lorem ipsum dolor sit amet."
),
WelcomeScreenFeature(
image: UIImage(systemName: "square.fill")!,
title: "Dolor sit amet",
description: "Consecteteur adipiscing elit, sed do euismod tempor incdidunt."
),
WelcomeScreenFeature(
image: UIImage(systemName: "triangle.fill")!,
title: "Consecteteur adipiscing elit, sed do euismod tempor incdidunt",
description: "Lorem ipsum dolor sit amet, consecteteur adipiscing elit, sed do euismod tempor incdidunt ut labore et dolore magna aliqua."
),
]
)
// In your view controller:
self.present(WelcomeScreenViewController(configuration: configuration), animated: true)
// Or in SwiftUI:
MyView().sheet(isPresented: self.$showWelcomeScreen) {
WelcomeScreen(configuration: configuration)
}
示例
要运行示例项目,请克隆仓库并打开 Example/Example.xcodeproj
。
安装
CocoaPods
pod 'AppleWelcomeScreen'
Swift 包管理器
.package(url: "https://github.com/WilsonGramer/AppleWelcomeScreen.git", from: "2.0.0")
贡献
AppleWelcomeScreen 鼓励贡献!您可以创建一个议题或提交一个拉取请求。