Posts

Post not yet marked as solved
2 Replies
0 Views
Fortunately, I found a solution! A @MainActor static func showManageSubscriptions(in scene: UIWindowScene) async throws suspends the task until the user selects "Done" or "Cancel" in the manage subscription screen, so you can manually check the updated state in the next line. Task {     do { // The method suspends the execution until the user selects "Done" or "Cancel"         try await AppStore.showManageSubscriptions(in: view.window!.windowScene!) // The line is executed after dismissing the screen. You can check the latest state of your app's subscription, then update your UI.         await checkAndUpdateAppSubscriptionStateI()      } catch let storeKitEerror as StoreKitError { // Error handling      } }
Post marked as solved
2 Replies
0 Views
PS: I've updated my understanding. lineFragmentRect is rect that a layoutManager proposes lineFragment which the width as big as possible considering exclusionPaths. lineFragmentUsedRect is rect that the glyphs actually use.
Post marked as solved
2 Replies
0 Views
After few hours later, I cloud solve this question by myself. These are difference that my screenshots claim: ・lineFragmentRect ・lineFragmentUsedRect Please look at the right edge of red borders. These maxX and width are not equal. Assuming from this behavior, I understand that lineFragmentRect is rect for proposing line fragment in glyph layout process, and lineFragmentUsedRect is actual rect that the glyphs are filled, considering word wrap and hyphen factor. ・Code I used for investigation.     func addLineFragmentBorder(of text: String) {         let range = (textView.text as NSString).range(of: text)         let glyphRange = textView.layoutManager.glyphRange(forCharacterRange: range, actualCharacterRange: nil) // You can try the difference by changing `lineFragmentUsedRect` to `lineFragmentRect`.         let lineRect = textView.layoutManager.lineFragmentUsedRect(forGlyphAt: glyphRange.location, effectiveRange: nil)         let borderLayer = CALayer()         borderLayer.frame = .init(x: lineRect.minX, y: lineRect.minY + textView.textContainerInset.top, width: lineRect.width, height: lineRect.height)         borderLayer.borderColor = UIColor.red.cgColor         borderLayer.borderWidth = 2         borderLayer.backgroundColor = UIColor.clear.cgColor         textView.layer.addSublayer(borderLayer)     }
Post not yet marked as solved
1 Replies
0 Views
I had a same problem +1.
Post marked as solved
7 Replies
0 Views
I checked my app for catalyst runs well in macOS Big Sur 11 beta 7(20A5374g)!