Posts

Post not yet marked as solved
8 Replies
4.7k Views
I've run into an issue where a PDF that is correctly rendered disappears when switching to a different tab and then back to the original controller. The issue is easily reproducible using Xcode 10.1's Tabbed App template. I created a project using this template, and then placed the following code in SecondViewController (after removing the default subviews added by the template):import UIKit import WebKit class SecondViewController: UIViewController { private lazy var webView: WKWebView = { let view = WKWebView() view.translatesAutoresizingMaskIntoConstraints = false return view }() override func viewDidLoad() { super.viewDidLoad() view.addSubview(webView) webView.topAnchor.constraint(equalTo: view.topAnchor).isActive = true webView.rightAnchor.constraint(equalTo: view.rightAnchor).isActive = true webView.bottomAnchor.constraint(equalTo: view.bottomAnchor).isActive = true webView.leftAnchor.constraint(equalTo: view.leftAnchor).isActive = true let url = URL(string: "https://www.adobe.com/support/products/enterprise/knowledgecenter/media/c4611_sample_explain.pdf")! webView.load(URLRequest(url: url)) } }When launching the app and switching to the second tab, the PDF renders correctly. Then, after switching back to the first tab and then back to the second it shows just a gray background with no PDF content. You can still scroll through the document and it will show page numbers, etc. But no content.Any help or suggestions would be appreciated.
Posted
by SeanG.
Last updated
.
Post not yet marked as solved
0 Replies
507 Views
Simple question. I know this has been asked before but the iOS 14/2020 WWDC videos seem to imply things have changed. I want a Siri intent to gather a parameter via voice for me. The generalized use case is that I want Siri to understand a command and pass me the trailing parameters. E.g.: "Hey Siri, create new task 'My Task'" I want this to invoke an intent and pass the "My Task" (string) parameter value to my handler. I know previously this was not possible. But the WWDC 2020 example projects (e.g. Recipe Assistant) seem to imply parameters can be passed via voice. However, nothing I do will enable Siri to pass me a parameter from the voice command. When creating a shortcut for this intent there are obvious placeholders for variables- but they are not recognized. Is this still not possible? Siri already translates trailing parameters to text. Siri shows it when trying to search. Is it really true this translation will not be passed when attempting to invoke an intent- still? Or am I simply missing something? I hope so.
Posted
by SeanG.
Last updated
.
Post not yet marked as solved
2 Replies
701 Views
I'm attempting to utilize the new sandbox testing announced 9/9/2020. I'm most interested in the ability to test cancellation, renewal, etc of an auto renewing subscription by following the instructions here: https://developer.apple.com/documentation/storekit/in-app_purchase/testing_in-app_purchases_with_sandbox But a number of things don't jive: The documentation indicates there should be a Sandbox Account section on the device in Settings > Apple ID, iCloud, iTunes & App Store. This is not the case for me. I simply don't have that section. I do, however, have a Sandbox Account section in Settings > App Store. I can successfully sign in my sandbox account here. I'm able to then make sandbox purchases just fine. But, when I tap on the sandbox account I get the option to Manage it. I would expect this is where I could test cancellation, resubscribing, etc. But all it does is present a page that says "Cannot Connect" with a Retry button. One thing I'm unclear about is whether I should verify the sandbox testing account I created. Apple sent an email asking me to, but I'm afraid if I sign in at id.apple.com it will disable the sandbox features. I'm running the app via Xcode 12 beta 6. My test device is running iOS 14 beta (18A5373a). The instructions seem straightforward. But I feel like I've missed something simple as I cannot find other folks reporting the same issue after the announcement that this is available. Any help would be appreciated as the cancellation, renewal, etc process has been a black box to develope against until now.
Posted
by SeanG.
Last updated
.
Post not yet marked as solved
0 Replies
905 Views
I would like to do two things:Utilize iOS's robust document preview capabilities as demonstrated by classes like QLPreviewController.Be able to provide my own UIActivityViewController when previewing the document. Or somehow have the ability to add/remove activities presented by any default activity sheet.As far as I can tell, via research and experimentation, is that this just isn't possible. But that seems crazy to me. I'm aware of options like QLPreviewController and UIDocumentInteractionController (which seems to just use QLPreviewController to actually preview the document). Both of these options result in an action bar button that presents a UIActivityViewController which cannot be customized at all. The other options are:WKWebView. But WKWebView is kind of buggy when it comes to rendering these things and doesn't support the full range of documents that QLPreviewController does.PDFView. This seems to work fine for PDFs, but obviously the whole point is to support a wide array of documents.It seems so odd to me that it's not possible to combine the document preview capabilities inherint in iOS while also being able to customize the presented sharing options. They're not at all related. I'm hoping I've just missed something simple. Any guidance would be appreciated.PS. I've discovered that subclassing QLPreviewController, pushing it onto a nav controller, and overriding the navigationItem property to supply my own navigation item and action bar button seems to meet these requirements. But, that can't be Apple's intended method by which my goal is achieved. It seems/almost certainly is a hack that I'd like to avoid.
Posted
by SeanG.
Last updated
.