Instantly share code, notes, and snippets.

Embed
What would you like to do?
Swift Post Testability Example Code
class FileOpener {
func open(identifier: String) {
guard let url = URL(string: "iosappscheme://open?id=\(identifier)") else {
debugPrint("Failed to convert URL")
return
}
if UIApplication.shared.canOpenURL(url) {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
} else {
debugPrint("Failed to open URL")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment