I'm trying to observe cookie changes when I use `WKWebView`. I added my AppDelegate as an observer:
WKWebsiteDataStore.default().httpCookieStore.add(self)The application starts and immediately `cookiesDidChange` fires. I then get an exception with nothing useful printed in the console. Xcode shows this on the third line below: WebThread (15): EXC_BREAKPOINT (code=1, subcode=0x1c67e03f4)
func cookiesDidChange(in cookieStore: WKHTTPCookieStore) {
print("cookiesDidChange!!")
cookieStore.getAllCookies{ cs in } // <-- crashes hereI added some logic to not call `getAllCookies` until after some WebViews are created. It then succeeds a few times but fails again in same way.
Any ideas? Is there some thread safety issue around called `getAllCookies`?
Rob