Skip to content

Instantly share code, notes, and snippets.

@nderkach
Last active September 18, 2018 10:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nderkach/4a2225d5230d722b194d44fec4e0861e to your computer and use it in GitHub Desktop.
Save nderkach/4a2225d5230d722b194d44fec4e0861e to your computer and use it in GitHub Desktop.
guard let jsonData = try? JSONSerialization.data(withJSONObject: trackers, options: .prettyPrinted) else {
return
}
let documentFolder = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: "group.trackerblocker")
guard let jsonURL = documentFolder?.appendingPathComponent(Constants.blockerListFilename) else {
return
}
do {
try jsonData.write(to: jsonURL)
} catch {
// Handle the error here
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment