WhatsNewViewController
lets you present to your users your app new features in a pretty way (see screenshots below). For example, when you have released an update and you want to explain what is new.
This project is an example/demo app for this WhatsNewViewController
. It is built for iOS using Swift and UIKit. It is easy to use and to control, to start using it quickly in your app and concentrate on your own app business core.
This app only provides a button to display WhatsNewViewController
with random settings. And a text label to display delegate methods results.
If you're using SwiftUI in your project, have a look on Jonathan-Gander/WhatsNewView.
- Title and subtitle
- List of all features with image, title, text
- A Continue button (hiddable)
- A More info button (hiddable)
- Change tint color (with light/dark mode)
- Vertical and horizontal orientation
- Delegate methods to handle user interactions
Simply take files in WhatsNew
folder and add them to your project.
// Create your features (array of WhatsNewFeature)
// You can change title, text and image for each feature.
let features = [
WhatsNewFeature(title: "First amazing feature", text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam accumsan pretium arcu, sit amet porta lectus ultrices sed.", image: UIImage(systemName: "paintbrush")),
WhatsNewFeature(title: "Second feature", text: "Sed lacinia tortor nunc, at eleifend mi porta eu.", image: UIImage(systemName: "globe.europe.africa.fill")),
WhatsNewFeature(title: "Another one", text: "Sed ex risus, vehicula et finibus et, venenatis vitae nisi.", image: UIImage(systemName: "megaphone")),
]
// Create your WhatsNewViewController
let vc = WhatsNewViewController.create(withFeatures: features, delegate: self)
// Customize it:
// Color
vc.mainColor = .systemPink
// Title
vc.titleText = "What's New"
// Subtitle
vc.subtitleText = "In version 1.0.10"
// Continue button (note: You can also set it to nil to hide it)
vc.continueText = "Continue"
// More info button (note: You can also set it to nil to hide it)
vc.moreInfoText = "More info"
// Allow user to copy cells (default is false)
//vc.allowCopy = true
// Display it as a UIViewController
self.present(vc, animated: true, completion: nil)
Delegate methods:
func whatsNewViewControllerDidTapContinueButton(_ whatsNewViewController: WhatsNewViewController) {
// When Continue button was tapped
}
func whatsNewViewControllerDidTapMoreInfoButton(_ whatsNewViewController: WhatsNewViewController) {
// When More info button was tapped
}
func whatsNewViewController(_ whatsNewViewController: WhatsNewViewController, didTapFeature feature: WhatsNewFeature, atIndex index: Int) {
// When a feature was tapped. You can get its index (from your inital array).
}
Here are few screenshots (with random texts!) of the app:
WhatsNewViewController
and its protocol, struct and class are built in Swift. If you want to use it with your Objective-C project, it is possible.
Follow next steps:
WhatsNewViewControllerDelegate
protocol:
- Add
@objc
to protocol and each functions - You can also add
optional
to each functions
WhatsNewFeature
struct:
- Change it to be a class extending
NSObject
:@objc class WhatsNewFeature: NSObject
- Add
@objc
toinit()
WhatsNewViewController
class:
- Add
@objc
toclass
- Add
@objc
to all parameters properties (mainColor
,titleText
, etc.) - Add
@objc
tocreate()
static function - On each delegate methods calls, add
?
, because each delegated functions could be optional
Following apps are already using WhatsNewViewController
:
If you use it in your app, please let me know and I will add your link here. You can contact me here.
Be free to use this WhatsNewViewController
in your app. Licence is available here. Please only add a copyright and licence notice.
Please also see WhatsNew from developer Daniel Illescas Romero. I've built my own implementation but first idea was based on his work.