Skip to content

Commit

Permalink
Merge pull request #5 from macbookator/main
Browse files Browse the repository at this point in the history
SFSafariViewController Reader Mode Support
  • Loading branch information
NuPlay authored Jan 20, 2022
2 parents 36a9d50 + 101bddd commit dcf9a3e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions Sources/RichText/RichTextEnums.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public enum fontType : String {

public enum linkOpenType: String {
case SFSafariView = "SFSafariView"
case SFSafariViewWithReader = "SFSafariViewWithReader"
case Safari = "Safari"
case none = "none"
}
5 changes: 4 additions & 1 deletion Sources/RichText/Webview.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ struct Webview : UIViewRepresentable {
switch self.parent.linkOpenType {
case .SFSafariView:
root?.present(SFSafariViewController(url: url), animated: true, completion: nil)

case .SFSafariViewWithReader:
let configuration = SFSafariViewController.Configuration()
configuration.entersReaderIfAvailable = true
root?.present(SFSafariViewController(url: url, configuration: configuration), animated: true, completion: nil)
case .Safari :
UIApplication.shared.open(url)
case .none :
Expand Down

0 comments on commit dcf9a3e

Please sign in to comment.