SvenTiigi / WhatsNewKit

Showcase your awesome new app features 📱
https://sventiigi.github.io/WhatsNewKit/
MIT License
3.92k stars 193 forks source link

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

Closed stshelton closed 6 years ago

stshelton commented 6 years ago

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.

SvenTiigi commented 6 years ago

Hey @stshelton

Thanks for your detailed bug report.

The WhatsNewViewController.Theme initializer with a configuration closure is available from WhatsNewKit Version: 1.1.0

In Version 1.0.2 this initializer isn't available.

Please try to update WhatsNewKit to Version 1.1.1 which is the latest release for Swift 4.1.

stshelton commented 6 years ago

That worked, appreciate the quick response. I ran into one more issue after I built and ran my project. 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
    }

If you want me to open another issure i can just let me know, Thanks.

SvenTiigi commented 6 years ago

Duplicate of #7