FUIWhatsNewViewController
open class FUIWhatsNewViewController : UIViewController
extension FUIWhatsNewViewController: UIPageViewControllerDataSource, UIPageViewControllerDelegate
The ‘FUIWhatsNewViewController’ is used to display new features for the application. It takes an array of UIViewController
s, which represents each page and the user can swipe left and right to view content. We recommend using FUIWhatsNewDetailPageController
or FUIWhatsNewDetailListController
to display pages or list style content, but any UIViewController
can be provided in case the developer wants to use their own design.
Usage
Implement Data Source Object
class DataSource: FUIWhatsNewViewControllerDataSource {
func presentationViewControllers(for whatsNewViewController: FUIWhatsNewViewController) -> [UIViewController] {
let pageController = FUIWhatsNewDetailPageController()
pageController.imageView.image = UIImage(named: "cat")
pageController.imageViewSize = CGSize(width: 66, height: 66)
pageController.titleLabel.text = "Title text"
pageController.descriptionTextView.text = "description text"
// enable image only mode.
pageController.isImageExpanded = true
return [pageController]
}
func presentationIndex(for whatsNewViewController: FUIWhatsNewViewController) -> Int {
return 0
}
}
Implement Delegate Object to Monitor Events
The following events will be monitored:
- Will transition to next controller
- Finished transitioning to next controller
- Finish flow by clicking on Close button
Initiate and Present the What’s New Controller
let whatsNewController = FUIWhatsNewViewController()
whatsNewController.dataSource = dataSource
whatsNewController.delegate = delegate
present(whatsNewController)
Theming
Supported style classes
fdlFUIWhatsNewViewController_listheadlineLabel
fdlFUIWhatsNewViewController_pageheadlineLabel
fdlFUIWhatsNewViewController_detailLabel
fdlFUIWhatsNewViewController_whatsnewview
fdlFUIWhatsNewViewController_closeButton
fdlFUIWhatsNewViewController_startButton
-
The datasource for
FUIWhatsNewViewController
.Declaration
Swift
open weak var dataSource: FUIWhatsNewViewControllerDataSource?
-
The datasource for
FUIWhatsNewViewController
.Declaration
Swift
public weak var delegate: FUIWhatsNewViewControllerDelegate?
-
The view controllers to be displayed.
Declaration
Swift
public private(set) var viewControllers: [UIViewController] { get }
-
Boolean value to control the visibility of the Start/Next button
Boolean value that indicates whether the Start/Next button is to be displayed. The default value is false (button is visible)
Declaration
Swift
public var isButtonHidden: Bool { get set }
-
Boolean value to control the visibility of the Close button on the navigation bar
Boolean value that indicates whether the Close button on the navigation bar is to be displayed. The default value is false (button is visible)
Declaration
Swift
public var isCloseButtonHidden: Bool { get set }
-
Set the title of the Start button.
FUIText value that sets the title of the Start button. The default button title is Start.
Declaration
Swift
public var startButtonTitle: FUIText { get set }
-
Set the title of the Next button.
FUIText value that sets the title of the Next button. The default button title is Next.
Declaration
Swift
public var nextButtonTitle: FUIText { get set }
-
The index value for the current page.
This is used to navigate to the previous or next page. The corresponding view controller will be set when the value changes.
Declaration
Swift
public var presentationIndex: Int { get set }