Post

Replies

Boosts

Views

Activity

Reply to We were unable to review your app as it crashed on launch.
Take a look at your app's deployment target and make sure you're not using new api features below this target level. For example if you're targeting iOS 13 but using features specific to only iOS 15 only meant for iOS 15 and you're not testing on an iOS 13 device. Those type of scenarios. But looking at the report above you are having an issue with your main storyboard file.
Nov ’21
Reply to App crashes (UIGraphicsImageRenderer, PDF to images with PDFKit)
Seeing you're producing any UI view or controllers meant for the main thread, you can run code in a background thread and just pass ima back to the main thread or write it a local disk. import UIKit import PDFKit func extractImage(completion: @escaping ((UIImage)->Void)) {     guard let path = Bundle.main.path(forResource: "filename", ofType: "pdf") else { return }     let url = URL(fileURLWithPath: path)     // Instantiate a `CGPDFDocument` from the PDF file's URL.     guard let document = PDFDocument(url: url) else { return }     // Get the first page of the PDF document.     guard let page = document.page(at: 0) else { return }     // Fetch the page rect for the page we want to render.     let pageRect = page.bounds(for: .mediaBox)     let renderer = UIGraphicsImageRenderer(size: pageRect.size)     let img = renderer.image { ctx in         // Set and fill the background color.         UIColor.white.set()         ctx.fill(CGRect(x: 0, y: 0, width: pageRect.width, height: pageRect.height))         // Translate the context so that we only draw the `cropRect`.         ctx.cgContext.translateBy(x: -pageRect.origin.x, y: pageRect.size.height - pageRect.origin.y)         // Flip the context vertically because the Core Graphics coordinate system starts from the bottom.         ctx.cgContext.scaleBy(x: 1.0, y: -1.0)         // Draw the PDF page.         page.draw(with: .mediaBox, to: ctx.cgContext)     }          DispatchQueue.main.async {         completion(img)     } } DispatchQueue.global().async {     // call extract on a global Q     extractImage { image in         // Return UIImage on main thread              } }
Topic: UI Frameworks SubTopic: UIKit Tags:
Nov ’21
Reply to Reference to currently active window
import UIKit extension UIApplication {     var topViewController: UIViewController? {         var topViewController: UIViewController? = nil         if #available(iOS 13, *) {             topViewController = connectedScenes.compactMap {                 return ($0 as? UIWindowScene)?.windows.filter { $0.isKeyWindow  }.first?.rootViewController             }.first         } else {             topViewController = keyWindow?.rootViewController         }         if let presented = topViewController?.presentedViewController {             topViewController = presented         } else if let navController = topViewController as? UINavigationController {             topViewController = navController.topViewController         } else if let tabBarController = topViewController as? UITabBarController {             topViewController = tabBarController.selectedViewController         }         return topViewController     } } // handle any checks for any custom contollers outside of extension if let controller = UIApplication.shared.topViewController as? CPTViewController { } There is no need for the loop, waste of cpu cycles.
Topic: UI Frameworks SubTopic: UIKit Tags:
Nov ’21
Reply to M1 MacBook Pro Trackpad not clicking
This seems to be a problem with Monterey. I have noticed at times the click area sometimes is unresponsive, the cursor will move halfway across the screen or the UI doesn't respond to the first click. Wait and see what happens when 15.1 is release or you might have a swollen battery causing the track pad issue.
Topic: App & System Services SubTopic: Hardware Tags:
Nov ’21
Reply to IPhone 12 Pro Max gaming terrible
You will also have better luck contacting the developer of the game via their own support channels and not here.
Topic: App & System Services SubTopic: Hardware Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to XCode 12: 'Application windows are expected to have a root view controller at the end of application launch'
Just means your initial view controller is failing to initialize properly and hence this relationship is nil. window.rootViewController = viewController Check your storyboard connections, check the target main window is also referring to the main storyboard, check the connections in the storyboard, etc ...
Replies
Boosts
Views
Activity
Aug ’21
Reply to Closure containing a declaration cannot be used with result builder 'ViewBuilder'
If you have something on that line move it down one line.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to We were unable to review your app as it crashed on launch.
Please check all story boards resources.
Replies
Boosts
Views
Activity
Nov ’21
Reply to We were unable to review your app as it crashed on launch.
Take a look at your app's deployment target and make sure you're not using new api features below this target level. For example if you're targeting iOS 13 but using features specific to only iOS 15 only meant for iOS 15 and you're not testing on an iOS 13 device. Those type of scenarios. But looking at the report above you are having an issue with your main storyboard file.
Replies
Boosts
Views
Activity
Nov ’21
Reply to Crash only on ios15
1 You're crashing on a background thread 2 This looks like it is calling a UI framework component that is meant for the main thread on the very same back thread inside a closure passed to the background thread.
Replies
Boosts
Views
Activity
Nov ’21
Reply to How to debug non-return or compute function?
Did the shader complete calling all of the routines on another thread?
Topic: Graphics & Games SubTopic: Metal Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to App crashes (UIGraphicsImageRenderer, PDF to images with PDFKit)
...
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to App crashes (UIGraphicsImageRenderer, PDF to images with PDFKit)
Seeing you're producing any UI view or controllers meant for the main thread, you can run code in a background thread and just pass ima back to the main thread or write it a local disk. import UIKit import PDFKit func extractImage(completion: @escaping ((UIImage)->Void)) {     guard let path = Bundle.main.path(forResource: "filename", ofType: "pdf") else { return }     let url = URL(fileURLWithPath: path)     // Instantiate a `CGPDFDocument` from the PDF file's URL.     guard let document = PDFDocument(url: url) else { return }     // Get the first page of the PDF document.     guard let page = document.page(at: 0) else { return }     // Fetch the page rect for the page we want to render.     let pageRect = page.bounds(for: .mediaBox)     let renderer = UIGraphicsImageRenderer(size: pageRect.size)     let img = renderer.image { ctx in         // Set and fill the background color.         UIColor.white.set()         ctx.fill(CGRect(x: 0, y: 0, width: pageRect.width, height: pageRect.height))         // Translate the context so that we only draw the `cropRect`.         ctx.cgContext.translateBy(x: -pageRect.origin.x, y: pageRect.size.height - pageRect.origin.y)         // Flip the context vertically because the Core Graphics coordinate system starts from the bottom.         ctx.cgContext.scaleBy(x: 1.0, y: -1.0)         // Draw the PDF page.         page.draw(with: .mediaBox, to: ctx.cgContext)     }          DispatchQueue.main.async {         completion(img)     } } DispatchQueue.global().async {     // call extract on a global Q     extractImage { image in         // Return UIImage on main thread              } }
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to Is it possible to find the room of an Apple TV ?
The Apple TV must be part of a HMHome object first, then it should be locatable under rooms of the associated HMHome Object. https://developer.apple.com/documentation/homekit/hmhome
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to Reference to currently active window
import UIKit extension UIApplication {     var topViewController: UIViewController? {         var topViewController: UIViewController? = nil         if #available(iOS 13, *) {             topViewController = connectedScenes.compactMap {                 return ($0 as? UIWindowScene)?.windows.filter { $0.isKeyWindow  }.first?.rootViewController             }.first         } else {             topViewController = keyWindow?.rootViewController         }         if let presented = topViewController?.presentedViewController {             topViewController = presented         } else if let navController = topViewController as? UINavigationController {             topViewController = navController.topViewController         } else if let tabBarController = topViewController as? UITabBarController {             topViewController = tabBarController.selectedViewController         }         return topViewController     } } // handle any checks for any custom contollers outside of extension if let controller = UIApplication.shared.topViewController as? CPTViewController { } There is no need for the loop, waste of cpu cycles.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to Crypto rewards app
No. if the app offers no value other than spam ads.
Replies
Boosts
Views
Activity
Nov ’21
Reply to M1 MacBook Pro Trackpad not clicking
This seems to be a problem with Monterey. I have noticed at times the click area sometimes is unresponsive, the cursor will move halfway across the screen or the UI doesn't respond to the first click. Wait and see what happens when 15.1 is release or you might have a swollen battery causing the track pad issue.
Topic: App & System Services SubTopic: Hardware Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to M1 MacBook Pro Trackpad not clicking
That should be macOS 12.1
Topic: App & System Services SubTopic: Hardware Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to how to extract text messages - financial service app
I also work for a financial institution and good luck with that request. I can tell you now no such information is extractable unless you design for the user to provide it. Let alone why will a financial institution wan't access to text messages???
Topic: Privacy & Security SubTopic: General Tags:
Replies
Boosts
Views
Activity
Nov ’21