Skip to content

Jonathan-Gander/WhatsNewViewController

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A nice way to present your new app features

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.

🆕 SwiftUI support

If you're using SwiftUI in your project, have a look on Jonathan-Gander/WhatsNewView.

Features

  • 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

Setup

Simply take files in WhatsNew folder and add them to your project.

Usage

// 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).
}

Screenshots

Here are few screenshots (with random texts!) of the app:

Simulator Screen Shot - iPhone 12 - 2021-10-09 at 09 16 36 Simulator Screen Shot - iPhone 12 - 2021-10-09 at 09 17 13

Simulator Screen Shot - iPhone 12 - 2021-10-09 at 09 54 21 Simulator Screen Shot - iPhone 12 - 2021-10-09 at 09 55 37

Use with Objective-C code

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 to init()

WhatsNewViewController class:

  • Add @objc to class
  • Add @objc to all parameters properties (mainColor, titleText, etc.)
  • Add @objc to create() static function
  • On each delegate methods calls, add ?, because each delegated functions could be optional

They're already using it

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.

Licence

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.

About

A nice way to present your new app features (UIKit version).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages