GithubHelp home page GithubHelp logo

sventiigi / whatsnewkit Goto Github PK

View Code? Open in Web Editor NEW
3.7K 37.0 179.0 8.18 MB

Showcase your awesome new app features 📱

Home Page: https://sventiigi.github.io/WhatsNewKit/

License: MIT License

Swift 100.00%
whatsnew swift ios macos swift-package swiftui

whatsnewkit's Introduction


logo

WhatsNewKit

A Swift Package to easily showcase your new app features.
It's designed from the ground up to be fully customized to your needs.

Swift Version Platforms
Build and Test Status Documentation Twitter Mastodon

Example

import SwiftUI
import WhatsNewKit

struct ContentView: View {

    var body: some View {
        NavigationView {
            // ...
        }
        .whatsNewSheet()
    }

}

Features

  • Easily present your new app features 🤩
  • Automatic & Manual presentation mode ✅
  • Support for SwiftUI, UIKit and AppKit 🧑‍🎨
  • Runs on iOS, macOS and visionOS 📱 🖥 👓
  • Adjustable layout 🔧

Installation

Swift Package Manager

To integrate using Apple's Swift Package Manager, add the following as a dependency to your Package.swift:

dependencies: [
    .package(url: "https://github.com/SvenTiigi/WhatsNewKit.git", from: "2.0.0")
]

Or navigate to your Xcode project then select Swift Packages, click the “+” icon and search for WhatsNewKit.

Example

Check out the example application to see WhatsNewKit in action. Simply open the Example/Example.xcodeproj and run the "Example" scheme.

Example Applications

Usage

Table of contents

Manual Presentation

If you wish to manually present a WhatsNewView you can make use of the sheet(whatsNew:) modifier.

struct ContentView: View {

    @State
    var whatsNew: WhatsNew? = WhatsNew(
        title: "WhatsNewKit",
        features: [
            .init(
                image: .init(
                    systemName: "star.fill",
                    foregroundColor: .orange
                ),
                title: "Showcase your new App Features",
                subtitle: "Present your new app features..."
            ),
            // ...
        ]
    )

    var body: some View {
        NavigationView {
            // ...
        }
        .sheet(
            whatsNew: self.$whatsNew
        )
    }

}

Automatic Presentation

The automatic presentation mode allows you to simply declare your new features via the SwiftUI Environment and WhatsNewKit will take care to present the corresponding WhatsNewView.

First add a .whatsNewSheet() modifier to the view where the WhatsNewView should be presented on.

struct ContentView: View {

    var body: some View {
        NavigationView {
            // ...
        }
        // Automatically present a WhatsNewView, if needed.
        // The WhatsNew that should be presented to the user
        // is automatically retrieved from the `WhatsNewEnvironment`
        .whatsNewSheet()
    }

}

The .whatsNewSheet() modifier is making use of the WhatsNewEnvironment to retrieve an optional WhatsNew object that should be presented to the user for the current version. Therefore you can easily configure the WhatsNewEnvironment via the environment modifier.

extension App: SwiftUI.App {

    var body: some Scene {
        WindowGroup {
            ContentView()
                .environment(
                    \.whatsNew,
                    WhatsNewEnvironment(
                        // Specify in which way the presented WhatsNew Versions are stored.
                        // In default the `UserDefaultsWhatsNewVersionStore` is used.
                        versionStore: UserDefaultsWhatsNewVersionStore(),
                        // Pass a `WhatsNewCollectionProvider` or an array of WhatsNew instances
                        whatsNewCollection: self
                    )
                )
        }
    }

}

// MARK: - App+WhatsNewCollectionProvider

extension App: WhatsNewCollectionProvider {

    /// Declare your WhatsNew instances per version
    var whatsNewCollection: WhatsNewCollection {
        WhatsNew(
            version: "1.0.0",
            // ...
        )
        WhatsNew(
            version: "1.1.0",
            // ...
        )
        WhatsNew(
            version: "1.2.0",
            // ...
        )
    }

}

WhatsNewEnvironment

The WhatsNewEnvironment will take care to determine the matching WhatsNew object that should be presented to the user for the current version.

As seen in the previous example you can initialize a WhatsNewEnvironment by specifying the WhatsNewVersionStore and providing a WhatsNewCollection.

// Initialize WhatsNewEnvironment by passing an array of WhatsNew Instances.
// UserDefaultsWhatsNewVersionStore is used as default WhatsNewVersionStore
let whatsNewEnvironment = WhatsNewEnvironment(
    whatsNewCollection: [
        WhatsNew(
            version: "1.0.0",
            // ...
        )
    ]
)

// Initialize WhatsNewEnvironment with NSUbiquitousKeyValueWhatsNewVersionStore
// which stores the presented versions in iCloud.
// WhatsNewCollection is provided by a `WhatsNewBuilder` closure
let whatsNewEnvironment = WhatsNewEnvironment(
    versionStore: NSUbiquitousKeyValueWhatsNewVersionStore(),
    whatsNewCollection: {
        WhatsNew(
            version: "1.0.0",
            // ...
        )
    }
)

Additionally, the WhatsNewEnvironment includes a fallback for patch versions. For example when a user installs version 1.0.1 and you only have declared a WhatsNew for version 1.0.0 the environment will automatically fallback to version 1.0.0 and present the WhatsNewView to the user if needed.

If you wish to further customize the behaviour of the WhatsNewEnvironment you can easily subclass it and override the whatsNew() function.

class MyCustomWhatsNewEnvironment: WhatsNewEnvironment {

    /// Retrieve a WhatsNew that should be presented to the user, if available.
    override func whatsNew() -> WhatsNew? {
        // The current version
        let currentVersion = self.currentVersion
        // Your declared WhatsNew objects
        let whatsNewCollection = self.whatsNewCollection
        // The WhatsNewVersionStore used to determine the already presented versions
        let versionStore = self.whatsNewVersionStore
        // TODO: Determine WhatsNew that should be presented to the user...
    }

}

WhatsNewVersionStore

A WhatsNewVersionStore is a protocol type which is responsible for saving and retrieving versions that have been presented to the user.

let whatsNewVersionStore: WhatsNewVersionStore

// Save presented versions
whatsNewVersionStore.save(presentedVersion: "1.0.0")

// Retrieve presented versions
let presentedVersions = whatsNewVersionStore.presentedVersions

// Retrieve bool value if a given version has already been presented
let hasPresented = whatsNewVersionStore.hasPresented("1.0.0")

WhatsNewKit comes along with three predefined implementations:

// Persists presented versions in the UserDefaults
let userDefaultsWhatsNewVersionStore = UserDefaultsWhatsNewVersionStore()

// Persists presented versions in iCloud using the NSUbiquitousKeyValueStore
let ubiquitousKeyValueWhatsNewVersionStore = NSUbiquitousKeyValueWhatsNewVersionStore()

// Stores presented versions in memory. Perfect for testing purposes
let inMemoryWhatsNewVersionStore = InMemoryWhatsNewVersionStore()

If you already have a specific implementation to store user related settings like Realm or Core Data you can easily adopt your existing implementation to the WhatsNewVersionStore protocol.

NSUbiquitousKeyValueWhatsNewVersionStore

If you are making use of the NSUbiquitousKeyValueWhatsNewVersionStore please ensure to enable the iCloud Key-value storage capability in the "Signing & Capabilities" section of your Xcode project.

iCloud Key-value storage

WhatsNew

The following sections explains how a WhatsNew struct can be initialized in order to describe the new features for a given version of your app.

let whatsnew = WhatsNew(
    // The Version that relates to the features you want to showcase
    version: "1.0.0",
    // The title that is shown at the top
    title: "What's New",
    // The features you want to showcase
    features: [
        WhatsNew.Feature(
            image: .init(systemName: "star.fill"),
            title: "Title",
            subtitle: "Subtitle"
        )
    ],
    // The primary action that is used to dismiss the WhatsNewView
    primaryAction: WhatsNew.PrimaryAction(
        title: "Continue",
        backgroundColor: .accentColor,
        foregroundColor: .white,
        hapticFeedback: .notification(.success),
        onDismiss: {
            print("WhatsNewView has been dismissed")
        }
    ),
    // The optional secondary action that is displayed above the primary action
    secondaryAction: WhatsNew.SecondaryAction(
        title: "Learn more",
        foregroundColor: .accentColor,
        hapticFeedback: .selection,
        action: .openURL(
            .init(string: "https://github.com/SvenTiigi/WhatsNewKit")
        )
    )
)

WhatsNew.Version

The WhatsNew.Version specifies the version that has introduced certain features to your app.

// Initialize with major, minor, and patch
let version = WhatsNew.Version(
    major: 1,
    minor: 0,
    patch: 0
)

// Initialize by string literal
let version: WhatsNew.Version = "1.0.0"

// Initialize WhatsNew Version by using the current version of your bundle
let version: WhatsNew.Version = .current()

WhatsNew.Title

A WhatsNew.Title represents the title text that is rendered above the features.

// Initialize by string literal
let title: WhatsNew.Title = "Continue"

// Initialize with text and foreground color
let title = WhatsNew.Title(
    text: "Continue",
    foregroundColor: .primary
)

// On >= iOS 15 initialize with AttributedString using Markdown
let title = WhatsNew.Title(
    text: try AttributedString(
        markdown: "What's **New**"
    )
)

WhatsNew.Feature

A WhatsNew.Feature describe a specific feature of your app and generally consist of an image, title, and subtitle.

let feature = WhatsNew.Feature(
    image: .init(
        systemName: "wand.and.stars"
    ),
    title: "New Design",
    subtitle: .init(
        try AttributedString(
            markdown: "An awesome new _Design_"
        )
    )
)

WhatsNew.PrimaryAction

The WhatsNew.PrimaryAction allows you to configure the behaviour of the primary button which is used to dismiss the presented WhatsNewView

let primaryAction = WhatsNew.PrimaryAction(
    title: "Continue",
    backgroundColor: .blue,
    foregroundColor: .white,
    hapticFeedback: .notification(.success),
    onDismiss: {
        print("WhatsNewView has been dismissed")
    }
)

Note: HapticFeedback will only be executed on iOS

WhatsNew.SecondaryAction

A WhatsNew.SecondaryAction which is displayed above the WhatsNew.PrimaryAction can be optionally supplied when initializing a WhatsNew instance and allows you to present an additional View, perform a custom action or open an URL.

// SecondaryAction that presents a View
let secondaryActionPresentAboutView = WhatsNew.SecondaryAction(
    title: "Learn more",
    foregroundColor: .blue,
    hapticFeedback: .selection,
    action: .present {
        AboutView()
    }
)

// SecondaryAction that opens a URL
let secondaryActionOpenURL = WhatsNew.SecondaryAction(
    title: "Read more",
    foregroundColor: .blue,
    hapticFeedback: .selection,
    action: .open(
        url: .init(string: "https://github.com/SvenTiigi/WhatsNewKit")
    )
)

// SecondaryAction with custom execution
let secondaryActionCustom = WhatsNew.SecondaryAction(
    title: "Custom",
    action: .custom { presentationMode in
        // ...
    }
)

Note: HapticFeedback will only be executed on iOS

Layout

WhatsNewKit allows you to adjust the layout of a presented WhatsNewView in various ways.

The most simple way is by mutating the WhatsNew.Layout.default instance.

WhatsNew.Layout.default.featureListSpacing = 35

When using the automatic presentation style you can supply a default layout when initializing the WhatsNewEnvironment.

.environment(
    \.whatsNew,
    .init(
        defaultLayout: WhatsNew.Layout(
            showsScrollViewIndicators: true,
            featureListSpacing: 35
        ),
        whatsNew: self
    )
)

Alternatively you can pass a WhatsNew.Layout when automatically or manually presenting the WhatsNewView

.whatsNewSheet(
    layout: WhatsNew.Layout(
        contentPadding: .init(
            top: 80,
            leading: 0,
            bottom: 0,
            trailing: 0
        )
    )
)
.sheet(
    whatsNew: self.$whatsNew,
    layout: WhatsNew.Layout(
        footerActionSpacing: 20
    )
)

WhatsNewViewController

When using UIKit or AppKit you can make use of the WhatsNewViewController.

let whatsNewViewController = WhatsNewViewController(
    whatsNew: WhatsNew(
        version: "1.0.0",
        // ...
    ),
    layout: WhatsNew.Layout(
        contentSpacing: 80
    )
)

If you wish to present a WhatsNewViewController only if the version of the WhatsNew instance has not been presented you can make use of the convenience failable initializer.

// Verify WhatsNewViewController is available for presentation
guard let whatsNewViewController = WhatsNewViewController(
    whatsNew: WhatsNew(
        version: "1.0.0",
        // ...
    ),
    versionStore: UserDefaultsWhatsNewVersionStore()
) else {
    // Version of WhatsNew has already been presented
    return
}

// Present WhatsNewViewController
// Version will be automatically saved in the provided
// WhatsNewVersionStore when the WhatsNewViewController gets dismissed
self.present(whatsNewViewController, animated: true)

whatsnewkit's People

Contributors

ajkiosd avatar alexandrereol avatar andrewbennet avatar chbeer avatar gettoset avatar maxzheleznyy avatar munirwanis avatar passatgt avatar phjs avatar sventiigi avatar theoriginalbit avatar timaellis avatar weiran avatar weitieda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

whatsnewkit's Issues

Ability to remove "already shown entry" from UserDefaults

Is your feature request related to a problem?

/

What solution would you like?

A function in UserDefaultsWhatsNewVersionStore that's called "remove" which simply removes a version from the UserDefaults so that it can be shown again to a user (if he pushes a button)

What alternatives have you considered?

/

Any additional context?

/

Don't animate itemsView.

Hi, I'm MJ.

First, thank you for your open source.

I'm using your open source WhatsNewKit. But, I met a problem.

I want to animate views, but itemsview does not apply animation.

Below my code. Thank you.

import Foundation
import WhatsNewKit

class WhatsNewAppHandler {
  var whatsNewViewController: WhatsNewViewController?

  init() {
    let whatsNew = WhatsNew(
      title: "WhatsNewKit",
      items: [
        WhatsNew.Item(
          title: "Installation",
          subtitle: "You can install WhatsNewKit via CocoaPods or Carthage",
          image: UIImage(named: "IAPAds")
        ),
        WhatsNew.Item(
          title: "Open Source",
          subtitle: "Contributions are very welcome 👨‍💻",
          image: UIImage(named: "IAPAds")
        ),
        WhatsNew.Item(
          title: "Installation",
          subtitle: "You can install WhatsNewKit via CocoaPods or Carthage",
          image: UIImage(named: "IAPAds")
        ),
        WhatsNew.Item(
          title: "Installation",
          subtitle: "You can install WhatsNewKit via CocoaPods or Carthage",
          image: UIImage(named: "IAPAds")
        )
      ]
    )

    var configuration = WhatsNewViewController.Configuration()
    configuration.completionButton.backgroundColor = Color.Blue
    configuration.apply(animation: .slideUp)

    whatsNewViewController = WhatsNewViewController(
      whatsNew: whatsNew,
      configuration: configuration
    )
  }

  func showsWhatsNewApp(presentViewController: UIViewController) {

    if let whatsNewViewController = self.whatsNewViewController {
      whatsNewViewController.modalTransitionStyle = .coverVertical
      whatsNewViewController.modalPresentationStyle = .overFullScreen
      presentViewController.present(whatsNewViewController, animated: true)
    }
  }
}

Disable tint for item images

WhatsNewKit Environment

  • WhatsNewKit version: 1.3.1
  • Xcode version: 11.2
  • Swift version: 5.1
  • macOS version running Xcode: 10.15.1
  • Dependency manager (Carthage, CocoaPods, Manually): Carthage

What did you do?

I created a new WhatsNewController and inserted three items with an image.

What did you expect to happen?

The actual assets are displayed without the tint color.

What happened instead?

The images are all tinted. Is it possible to disable this behaviour?

Screenshot 2019-11-13 at 10 59 13

CompletionButton Height

It would be nice to be able to set the height of the completion button. If the goal of this project was to be consistent with the welcome screens that were added to Apple's own apps then the completion button is way too tall.

Idea: create a dummy for notification and haptic on macOS

Notifications and haptics are not available on macOS. So code that uses them does not build on macOS. You can add conditions to fix this but it makes things more complicated.

Would creating dummies for these on macOS be a way to go? Then the same code would build also on macOS.

There could be a log message on macOS.

UserDefault crash when trying to save version of app with "Attempt to set a non-property-list object 1.3.0 as an NSUserDefaults"

I'm using UserDefaults to save the "keyValueVersionStore" once I clicked the complete button my project is breaking with
Attempt to set a non-property-list object 1.3.0 as an NSUserDefaults/CFPreferences value for key de.tiigi.whatsnewkit.1.3.0

Here is how I set up whatsNewViewController

// Local KeyValueStore
    let keyValueVersionStore = KeyValueWhatsNewVersionStore(
      keyValueable: UserDefaults.standard
    )
    
    let whatsNewController = WhatsNewViewController(whatsNew: whatsNewVersion4, configuration: configuration, versionStore: keyValueVersionStore)
  
    if let controller = whatsNewController {
      // Present it as WhatsNewViewController is available
      // after init with WhatsNewVersionStore
     self.present(controller, animated: true)
    } else {
      // WhatsNewViewController is `nil` this Version has already been presented
    }

Swipe down does not called completion

  1. use example code

  2. use completion method like

configuration.completionButton = WhatsNewViewController.CompletionButton(
         title: "Continue",
            action: .custom(action: { (controller) in
               controller.dismiss(animated: true) {
                  completion()
               }
            }
         )
      )
  1. swipe the controller down

--> completion() is not called

How to handle UIAdaptivePresentationControllerDelegate events?

whatsNewViewController.navigationController?.presentationController?.delegate = self
whatsNewViewController.presentationController?.delegate = self

not called...
func presentationControllerDidDismiss(_ presentationController: UIPresentationController)

two-line title on iphone SE

there is a problem with the two-line title (and a high font, example 37) on iphone SE: the second line does not appear

1.1.4 issue

after updating to 1.1.4, getting crash:

dyld: Symbol not found: _$S11WhatsNewKit08KeyValueaB12VersionStoreCAA08ReadableabfG0AAWP
  Referenced from: /Users/me/Library/Developer/CoreSimulator/Devices/F61169B1-9C1F-4301-9DF6-BDB79FA902A0/data/Containers/Bundle/Application/D9BF5E1D-67E3-46EC-8D5C-F6E6573374DD/MyApp.app/MyApp
  Expected in: /Users/me/Library/Developer/CoreSimulator/Devices/F61169B1-9C1F-4301-9DF6-BDB79FA902A0/data/Containers/Bundle/Application/D9BF5E1D-67E3-46EC-8D5C-F6E6573374DD/MyApp.app/Frameworks/WhatsNewKit.framework/WhatsNewKit
 in /Users/me/Library/Developer/CoreSimulator/Devices/F61169B1-9C1F-4301-9DF6-BDB79FA902A0/data/Containers/Bundle/Application/D9BF5E1D-67E3-46EC-8D5C-F6E6573374DD/MyApp.app/MyApp
(lldb) 

WhatsNew.Text from NSAttributedString Availability Issue

WhatsNewKit Environment

  • WhatsNewKit version: 2.1
  • Xcode version: 13.2.1
  • Swift version: 5
  • macOS version running Xcode: 11.6.2
  • Dependency manager (SPM, Manually): SPM

What did you do?

Try to create an instance of WhatsNew.Text from a NSAttributedString with iOS deployment target 14.0:

WhatsNew.Text(NSAttributedString())

What did you expect to happen?

No build error. NSAttributedString should be available on iOS 3.2+.

What happened instead?

'(init(_:)' is only available in iOS 15.0 or newer

Aspect ratio not preserved when using fixed imageSize

WhatsNewKit Environment

  • WhatsNewKit version: 1.3.3
  • Xcode version: 11.5
  • Swift version: 5
  • macOS version running Xcode: 10.15.5
  • Dependency manager (SPM, Carthage, CocoaPods, Manually): SPM (in Xcode)

What did you do?

Configured a WhatsNew.Item with an image from the iOS 13 SFSymbol library.

What did you expect to happen?

I expected the aspect ratio of the image to be preserved, especially as WhatsNewViewController.ItemsView.ImageSize.fixed is documented as /// A fixed height by keeping the aspect ratio.

What happened instead?

The image was stretched into a square.

--
Example code:

let whatsNewExample = WhatsNew(
    title: "An example of using WhatsNewKit with SFSymbols",
    items: [
        WhatsNew.Item(
            title: "Item 1",
            subtitle: "This has an SFSymbol as its image",
            image: {
                if #available(iOS 13.0, *) {
                    let config = UIImage.SymbolConfiguration(pointSize: 50)
                    return UIImage(systemName: "ant.fill", withConfiguration: config)
                } else {
                    return nil
                }
            }()
        ),
        WhatsNew.Item(
            title: "Item 2",
            subtitle: "This has an SFSymbol as its image",
            image: {
                if #available(iOS 13.0, *) {
                    let config = UIImage.SymbolConfiguration(pointSize: 50)
                    return UIImage(systemName: "tropicalstorm", withConfiguration: config)
                } else {
                    return nil
                }
            }()
        )
    ]
)

var configuration = WhatsNewViewController.Configuration()
// Use the default, preferred image size
//configuration.itemsView.imageSize = .original
window.rootViewController!.present(WhatsNewViewController(whatsNew: whatsNewExample, configuration: configuration), animated: true)

If I alter to code to set .original as the image size, the image is no longer distorted but I then do not have a nice way to ensure that the images are equal width to make them align, and so the text of each item don't have aligning leading margins:

It would seem that the resizing code in WhatsNewItemsViewController+Cell.swift, line 207, func resize(height: CGFloat) -> UIImage? doesn't do as its comment says: /// Resize UIImage to a give height by keeping the aspect ratio.

Follow iOS 13 Dark Mode Settings

WhatsNewKit Environment

  • WhatsNewKit version: 1.3.0
  • Xcode version: 11.0
  • Swift version: 5.1
  • macOS version running Xcode: 10.14.6
  • Dependency manager (Carthage, CocoaPods, Manually): Cocoapods

What did you do?

Use the default WhatsNewKit configuration

What did you expect to happen?

The coloring would follow iOS 13 dark mode

What happened instead?

I had to manually set colors to follow dark mode.

Squished layout on iPad in multitasking

WhatsNewKit Environment

  • iOS version: 14.0
  • WhatsNewKit version: 1.3.6
  • Xcode version: 12.0
  • Swift version: 5.0
  • macOS version running Xcode: 10.15.6
  • Dependency manager (SPM, Carthage, CocoaPods, Manually): SPM

What did you do?

Displaying the WhatsNew view with default layout values on iPad in multitasking

What did you expect to happen?

The layout should consider the trait collection

What happened instead?

The layout is being squished

`private func showWhatsNew() {
// Initialize WhatsNew
let versionStore: WhatsNewVersionStore = KeyValueWhatsNewVersionStore()

    var configuration = WhatsNewViewController.Configuration(
        theme: .default
    )
    configuration.tintColor = UIColor(named: "someTintColor")!
    configuration.itemsView.imageSize = .preferred
    
    let whatsNew = WhatsNew(
        // The Title
        title: SSKLocalizedString("STR_WHATS_NEW"),
        // The features you want to showcase
        items: [
            WhatsNew.Item(
                title: "XYZ",
                subtitle: "Blah blah",
                image: UIImage(systemName: "bolt.fill")
            ),
            ...,
            ...,
        ]
    )

    // Initialize WhatsNewViewController with WhatsNew
    if let whatsNewViewController = WhatsNewViewController(
        whatsNew: whatsNew,
        configuration: configuration,
        versionStore: versionStore) {
        self.present(whatsNewViewController, animated: true)
    }
}`

ipad-layout

Prevent the WhatsNew Screen from appearing more than once

WhatsNewKit Environment

  • WhatsNewKit version: WhatsNewKit 2.0.2
  • Xcode version:13.3.1
  • Swift version: 5 with SwiftUI 3
  • macOS version running Xcode: macOS Monterey Version 12.3.1
  • Dependency manager (SPM, Manually): SPM

What did you do?

I added the WhatsNew package and used the code for automatic and the WhatsNew Screen appeared as expected.

What did you expect to happen?

I expected the screen to only present once, but when the app was restarted it appeared again.

What happened instead?

Every time the app is restarted the whatsnew screen appears.

How do I get the whatsnew screen to appear only once, and not on subsequent restarts of the app until another new version of the app is released and the user updates the app from the App Store ?
Thx

[iPad] Default primary action does not dismiss the WhatsNewViewController

WhatsNewKit Environment

  • WhatsNewKit version: 2.0.2 using UIKit
  • Xcode version: 13.3
  • Swift version: 5+
  • macOS version running Xcode: 12.4
  • Dependency manager (SPM, Manually): SPM

What did you do?

on iPad, the continue button (primary action) does not dismiss. Works fine on iPhone.

What did you expect to happen?

The WhatsNewVC should dismiss

What happened instead?

As a workaround, I used the 'onDismiss' completion to dismiss the controller

Cannot Add a package dependency

WhatsNewKit Environment

  • WhatsNewKit version: 1.3.0
  • Xcode version:13.3.1
  • Swift version: SwiftUI 3
  • macOS version running Xcode:
  • Dependency manager (SPM, Manually):

What did you do?

I attempted to add a package dependency in Xcode for a SwiftUI project but the url you provided is not recognized

iPad Adjustments not work

WhatsNewKit Environment

  • WhatsNewKit version: 1.3.7
  • Xcode version: 12.0.1
  • Swift version: 5.0
  • macOS version running Xcode: 10.15.7
  • Dependency manager (SPM, Carthage, CocoaPods, Manually): SPM

What did you do?

I've added this code for ipad adjustments:

configuration.padAdjustment = { configuration in

            configuration.titleView.insets.top = 25.0
            configuration.detailButton = nil

            configuration.itemsView.insets.top = -20.0
            configuration.itemsView.insets.left = 5.0
            configuration.itemsView.insets.right = 7.0
            configuration.itemsView.insets.bottom = 5.0

            configuration.completionButton.insets.bottom = 17.0

            WhatsNewViewController.Configuration.defaultPadAdjustment(&configuration)
        }

but it doesn't works. For example the detail button is still visible.

Display a UIImage

Is your feature request related to a problem?

Hi, No bugs for me, your kit works well in my apps.

I was wondering if it was possible to use a UIImage instead of a system icon for a WhatsNew.Feature.

What solution would you like?

Use a UIImage instead of system icon

What alternatives have you considered?

I'm pretty new to this so I am a little stuck.

I was thinking it would be something like:

Instead of:
WhatsNew.Feature(
image: .init(systemName: "ladybug"),
title: "Cleaned up some Bugs",
subtitle: "We have sorted out some minor bugs and UI updates. "
),

my feature could be:
WhatsNew.Feature(
image: .init(UIImage: "myImage"),
title: "Cleaned up some Bugs",
subtitle: "We have sorted out some minor bugs and UI updates. "
),

I would be grateful for any help with pointing me in the right direction.

Any additional context?

No response

Updated Xcode to 10.0 , WhatsNewViewController.Theme now contains error "Missing argument backgroundColor"

Just updated to Xcode 10.0 and recieved this error "missing argument for paramater 'backgroundColor'" when trying to create theme of whatsNewController.

 let myTheme =  WhatsNewViewController.Theme { (configuration) in
    configuration.backgroundColor = UIHelper.BARODARKCOLOR
    configuration.titleView.titleFont = .systemFont(ofSize: 30, weight: .semibold)
    configuration.titleView.titleColor = .white
    configuration.titleView.animation = .slideDown
    
    configuration.itemsView.titleFont = .systemFont(ofSize: 20, weight: .semibold)
    configuration.itemsView.titleColor = .white
    configuration.itemsView.subtitleFont = .systemFont(ofSize: 17)
    configuration.itemsView.subtitleColor = .white
    configuration.itemsView.animation = .slideUp
    
    configuration.completionButton.titleFont = .systemFont(ofSize: 17, weight: .semibold)
    configuration.completionButton.titleColor = .white
    configuration.completionButton.backgroundColor = UIHelper.BAROCOLOR
    configuration.completionButton.cornerRadius = 8
    
    
    }

Swift Version: 4.0
WhatsNewKit Version: 1.0.2
Any suggestions or workarounds? I tried updating WhatsNewKit to latest version but latest version seemed to be for swift version 4.2 and id like to get my project to build before the switch to 4.2.

Custom action for completion button has no reference to Self

WhatsNewKit Environment

  • WhatsNewKit version: 1.3.1
  • Xcode version: 11.2
  • Swift version: 5
  • macOS version running Xcode: Catalina
  • Dependency manager (SPM, Carthage, CocoaPods, Manually): CocoaPods

Hi guys,

I have the current implementation of WhatsNewKit

import Foundation
import WhatsNewKit

@objc protocol SMSCWhatsNewKitWrapperDelegate: class {
    func whatsNewDidFinish(controller: UIViewController)
}

@objc class SMSCWhatsNewKitWrapper: NSObject {
    var account: SMSCAccount
    @objc weak var delegate: SMSCWhatsNewKitWrapperDelegate?
    
   @objc init(account: SMSCAccount) {
        self.account = account

        super.init()
    }
   
    @objc func getWhatsNewViewcontroller() -> UIViewController? {
        let items = createWhatsNewItems()
        let filteredItems = items.filter { $0.appliesToAccount(account: account) }.map { $0.item }
        let whatsNew = WhatsNew(title: "Title", items: filteredItems)
        let configuration = createConfiguration()
        
        let keyValueVersionStore = KeyValueWhatsNewVersionStore(
            keyValueable: UserDefaults.standard
        )
        
        return WhatsNewViewController(whatsNew: whatsNew,
                                      configuration: configuration,
                                      versionStore: InMemoryWhatsNewVersionStore())
    }
    
    private func createWhatsNewItems() -> [WhatsNewItem] {
        var items: [WhatsNewItem] = []
        
        //Add items
        
        return items
    }
    
    private func createConfiguration() -> WhatsNewViewController.Configuration {
        var configuration = WhatsNewViewController.Configuration(theme: .default,
                                                                 backgroundColor: .white,
                                                                 completionButton: .init(title: "Continue",
                                                                                         action: .custom(action: { [weak self] whatsNewViewController in
                                                                                                                        print("LOG 5: in custom action")
                                                                                                                        self?.delegate?.whatsNewDidFinish(controller: whatsNewViewController)
                                                                                         })))
        configuration.backgroundColor = .white
        configuration.titleView.titleColor = .black
        configuration.completionButton.backgroundColor = .red
        configuration.itemsView.contentMode = .center
        configuration.apply(animation: .slideUp)
    }
}

I would expect that when I press my completion button my delegate is being triggered.
After debugging I found out that in my completion block of the completionButton the property self is nil.

Any help?
Thanks in advance!

Kind regards,
Stef

Show What's new for major & minor versions only (i.e. not patches), but ensure new users always see Whats New

Hello,

Thanks for this beautiful kit.
I'm trying to figure out how to elegantly:

  • show what's new only for minor versions (ex 5.2) but do now show again for patches (ex: 5.2.1)
  • still show whats new for minor versions for new users installing a patch version for a first time. Example: new user first-installed 5.2.1 -> show whats new for 5.2
  • still show whats new for users who might have missed an update. Example: a version 5.1 user updates directly to 5.2.1 -> show whats new for 5.2

Any easy way to do that?

Thanks!

Image decoding from JSON

Hi, I get a nil image when trying to decode the following Item from JSON. I get the title and subtitle ok. Everything else in the Kit works great, and I love it, but I just can't get the images to arrive. Thanks for your help.

Here's the JSON Item:

{
      "title": "Welcome",
      "subtitle": "Thanks for helping us test the next version of Bullclip, we really appreciate it. Please read this page for some tips and important notes.",
      "image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAAAXNSR0IArs4c6QAAELlJREFUeAHtXAlwVEUa7v/NTEgILBIhcqmALisIXpME0EwSLiEHAVbD7rqI6C64Fmstpbvqaqm4pbLsSlEq6pZHeQClEkuQXIgcIQkgSUa3FFcEBU8uUQ4Tcsy81/v1JJO89+bMmzeYVL1Xlbzuv//u/vv/u///77/7DWPWY3HA4oDFAYsDFgcsDlgcsDhgccDigMUBiwMWBywOWBywOGBxwOKAxQGLAxYH4s4BinsPYTqYOL0oxdPUUMA5mwxChnHGBjNGQxhnvZE/yYn/QIw+Zox/wMjxXn3Vxg/DNNcji865AIqKimxfHmmczxmfz4hcnHNb1Jwj9jnqvNpXSlhVWbnhVNT1ujHiORVAWlZ+IefKMszwMbHwBESfYRKtHJh8ybKKiqdbYmnr5657TgTgzJk5gLzy65j1U80dMO2z22237qksed/cds9da3EXgDMrbxzjfCNm/fBQwyJizdD9btiCw8ARf02M2AAQNwyw8bAB/UPVRb1WidjtddXlr4TG6b4lcRVAhit/usyUt8D8PoEsIIWIryOSivsnpry7efPqxkAcsJ5zSs+edRXjnls5o5sBOC8YHoT4QH11xePByrozLG4CaJ/5u4Iyn6iMbHRffWXZ3q4wxzm1qB+1ND4EodyJeg59XYlJ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ZwZEc8AQtxjQQZo6lKVaGNNwm2FYW0LpoHr4ml/tWXC/Ecfw8MUx1RkohGOiQ7DlcFEc2NNhBg/zpTVBEFwl4vrjWqYWekeLQBzY020X/zgU1/b+CttTFqpYzDJHs90HcyUbI9WQSLWFKBGVLEmcGjThKz80V6uCP2dDa/oMrwHYictjO0J7Ky/hLtUjdjOZgTXdrT5+GXCHd3R4D3ehJkvNoBtD2fCC3rNnzXr3WONcKhYEwb0Ca7Lvsls9mKjH4MI7yw9K19cb8zSMNomTXbvKNuugcWY6ZECiDrWRL5f3V2Po9y9WOoHk+yOL4L94KuINdEpPpaT7ILBzYJ1zsTKwi5c9xD7Hh8V3lC7owxRWnOeHiMA/z4Dw44l1gT7is0hPmmF+knG0WdfxJpwt1N72B6BtfhkjA6gfj3ZaVlXf3hQ33aPEUCwnbZ+MD9D/vj5vQeMjPSdQji6epAXFHWsKaa7mnpmYYZ+1nZIpC/x5VNPn/1RGHbDT48RABhRpR+lUCdgznzE5x+urSyvx251YWJ/xxBJYr+FmnkFquKovk6kPGJIXtSrFT+1YHPYrsKp3WUJCfi1LUZbgtQ93q93SgxffYpISQ95fDagqfFhUtgvQXLMsSa00QvDx/UXLlbMEYlLB/CxxmfJtkR3ZWVx0FWUnpk3AwYgH3WGw1CfMcMG9BD2W2RaHLA4YHHA4oDFAYsDFgcsDlgcsDhgccDigMUBiwMWBywOWBywOGBxwOKAxQGLAxYHei4H/g+c7D+JW5vTeAAAAABJRU5ErkJggg=="
    }

Colors do not respond to runtime changes to device Dark Mode setting

WhatsNewKit Environment

  • WhatsNewKit version: 1.3.1
  • Xcode version: 11.1
  • Swift version: 5
  • macOS version running Xcode: 10.15.1
  • Dependency manager (Carthage, CocoaPods, Manually): CocoaPods

What did you do?

  • Configured completion button background colour with my own custom UIColor instance supporting Dark Appearance
  • Change the device Dark appearance setting in Simulator via Settings & Xcode Environment Overrides

What did you expect to happen?

ℹ Colours to update to the corresponding dark/light appearance shade

What happened instead?

ℹ Completion button background colour remained in the colour it was initialised with.

Please Provide Support for Swift Package Manager , Thanks

WhatsNewKit Environment

  • WhatsNewKit version:
  • Xcode version:
  • Swift version:
  • macOS version running Xcode:
  • Dependency manager (Carthage, CocoaPods, Manually):

What did you do?

ℹ Please replace this with what you did.

What did you expect to happen?

ℹ Please replace this with what you expected to happen.

What happened instead?

ℹ Please replace this with of what happened instead.

Problems with KeyValueWhatsNewVersionStore

Hi Sven,

I tried the KeyValueWhatsNewVersionStore implementation as described in README.md and it crashed when using UserDefaults.standard, or fails when using NSUbiquitousKeyValueStore.default. The crash happens when you press the completion button.

For NSUSerdefaults it crashes with
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Attempt to insert non-property list object 1.0.0 for key de.tiigi.whatsnewkit.1.0.0'

For iCloud it fails with
[NSUbiquitousKeyValueStore setObject:forKey:]: Attempt to insert non-property value '1.0.0' of class '_SwiftValue'.

What would I need to do to fix this?

Max

Truncated text on iOS 14

WhatsNewKit Environment

  • WhatsNewKit version: 2.0.0
  • Xcode version: 13.2.1
  • Swift version: 5.5.2
  • macOS version running Xcode: 12.1
  • Dependency manager (SPM, Manually): SPM

What did you do?

Presented a WhatsNewKit view controller on a iOS 14 simulator

What did you expect to happen?

The text to not be truncated.

What happened instead?

The text was truncated. See attached screenshot.
Screenshot 2022-01-09 at 11 32 41
Produce by using the following code:

WhatsNewViewController(whatsNew:
    WhatsNew(
        title: .init(text: .init("Whats New in Reading List")),
        features: [
            .init(
                image: .init(systemName: "shuffle"),
                title: .init("Shake to Choose"),
                subtitle: .init("Shake your device to choose your next book")
            ),
            .init(
                image: .init(systemName: "hammer.fill"),
                title: .init("Improvements and Fixes"),
                subtitle: .init("Various performance improvements and bug fixes")
            )
        ]
    )
)

Note, this does not occur on iOS 15 simulators. I have seen similar issues in SwiftUI before, requiring the use of .fixedSize()...

Statusbar hidden option (enhancement)

current its not possible to set a flag to hide statusbar without a subclass of WhatsNewViewController.

enhancement
config.prefersStatusbarHidden = true

v1.1.4 breaks KeyValueWhatsNewVersionStore

After upgrading, WhatsNew keeps displaying every time I launch the app. Downgraded back to 1.1.3, problem goes away.

print(keyValueVersionStore.has(version: .current()))
always shows false with v1.1.4

Swipe gesture to dismiss doesn't work reliably

WhatsNewKit Environment

  • WhatsNewKit version: 1.3.5
  • Xcode version: 11.6
  • Swift version: 5
  • macOS version running Xcode: 10.15.5
  • Dependency manager (SPM, Carthage, CocoaPods, Manually): SPM or standalone

What did you do?

Build and run WhatsNewKit-Example

Tap "Present" button

Put finger on the ItemsView and drag down

What did you expect to happen?

The WhatsNew panel should begin dismiss animation and follow the finger's movement

What happened instead?

The WhatsNew panel doesn't move at all 90% of the times. Sometimes it begins moving late after the gesture has moved a considerable amount of space. Rarely it begins immediately and follows the gesture.

WhatsNewKit iOS dependency preventing SwiftUI preview for watchOS app

What happened?

XCode 15 + iOS app (min target iOS 15) + watchOS app (min target watchOS 9).
WhatsNewKit as SPM dependency for the iOS app.

Problem: when previewing SwiftUI views for the watch app, I get this error:

`
== PREVIEW UPDATE ERROR:

SchemeBuildError: Failed to build the scheme ”MyAppWatch Watch App”

'SymbolRenderingMode' is only available in watchOS 8.0 or newer

Emitting module for WhatsNewKit:
/Users/user/Library/Developer/Xcode/DerivedData/MyApp-gglszqrqhbbrmqcgpkravwysjmar/SourcePackages/checkouts/WhatsNewKit/Sources/Models/WhatsNew+Feature+Image.swift:110:31: error: 'SymbolRenderingMode' is only available in watchOS 8.0 or newer
        symboldRenderingMode: SymbolRenderingMode?,`

What are the steps to reproduce?

What is the expected behavior?

Do not block SwiftUI previews

Animations & iOS 13

WhatsNewKit Environment

  • WhatsNewKit version: 1.2.0
  • Xcode version: Version 11.0 (11A420a)
  • Swift version: 5
  • macOS version running Xcode: 10.14.6
  • Dependency manager (Carthage, CocoaPods, Manually): CocoaPods

What did you do?

In the iOS 13 beta, the animations in WhatsNewKit don't show (due to changes in 13 and how push screens are rendered)

What did you expect to happen?

using:
self.present(whatsNewViewController, animated: true)

in 12x - animations are fine
in 13x - animations do not render

using:
self.navigationController?.pushViewController(whatsNewViewController, animated: true)
in 13x - animations are fine, but "back" is displayed at top of whatsNewViewController

iOS 10 layout issues

I tried a basic WhatsNewViewController in my app. On the iOS 11 device, it works as expected. On the iOS 10 one, it seems that the order of statements while configuring the labels matters, as setting the font after setting the attributed text overwrites the attributes. Additionally, iOS 10 seems to require estimatedRowHeight to be either set or returned from the delegate for automatic sizing to work properly.

I forked the repo, fixed the issue back in the commit tagged with 1.1.1 (since I personally need Swift 4.1) and did a rebase, should I create a PR for this?

[iOS 13] ItemsView scrollview too large when using content Mode .fill or .center

WhatsNewKit Environment

  • WhatsNewKit version: 1.2
  • Xcode version: Xcode-beta 11.0 beta 5
  • Swift version: Swift 5
  • macOS version running Xcode: macOS 10.14.6
  • Dependency manager (Carthage, CocoaPods, Manually): CocoaPods

What did you do?

Launched the WhatsNewViewController in iOS 13 with a itemsView.contentMode of .center or .fill.

What did you expect to happen?

All the items to fit on the screen.

What happened instead?

The itemsView scrollView went off the screen, with too much space between each itemView. The below screenshots are using an .fill with some insets for the itemsView on an iPhone XR simulator.

iOS 12.2

iOS 13.0

Page indicator

Hi, very nice library. Is there a way to show a page indicator in the slides?

Can't get initial whatsNewCollection to show again

What happened?

I have changed the version store to use user defaults and used that in the .environment call ... but the initial what's new that is created in the App class, never reappears.

.environment(\.whatsNew, .init(versionStore: userDefaultsWhatsNewVersionStore, whatsNewCollection: self))

Also tried to subclass the WhatsNewEnvironment ... but not clear how to pass in a new WhatsNew object, OR, at least then while testing, how to revert back to contents of an existing version to get the content to be correct before publishing.

Thanks !

What are the steps to reproduce?

Outlined above.

What is the expected behavior?

Should have the initial what's new content to reappear

Title is overpowering with phones in landscape mode

WhatsNewKit Environment

  • WhatsNewKit version: 1.3.1
  • Xcode version: 11.3.1 (11C504)
  • Swift version: 5
  • macOS version running Xcode: 10.15.3 (19D76)
  • Dependency manager (SPM, Carthage, CocoaPods, Manually): Manual? I'm using the example project

What did you do?

  • Built & Ran the example project
  • Rotated iPhone to landscape
  • Scrolled through the changelog

What did you expect to happen?

  • I thought perhaps the title would pan with the content so it wasn't so obstructive. Kind of like how "large titles" for navigation controllers work

What happened instead?

  • Title remained the same size and viewing the content was quite difficult.

Perhaps this could be a general improvement to pan the title like how the "large titles" work in navigation controllers? I'm not sure if there was a reasoning behind making it static? I've attached a screenshot of the layout in landscape mode below

image

`import: WhatsNewKit`

WhatsNewKit Environment

  • WhatsNewKit version: 1.1.9
  • Xcode version: 10.2.1
  • Swift version: 5
  • macOS version running Xcode: 10.14.5
  • Dependency manager (Carthage, CocoaPods, Manually): CocoaPods

What did you do?

I added pod 'WhatsNewKit' to the my Xcode project and successfully installed WhatsNewKit.

What did you expect to happen?

I expected to be able to type import: WhatsNewKit in the AppDelegate.swift file.

What happened instead?

When I type import: WhatsNewKit in the AppDelegate.swift file the framework isn't recognised and I get a "No such module 'WhatsNewKit'" warning in red. - I can see the pods file has been added, but Xcode isn't letting me use it.

I'm a first-time developer so could be missing something obvious, but I'm doing everything shown in the instructions (and a YouTube video I found online) but Xcode just can't see the WhatsNewKit framework.

Any help would be much appreciated this looks amazing.

Apple TV support

hi,
have you planned to add support for apple tv to WhatsNewKit?

Thank's

Conditional sheet

Is your feature request related to a problem?

It would be great to have a conditional manual presentation

What solution would you like?

In the "manual" presentation, would it be possible to achieve something like this?

.sheet(whatsNew: self.$whatsNew, isPresented: $shouldPresentNews)

What alternatives have you considered?

Maybe I'm missing something, but I haven't figured out how to achieve that

Any additional context?

No response

Detail button was missing on iPad in landscape

I was running the demo on iPad Pro 11 simulator(iOS 12), and the detail button was missing when iPad was in landscape, and split mode.

Also, I found the items view was too left, and the completion button was too long when using on iPad in landscape. Maybe you can give an option to use tableView.cellLayoutMarginsFollowReadableWidth = true and some other layout change to make it more readable on iPad.

simulator screen shot - ipad pro 11-inch - 2019-01-31 at 23 53 40

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.