Date: 2021-08-04 15:59:18, Hit: 300
struct SomeStruct: Codable {
    let id: String
}

guard let bodyString = WKScriptMessage.body as? String,
      let bodyData = bodyString.data(using: .utf8) else { fatalError() }

let bodyStruct = try? JSONDecoder().decode(SomeStruct.self, from: bodyData)
Edit Delete
License by Moony