Post

Replies

Boosts

Views

Activity

UIActivityViewController saving 2 identical PDFs
I'm trying to simply save a PDF to the device using UIActivityViewController.I had to first create a temp item because if I just pass the PDF data, I don't have any way to change the name of the item.The code I'm using (below) is extremenly simple, however, whenever I save the PDF to the "Files" app on the device, I get 2 copies of it!Am I doing something wrong? Is this a bug?@objc func downloadPdfTapped() { if let fileURL = createTempPdfFile() { let activityVC = UIActivityViewController(activityItems: [fileURL], applicationActivities: nil) activityVC.excludedActivityTypes = [.assignToContact, .markupAsPDF] present(activityVC, animated: true, completion: nil) } else { print("\n\nERROR CREATING PDF\n\n") } } private func createTempPdfFile() -> URL? { let tempFile = "temp_statement.pdf" guard let tempFolder = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first else { return nil } self.tempFileURL = tempFolder.appendingPathComponent(tempFile) guard let currentFileURL = self.tempFileURL else { return nil } do { try pdfData.write(to: currentFileURL) return currentFileURL } catch { print(error.localizedDescription) return nil } }
1
0
1.6k
Jun ’20
Big Sur Beta 2 Locked MacBook Pro
Beta 2 came out yesterday and I decided to try and install it on my 16" MBP. When I chose to reboot after downloading and starting the installation, it booted me into the Recovery Assistant with the Activation Lock screen. It asks for my AppleID and password, no problem. BUT, it then tells me "This Mac is linked to a different Apple ID"! I have 3 possible Apple ID's that this Mac could be linked to, I tried ALL 3 and ALL 3 give me that same message. I called tech support this morning and was instructed to go into iCloud, find my, and "remove from account" this Mac. I did so for all 3 of my accounts, but still get the same message after rebooting the system. I even went to my "main" account, remotely locked the Mac (which worked) - and then unlocked it - BUT I STILL get that same message! I'd rather not have to go through the "alternative" process that tech support offered which is to submit my information to them, wait for 4 or 5 days, and have them manually fix whatever is broken in their system. This also involves WIPING the system - which I'd really rather not do. Has anyone else come across this issue? Did you get it fixed? If so, how? Help! I just wanna run Big Sur!
2
0
996
Jul ’20
Apple Silicon and UI tests
Several of our UI tests started failing when we switched over to M2 Macs... The issue with the affected tests seems to be that have a element.swipeLeft() in them, the swipeLeft doesn't seem to work the same... Is there a fix to the swipeLeft() issue yet? If not, is there an easy way to programmatically test if we are running on an Apple Silicon Mac? Any other ideas? Thank you!
2
0
791
Jul ’23