HomeiOS Developmentios - Go dictionary as a worth to launchArguments for UI Exams

ios – Go dictionary as a worth to launchArguments for UI Exams


I’m attempting to cross a worth represented as a dictionary for launchArguments with a purpose to run UI Exams.

So, I’ve tried to transform the dictionary to a String format and cross it like that:

let dic = ["Key1": "Value1", "Key2": "Value2"]
do {
    let information = strive JSONEncoder().encode(dic)
    if let worth = String(information: information, encoding: .utf8) {
        launchArguments += [ "-launchKey", value ]
    }
} catch {
    print("Error encoding launchArguments: (error.localizedDescription)")
}

When the app begins, it would not add a dictionary to UserDefaults. It would not give any data as nicely. What is likely to be an issue?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments