Showcase your awesome new app features 📱
If you wish you can modify the layout insets of the WhatsNewViewController
components.
// Set TitleView Insets (Default values)
configuration.titleView.insets = UIEdgeInsets(top: 50, left: 20, bottom: 15, right: 20)
// Increase the CompletionButton Bottom Inset
configuration.completionButton.insets.bottom += 10
If you wish to modify the WhatsNewViewController.Configuration
when presenting it on an iPad you can set the padAdjustment
closure.
// Set PadAdjustment closure
configuration.padAdjustment = { configuration in
// Adjust TitleView FontSize
configuration.titleView.titleFont = .systemFont(ofSize: 45, weight: .bold)
// Invoke default PadAdjustments (Adjusts Insets for iPad)
WhatsNewViewController.Configuration.defaultPadAdjustment(&configuration)
}
☝️ In default the
WhatsNewViewController.Configuration.defaultPadAdjustment
will be invoked.
This release fixes a bug which cause a problem when saving or retrieving the presented Version via a WhatsNewVersionStore
(Issue https://github.com/SvenTiigi/WhatsNewKit/issues/14)
In order to define the size of your images for each of your feature you can set an ImageSize on the ItemsView
configuration.
// Use the original image size as it is
configuration.itemsView.imageSize = .original
// Use the preferred image size which fits perfectly :)
configuration.itemsView.imageSize = .preferred
// Use a custom height for each image
configuration.itemsView.imageSize = .fixed(height: 25)
☝️ By default the ItemsView ImageSize is set to
preferred
.
By setting a SecondaryColor on the TitleView you can change the color of certain characters.
// Set secondary color on TitleView Configuration
configuration.titleView.secondaryColor = .init(
// The start index
startIndex: 0,
// The length of characters
length: 5,
// The secondary color to apply
color: .whatsNewKitLightBlue
)
☝️ By default the secondaryColor is set to
nil
.
From now on you can apply a text color globally on a configuration instead of change the TitleView and ItemsView text color manually.
// Before:
configuration.titleView.titleColor = .black
configuration.itemsView.titleColor = .black
configuration.itemsView.subtitleColor = .black
// Now:
configuration.apply(textColor: .black)
In this Version WhatsNewKit
has the ability to change the layout from default
to centered
(https://github.com/SvenTiigi/WhatsNewKit/issues/6).
Default | Centered |
---|---|
![]() |
![]() |
The default layout shows an image on the left side and the text on the right side. |
The centered layout aligns the image as well as the text in center. |
/// Default Layout
configuration.itemsView.layout = .default
// Centered Layout
configuration.itemsView.layout = .centered
☝️ By default the ItemsView layout is set to
default
.
The WhatsNewKit
Example Application has been completely refactored and comes with a beautiful new UI.
Added Xcode 10 and Swift 4.2 compatibility
The KeyValueable
initializer parameter of the KeyValueWhatsNewVersionStore
is now set with UserDefaults.standard
A light blue theme like in the Apple Stocks App is now available.
let whiteLightBlueConfiguration = WhatsNewViewController.Configuration(theme: .whiteLightBlue)
let darkLightBlueConfiguration = WhatsNewViewController.Configuration(theme: .darkLightBlue)
From now on you can specify the UIImpactFeedbackStyle
when using HapticFeedback.impact
button.hapticFeedback = .impact(.light)
button.hapticFeedback = .impact(.medium)
button.hapticFeedback = .impact(.heavy)
Fixed an issue when using KeyValueWhatsNewVersionStore
with UserDefaults
or NSUbiquitousKeyValueStore
.
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
)
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
})
You can enable on both DetailButton
and CompletionButton
haptic feedback when the user pressed one of these buttons. Either by setting the property or passing it to the initializer.
// Impact Feedback
button.hapticFeedback = .impact
// Selection Feedback
button.hapticFeedback = .selection
// Notification Feedback with type
let completionButton = WhatsNewViewController.CompletionButton(
title: "Continue",
action: .dismiss,
hapticFeedback: .notification(.success)
)
☝️ In default the
HapticFeedback
isnil
indicating no haptic feedback should be executed.
This release removed the predefined implementation UserDefaultsWhatsNewVersionStore
of WhatsNewVersionStore
and introduces a KeyValueWhatsNewVersionStore
. You can initialize a KeyValueWhatsNewVersionStore
by passing a KeyValueable
conform object. WhatsNewKit
implemented the KeyValueable
protocol already for UserDefaults
and NSUbiquitousKeyValueStore
.
// Local KeyValueStore
let keyValueVersionStore = KeyValueWhatsNewVersionStore(
keyValueable: UserDefaults.standard
)
// iCloud KeyValueStore
let keyValueVersionStore = KeyValueWhatsNewVersionStore(
keyValueable: NSUbiquitousKeyValueStore.default
)
// Initialize WhatsNewViewController with KeyValueWhatsNewVersionStore
let whatsNewViewController: WhatsNewViewController? = WhatsNewViewController(
whatsNew: whatsNew,
versionStore: keyValueVersionStore
)
The WhatsNewViewController.Theme
and WhatsNewViewController.Configuration
structure has been improved via one level nesting instead of two and three level extension nesting which causes problems during a pod lib lint
(Swift Bug: SR-631)
This is the initial release of WhatsNewKit