Skip to content

Commit

Permalink
Set preferred action to 'OK'
Browse files Browse the repository at this point in the history
  • Loading branch information
swordray committed Feb 12, 2018
1 parent 03a724b commit 9dc0627
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions JXWebViewController/Classes/JXWebViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ extension JXWebViewController: WKUIDelegate {
alertController.addAction(UIAlertAction(title: JXLocalizedString("OK"), style: .default) { _ in
completionHandler(true)
})
alertController.preferredAction = alertController.actions.last
present(alertController, animated: true)
}

Expand All @@ -142,6 +143,7 @@ extension JXWebViewController: WKUIDelegate {
alertController.addAction(UIAlertAction(title: JXLocalizedString("OK"), style: .default) { _ in
completionHandler(alertController.textFields?.first?.text)
})
alertController.preferredAction = alertController.actions.last
present(alertController, animated: true)
}

Expand Down

0 comments on commit 9dc0627

Please sign in to comment.