Open PDF file using swift - ios

How can I add a PDF file for an app , where you click on a button to view the file & when you're done you get back to screen you were at?

If you simply want to view a PDF file you can load it into a UIWebView.
let url : NSURL! = NSURL(string: "http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIWebView_Class/UIWebView_Class.pdf")
webView.loadRequest(NSURLRequest(URL: url))
Swift 4.1 :
let url: URL! = URL(string: "http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIWebView_Class/UIWebView_Class.pdf")
webView.loadRequest(URLRequest(url: url))
If you'd like to achieve more, a good framework is PSPDFKit.

Apple added PDFKit framework in iOS 11
Add a UIView to your view controller and make it's class to PDFView
import UIKit
import PDFKit
class ViewController: UIViewController {
#IBOutlet var pdfView: PDFView!
override func viewDidLoad() {
super.viewDidLoad()
if let path = Bundle.main.path(forResource: "sample", ofType: "pdf") {
if let pdfDocument = PDFDocument(url: URL(fileURLWithPath: path)) {
pdfView.displayMode = .singlePageContinuous
pdfView.autoScales = true
pdfView.displayDirection = .vertical
pdfView.document = pdfDocument
}
}
}
}
There are 4 display modes : singlePage, singlePageContinuous, twoUp, twoUpContinuous .

SWIFT 4+
If has to open file from local cache/Documentdiectory which has file path
Method 1: using UIDocumentInteractionController
class ViewController: UIViewController,UIDocumentInteractionControllerDelegate {
//let path = Bundle.main.path(forResource: "Guide", ofType: ".pdf")!
let dc = UIDocumentInteractionController(url: URL(fileURLWithPath: path))
dc.delegate = self
dc.presentPreview(animated: true)
}
//MARK: UIDocumentInteractionController delegates
func documentInteractionControllerViewControllerForPreview(_ controller: UIDocumentInteractionController) -> UIViewController {
return self//or use return self.navigationController for fetching app navigation bar colour
}
Method 2: using WebView
let webview = WKWebView(frame: UIScreen.main.bounds)
view.addSubview(webview)
webview.navigationDelegate = self
webview.load(URLRequest(url: URL(fileURLWithPath: path)))//URL(string: "http://") for web URL

For Xcode 8.1 and Swift 3.0
Save the PDF file in any folder of your xcode.
Suppose the file name is 'Filename.pdf'
if let pdf = Bundle.main.url(forResource: "Filename", withExtension: "pdf", subdirectory: nil, localization: nil) {
let req = NSURLRequest(url: pdf)
yourWebViewOutletName.loadRequest(req as URLRequest)
}
Same will apply if you want to open any html file.

you can use UIDocumentInteractionController to preview file in IOS.
In the view controller's file, add a property of type UIDocumentInteractionController
and implement a simple delegate method of it
self.documentInteractionController = UIDocumentInteractionController.init(URL: url)
self.documentInteractionController?.delegate = self
self.documentInteractionController?.presentPreviewAnimated(t‌​rue)
func documentInteractionControllerViewControllerForPreview(controller: UIDocumentInteractionController) -> UIViewController {
return self
}
don't forget to add UIDocumentInteractionControllerDelegate in view controller's class

Check out PDFKit from IOS11
Here is an example of a view controller which implements PDFView from PDFKit.
import UIKit
import PDFKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Add PDFView to view controller.
let pdfView = PDFView(frame: self.view.bounds)
self.view.addSubview(pdfView)
// Fit content in PDFView.
pdfView.autoScales = true
// Load Sample.pdf file.
let fileURL = Bundle.main.url(forResource: "Sample", withExtension: "pdf")
pdfView.document = PDFDocument(url: fileURL!)
}
}

SWIFT 5
An update to open the file from the Document directory (device) and present preview:
let urlFile = URL(string: pathToFile)
var documentInteractionController: UIDocumentInteractionController!
documentInteractionController = UIDocumentInteractionController.init(url: urlFile!)
documentInteractionController?.delegate = self
documentInteractionController?.presentPreview(animated: true)
And UIDocumentInteractionControllerDelegate:
extension ViewController: UIDocumentInteractionControllerDelegate {
func documentInteractionControllerViewControllerForPreview(_ controller: UIDocumentInteractionController) -> UIViewController {
return self
}
}
If you want to dismiss the document preview you can use:
documentInteractionController?.dismissPreview(animated: true)

You can use this code in Swift 4
Import PDFKit
Copy this code
let pdfView = PDFView()
pdfView.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(pdfView)
pdfView.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor).isActive = true
pdfView.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor).isActive = true
pdfView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor).isActive = true
pdfView.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor).isActive = true
guard let path = Bundle.main.url(forResource: "test", withExtension: "pdf") else { return }
if let document = PDFDocument(url: path) {
pdfView.document = document
}

You can use this UIViewController. It contains the share button for free:
import UIKit
import PDFKit
class PDFWebViewController: UIViewController {
var pdfURL: URL!
private var pdfView: PDFView!
override func viewDidLoad() {
super.viewDidLoad()
self.edgesForExtendedLayout = []
self.setPDFView()
self.fetchPDF()
}
private func setPDFView() {
DispatchQueue.main.async {
self.pdfView = PDFView(frame: self.view.bounds)
self.pdfView.maxScaleFactor = 3;
self.pdfView.minScaleFactor = self.pdfView.scaleFactorForSizeToFit;
self.pdfView.autoScales = true;
self.pdfView.autoresizingMask = [.flexibleHeight, .flexibleWidth]
self.view.addSubview(self.pdfView)
}
}
private func fetchPDF() {
DispatchQueue.global(qos: .userInitiated).async {
if let data = try? Data(contentsOf: self.pdfURL), let document = PDFDocument(data: data) {
DispatchQueue.main.async {
self.pdfView.document = document
self.addShareBarButton()
}
}
}
}
private func addShareBarButton() {
let barButtonItem = UIBarButtonItem(barButtonSystemItem: .action,
target: self,
action: #selector(self.presentShare))
barButtonItem.tintColor = .white
self.navigationItem.rightBarButtonItem = barButtonItem
}
#objc private func presentShare() {
guard let pdfDocument = self.pdfView.document?.dataRepresentation() else { return }
let activityViewController = UIActivityViewController(activityItems: [pdfDocument], applicationActivities: nil)
activityViewController.popoverPresentationController?.barButtonItem = self.navigationItem.rightBarButtonItem
self.present(activityViewController, animated: true)
}
}
To use it:
let viewController = PDFWebViewController()
// the url can be a web url or a file url
viewController.pdfURL = url
self.navigationController?.pushViewController(viewController, animated: true)

You can also use Quick Look Framework from Apple.
It is very flexible.
You can show your PDF file with zoom feature.
Also you have support for all other types (like png, jpg, docx, txt, rtf, xlsx, zip, mov, etc) of files and it is very easy to use.
Please refer
this answer if you want detail description of using QuickLook.framework

A modernized version of Akila's answer, with the benefit that it is a drop in, ready to use UIViewController that you can integrate into your app.
import UIKit
import PDFKit
final class PDFViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let pdfView = PDFView(frame: view.frame)
title = "Your_title_here"
if let url = Bundle.main.url(forResource: "document_name_here", withExtension: "pdf"),
let pdfDocument = PDFDocument(url: url) {
pdfView.displayMode = .singlePageContinuous
pdfView.autoScales = true
pdfView.displayDirection = .vertical
pdfView.document = pdfDocument
view.addSubview(pdfView)
}
}
}
It creates the PDFView during viewDidLoad and sets it to use the view's frame
The URL for the PDF file is safely unwrapped from the bundle and then a PDFDocument is created, if possible
Some common settings are used. Adjust as needed
Finally, it adds the PDFView as a subview of the controller's view

//In Swift 5
class PDFBookViewController: UIViewController, PDFViewDelegate {
override func viewDidLoad() {
super.viewDidLoad()
addPDFView()
}
private func addPDFView() {
let pdfView = PDFView()
pdfView.translatesAutoresizingMaskIntoConstraints = false
pdfContenerView.addSubview(pdfView)
pdfView.leadingAnchor.constraint(equalTo: pdfContenerView.safeAreaLayoutGuide.leadingAnchor).isActive = true
pdfView.trailingAnchor.constraint(equalTo: pdfContenerView.safeAreaLayoutGuide.trailingAnchor).isActive = true
pdfView.topAnchor.constraint(equalTo: pdfContenerView.safeAreaLayoutGuide.topAnchor).isActive = true
pdfView.bottomAnchor.constraint(equalTo: pdfContenerView.safeAreaLayoutGuide.bottomAnchor).isActive = true
pdfView.autoScales = true
pdfView.displayMode = .singlePageContinuous
pdfView.displayDirection = .vertical
///Open pdf with help of FileManager URL
if let dir = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first {
let bookWithPdf = "\(bookname).pdf"
let fileURL = dir.appendingPathComponent(bookWithPdf)
let document = PDFDocument(url: fileURL)
pdfView.document = document
}
#IBAction func backButtonPressed(_ sender: Any) {
navigationController?.popViewController(animated: true)
}
}

if let url: URL = URL(string: "http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIWebView_Class/UIWebView_Class.pdf") {
webView.loadRequest(URLRequest(url: url)) }

let openLink = NSURL(string : OtherContactorProfileVview.Result.CertificateList[index].CertificateFileLink)
if #available(iOS 9.0, *) {
let svc = SFSafariViewController(url: openLink! as URL)
present(svc, animated: true, completion: nil)
} else {
let port = UIStoryboard(
name: "Main",
bundle: nil
).instantiateViewController(withIdentifier: "PDFViewer") as! PDFViewer
port.strUrl = OtherContactorProfileVview.Result.CertificateList[index].CertificateFileLink
navigationController?.pushViewController(port, animated: true)
}

Related

Trigger an In-App Safari Browser from a PDF Button Widget with PDFKIT - IOS

I tried implementing the solution in the answer of this question and I couldn't.
I'm trying to trigger an in-app safari browser with a pre-set link from a PDF widget button.
This is my code sample:
import UIKit
import PDFKit
import SafariServices
...
//Safari VC declaration with the desired link
let sfVC = SFSafariViewController(url: URL(string: "https://www.apple.com/")!)
func insertLinkButtonInto(_ page: PDFPage) {
let pageBounds = page.bounds(for: .cropBox)
let linkButtonBounds = CGRect(x: 90, y: pageBounds.size.height - 300, width: 106, height: 32)
let linkButton = PDFAnnotation(bounds: linkButtonBounds, forType: PDFAnnotationSubtype(rawValue: PDFAnnotationSubtype.widget.rawValue), withProperties: nil)
linkButton.widgetFieldType = PDFAnnotationWidgetSubtype(rawValue: PDFAnnotationWidgetSubtype.button.rawValue)
linkButton.widgetControlType = .pushButtonControl
linkButton.caption = "Click link"
page.addAnnotation(linkButton)
let linkButtonAction = PDFActionURL(url: URL(string: "https://www.apple.com/")!)
// linkButtonAction.action = How do I implement the code?
}
This is the action I'm trying to trigger:
present(sfVC, animated: true)
This is the function that I didn't know how to implement:
func pdfViewWillClick(onLink sender: PDFView, with url: URL) {
print(url)
}
This is the code in ViewDidload:
override func viewDidLoad() {
super.viewDidLoad()
if let documentURL = Bundle.main.url(forResource: "PDFFileName", withExtension: "pdf"),
let document = PDFDocument(url: documentURL),
let page = document.page(at: 0) {
// Set our document to the view, center it, and set a background color
pdfView?.document = document
pdfView?.autoScales = true
pdfView?.backgroundColor = UIColor.lightGray
self.insertLinkButtonInto(page)
}
I know the solution might be very easy for an experience programmer. I would really appreciate the help.
You are missing few things in your current code. In your viewDidLoad method set the delegate of the pdfView
override func viewDidLoad() {
super.viewDidLoad()
if let documentURL = Bundle.main.url(forResource: "Application", withExtension: "pdf"),
let document = PDFDocument(url: documentURL),
let page = document.page(at: 0) {
// Set our document to the view, center it, and set a background color
pdfView?.document = document
pdfView?.autoScales = true
pdfView?.backgroundColor = UIColor.lightGray
self.insertLinkButtonInto(page)
//set the delegate of the pdfView to this viewController
pdfView?.delegate = self
}
Present the SFSafariViewController in delegate method with the url
func pdfViewWillClick(onLink sender: PDFView, with url: URL) {
print(url)
let sfVC = SFSafariViewController(url: url)
self.present(sfVC, animated: true)
}
set the action for PDFAnnotation in
func insertLinkButtonInto(_ page: PDFPage) {
let pageBounds = page.bounds(for: .cropBox)
let linkButtonBounds = CGRect(x: 90, y: 10, width: 106, height: 32)
let linkButton = PDFAnnotation(bounds: linkButtonBounds, forType: PDFAnnotationSubtype(rawValue: PDFAnnotationSubtype.widget.rawValue), withProperties: nil)
linkButton.widgetFieldType = PDFAnnotationWidgetSubtype(rawValue: PDFAnnotationWidgetSubtype.button.rawValue)
linkButton.widgetControlType = .pushButtonControl
linkButton.caption = "Click link"
page.addAnnotation(linkButton)
let linkButtonAction = PDFActionURL(url: URL(string: "https://www.apple.com/")!)
//set the linkButton action
linkButton.action = linkButtonAction
}

Issue loading PDF for UIActivityViewController with .dataRepresentation()

I have what I thought was a simple View Controller to displayed a preloaded PDF file. The path to the PDF is passed into var pdfPath by the pervious controller.
I have an action/share button I'm trying to use for sharing and printing the PDF using PDFDocument.dataRepresentation(). According to multiple sources online, it should work, but I'm getting a strange error:
[Unknown process name] Failed to load
/System/Library/PrivateFrameworks/CorePDF.framework/Versions/A/CorePDF
Code:
import UIKit
import PDFKit
class PDFViewController: UIViewController {
#IBOutlet weak var ActionBarButton: UIBarButtonItem!
var pdfPath: String? = nil
override func viewDidLoad() {
super.viewDidLoad()
let pdfView = PDFView(frame: self.view.bounds)
self.view.addSubview(pdfView)
pdfView.autoScales = true
if let path = pdfPath {
let fileURL = Bundle.main.url(forResource: path, withExtension: "pdf")
pdfView.document = PDFDocument(url: fileURL!)!
}
}
#IBAction func ActionButtonPressed(_ sender: UIBarButtonItem) {
print("ActionButtonPressed():")
if let path = pdfPath {
let fileURL = Bundle.main.url(forResource: path, withExtension: "pdf")
let pdfDocument = PDFDocument(url: fileURL!)
guard let data = pdfDocument?.dataRepresentation() else {return}
let activityController = UIActivityViewController(activityItems: [data], applicationActivities: nil)
self.present(activityController, animated: true, completion: nil)
}
}
If anyone knows the answer to why this isn't working I'd be very grateful.
Rather than passing the data, you can pass the URL of the file, which UIActivityViewController will recognise and display share options accordingly.
let activityController = UIActivityViewController(activityItems: [fileURL], applicationActivities: nil)

How to display pdf downloaded from internet in PDFKit?

I have successfully download pdf file from Internet and it is saved in documents directory.
The url is as follows of the downloaded file
file:///Users/heetshah/Library/Developer/CoreSimulator/Devices/4BF83AAF-A910-46EB-AE76-91BC6BEED033/data/Containers/Data/Application/B4532805-2842-431F-B16C-C5E448C8366F/Documents/TPAFForm.pdf
I am trying to display it to PDFKit as follows.
let path = URL(fileURLWithPath: pdfUrl!)
if let document = PDFDocument(url: path) {
pdfView.document = document
pdfView.displayMode = .singlePageContinuous
pdfView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
pdfView.displaysAsBook = true
pdfView.displayDirection = .vertical
pdfView.autoScales = true
pdfView.maxScaleFactor = 4.0
pdfView.minScaleFactor = pdfView.scaleFactorForSizeToFit
}
I am not getting any error
I have went through bunch of stack overflow posts and it is displaying the same solution as above but it does not work in my case.
I also tried following solution but it does not work
if let path = Bundle.main.path(forResource: pdfUrl, ofType: "pdf") {
let url = URL(fileURLWithPath: path)
if let pdfDocument = PDFDocument(url: url) {..
Following is my code to download the file
func downloadPDF(pdfUrl: String?,fileName: String,completionHandler:#escaping(String,Bool) -> ()){
let destinationPath: DownloadRequest.DownloadFileDestination = {
_,_ in
let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0]
let fileURL = documentsURL.appendingPathComponent("\(fileName).pdf")
return (fileURL,[.removePreviousFile,.createIntermediateDirectories])
}
if let pdfUrl = pdfUrl {
Alamofire.download(pdfUrl, to: destinationPath).downloadProgress { (progress) in
}.responseData { (response) in
switch response.result{
case .success:
if response.destinationURL != nil,let filePath = response.destinationURL?.absoluteString{
completionHandler(filePath,true)
}
break
case .failure:
completionHandler("Something went wrong",false)
break
}
}
}
}
I am using Alamofire to download the file. There constraint for my PDFView are proper as I am able to display an online url pdf in my preview but I need to download the pdf locally first and then display it in my pdf view
Since you have not shown sufficient code to debug the problem, here is complete code for doing what you describe, and you can debug your problem by comparing your code to mine:
import UIKit
import PDFKit
class ViewController: UIViewController {
let pdfurl = URL(string:"https://www.apeth.com/rez/release.pdf")!
let pdffileurl : URL = {
let fm = FileManager.default
let docsurl = try! fm.url(
for: .documentDirectory, in: .userDomainMask,
appropriateFor: nil, create: true)
return docsurl.appendingPathComponent("mypdf.pdf")
}()
override func viewDidLoad() {
super.viewDidLoad()
let sess = URLSession.shared
sess.downloadTask(with: self.pdfurl) { (url, resp, err) in
if let url = url {
let fm = FileManager.default
try? fm.removeItem(at: self.pdffileurl)
try? fm.moveItem(at: url, to: self.pdffileurl)
DispatchQueue.main.async {
self.displayPDF()
}
}
}.resume()
}
func displayPDF() {
let pdfview = PDFView(frame:self.view.bounds)
pdfview.autoresizingMask = [.flexibleWidth, .flexibleHeight]
pdfview.autoScales = true
self.view.addSubview(pdfview)
let doc = PDFDocument(url: self.pdffileurl)
pdfview.document = doc
}
}

PDFView unable to move to nextpage

Code:
if let path = Bundle.main.path(forResource: "test", ofType: "pdf") {
let url = URL(fileURLWithPath: path)
if let pdfDocument = PDFDocument(url: url) {
pdfView.displayMode = .singlePage
pdfView.autoScales = true
pdfView.displayDirection = .horizontal
pdfView.document = pdfDocument
}
}
i try to show pdf file in app.it is working fine.how to implement horizontal scrolling(page by page) and search function(like highlight search word) features.any help will be appericated.thanks in advance
you need to add this line of code:
pdfView.usePageViewController(true, withViewOptions: nil)
****UPDATE**
PDFDocument . has some notifications about search. Have a look.
try this code for searching string.in this line beginFindString you can set string
var searchedString: PDFSelection?
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
self.document?.beginFindString("StringName", withOptions: .caseInsensitive)
}
func documentDidEndDocumentFind(_ notification: Notification) {
pdfView.setCurrentSelection(searchedString, animate: true)
}
func documentDidFindMatch(_ notification: Notification) {
if let selection = notification.userInfo?.first?.value as? PDFSelection {
selection.color = .Red
if searchedString == nil {
// The first found item sets the object.
searchedString = selection
} else {
// All other found selection will be nested
searchedString!.add(selection)
}
}
}

Swift: How to Open local pdf from my app to iBooks

I was in objective-c before. and this code below in objective C is working fine:
in. h
#property (retain)UIDocumentInteractionController *docController;
and in .m
NSString *path = [[NSBundle mainBundle] pathForResource:#"book" ofType:#"pdf"];
NSURL *targetURL = [NSURL fileURLWithPath:path];
docController = [UIDocumentInteractionController interactionControllerWithURL:targetURL];
if([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:#"itms-books:"]]) {
[docController presentOpenInMenuFromRect:CGRectZero inView:self.view animated:YES];
NSLog(#"iBooks installed");
} else {
NSLog(#"iBooks not installed");
}
but now i am trying to use swift to open and this is my swift code:
if let path = NSBundle.mainBundle().pathForResource("book", ofType: "pdf") {
if let targetURL = NSURL.fileURLWithPath(path) {
let docController = UIDocumentInteractionController(URL: targetURL)
let url = NSURL(string:"itms-books:");
if UIApplication.sharedApplication().canOpenURL(url!) {
docController.presentOpenInMenuFromRect(CGRectZero, inView: self.view, animated: true)
println("iBooks is installed")
}else{
println("iBooks is not installed")
}
}
}
but it crash when I select iBooks to open the pdf. can anyone help me!
I think Bojan Macele had a great answer, and I used his code, I just think it needed some explanation. I had some trouble with the app crashing as well. Just make sure that docController is declared outside of the function you want to use it in. I have this variable declared right under my class declaration.
import UIKit
class ViewController: UIViewController {
var button : UIButton?
var docController: UIDocumentInteractionController?
override func viewDidLoad() {
super.viewDidLoad()
button = UIButton(frame: CGRectMake(10, 50, 100, 50))
button?.backgroundColor = UIColor.blackColor()
self.view.addSubview(button!)
button?.addTarget(self, action: "buttonPressed:", forControlEvents: UIControlEvents.TouchDown)
}
func buttonPressed(sender: UIButton){
println("button pressed")
if let path = NSBundle.mainBundle().pathForResource("test", ofType: "pdf") {
if let targetURL = NSURL.fileURLWithPath(path) {
docController = UIDocumentInteractionController(URL: targetURL)
let url = NSURL(string:"itms-books:");
if UIApplication.sharedApplication().canOpenURL(url!) {
docController!.presentOpenInMenuFromRect(CGRectZero, inView: self.view, animated: true)
println("iBooks is installed")
}else{
println("iBooks is not installed")
}
}
}
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
So I was just doing a demo project to get this working. This is it. The reason it needs to be declared outside of the function is for memory management issues. Once the program gets to the end of the buttonPressed, it no longer knows what docController is. Then, it tries to open iBooks using docController, which is a non persisting variable, so it crashes.
Hope this helps.
try this:
var docController: UIDocumentInteractionController?
if let path = NSBundle.mainBundle().pathForResource("book", ofType: "pdf") {
if let targetURL = NSURL.fileURLWithPath(path) {
docController = UIDocumentInteractionController(URL: targetURL)
let url = NSURL(string:"itms-books:");
if UIApplication.sharedApplication().canOpenURL(url!) {
docController!.presentOpenInMenuFromRect(CGRectZero, inView: self.view, animated: true)
println("iBooks is installed")
}else{
println("iBooks is not installed")
}
}
}
Swift 4.2
// Necessary property in UIViewController class or heir. If you're want move this
// to another class you're needing to create an additional property for UIView/UIViewController
var docController: UIDocumentInteractionController?
// Function for opening
func openDocument(name: String, type: String = "pdf", animated: Bool = true) {
guard let path = Bundle.main.path(forResource: name, ofType: type) else { return }
let targetURL = NSURL.fileURL(withPath: path)
docController = UIDocumentInteractionController(url: targetURL)
let url = NSURL(string:"itms-books:")
guard UIApplication.shared.canOpenURL(url! as URL) else { return }
// if the code will be not in UIView/UIViewController write here self.addedProperty2ViewController.view instead view
docController!.presentOpenInMenu(from: .zero, in: view, animated: animated)
}

Resources