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

Answered by DTS Engineer in 771261022

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"

Accepted Answer

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"

TipKit: "Cannot find 'DisplayFrequency' in scope"
 
 
Q