Releases: SvenTiigi/WhatsNewKit
Version 1.1.6
Layout Insets
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
iPad Adjustments
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.
Version 1.1.5
Bug Fix
This release fixes a bug which cause a problem when saving or retrieving the presented Version via a WhatsNewVersionStore
(Issue #14)
Version 1.1.4
ImageSize
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
.
Secondary Title Color
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
.
Apply TextColor
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)
Version 1.1.3
Layout
In this Version WhatsNewKit
has the ability to change the layout from default
to centered
(#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
.
New Example Application
The WhatsNewKit
Example Application has been completely refactored and comes with a beautiful new UI.
Version 1.1.2
Swift 4.2 compatibility
Added Xcode 10 and Swift 4.2 compatibility
KeyValueWhatsNewVersionStore Default Argument
The KeyValueable
initializer parameter of the KeyValueWhatsNewVersionStore
is now set with UserDefaults.standard
LightBlue Theme
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)
Version 1.1.1
HapticFeedback
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 KeyValueWhatsNewVersionStore issue
Fixed an issue when using KeyValueWhatsNewVersionStore
with UserDefaults
or NSUbiquitousKeyValueStore
.
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
})
Version 1.0.2
HapticFeedback
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.
Version 1.0.1
KeyValueWhatsNewVersionStore
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
)
Theme and Configuration structure
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)
Initial Release π
This is the initial release of WhatsNewKit