Version 1.1.0
Merged Configuration and Theme
Version 1.1.0
simplifies the customization by merging the Theme properties in the corresponding configuration properties.
// Initialize default Configuration
var configuration = WhatsNewViewController.Configuration()
// Customize Configuration to your needs
configuration.backgroundColor = .white
configuration.titleView.titleColor = .orange
configuration.itemsView.titleFont = .systemFont(ofSize: 17)
configuration.detailButton.titleColor = .orange
configuration.completionButton.backgroundColor = .orange
// And many more configuration properties...
The predefined Themes can also be applied globally to the Configuration
// Configuration with predefined Dark Red Theme
let darkRed = WhatsNewViewController.Configuration(
theme: .darkRed
)
// Apply predefined White Red Theme to Configuration
var configuration = WhatsNewViewController.Configuration()
configuration.apply(theme: .whiteRed)
// Or create your own Theme and initialize a Configuration with your Theme
let myTheme = WhatsNewViewController.Theme { configuration in
// Apply customizations ...
}
let configuration = WhatsNewViewController.Configuration(
theme: myTheme
)
Animation on all Components
In this release you can now apply an Animation
to all components of the WhatsNewViewController
.
// Set SlideUp Animation to TitleView
configuration.titleView.animation = .slideUp
// Set SlideRight Animation to ItemsView
configuration.itemsView.animation = .slideRight
// Set SlideLeft Animation to DetailButton
configuration.detailButton.animation = .slideLeft
// Set SlideDown Animation to CompletionButton
configuration.completionButton.animation = .slideDown
If you wish to animate all views with the same type you can do so by simply applying it to the configuration.
// Global Animation-Type for all WhatsNewViewController components
configuration.apply(animation: .fade)
If you wish to define your custom animation, simply set the custom
enum and pass an animator closure.
// Custom Animation for DetailButton
configuration.detailButton.animation = .custom(animator: { [weak self] (view: UIView, settings: AnimatorSettings) in
// view: The View to perform animation on
// settings: Preferred duration and delay
})