TipKit: "Cannot find 'DisplayFrequency' in scope"

Hi there,

I am quite new to SwiftUI and got this problem: I want to implement TipKit in my app but as soon as I put DisplayFrequency and datastoreLocation into my code, I get this error message:

I know that I somehow could look it up in the documentation but unfortunately I am still so new, that I don't understand it. Could someone help?

Best

Laurin

Accepted Reply

It looks like you’re trying to use Tipsp.configure(_:) as some sort of ‘result builder’ API, but that’s not how it works. Rather, it takes an array of configuration option values. So, you want something like this:

try! await Tips.configure([
    .displayFrequency(.immediate),
    .datastoreLocation(.applicationDefault)
])

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

  • Thank you very much! :)

Add a Comment

Replies

It looks like you’re trying to use Tipsp.configure(_:) as some sort of ‘result builder’ API, but that’s not how it works. Rather, it takes an array of configuration option values. So, you want something like this:

try! await Tips.configure([
    .displayFrequency(.immediate),
    .datastoreLocation(.applicationDefault)
])

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

  • Thank you very much! :)

Add a Comment