Posts

Post not yet marked as solved
0 Replies
121 Views
Starting with the macOS version 14.x.x and TextKit1, selecting multiple lines of text triggers a text replacement bug: some of the text on one of the selected lines inadvertently replaces a portion of the selected text. For example, the bug is exhibited when selecting the following lines: Carnaroli, Maratelli, or Vialone Nano are best Vialone Nano cooks quickly – watch it! It also absorbs condiments nicely. Avoid Baldo, Originario, Ribe and Roma To trigger the bug, select the three line paragraph using either the cursor or shift with arrow keys. Notice that a portion of the selected text was replaced. Command-Z to undo will allow you to repeat the undesired behavior. In this case, "e Nano cooks quickly - " is replaced by "Baldo, Originario, Ribe." This does not occur with all strings or selected strings, but in cases where it does occur, it is perfectly reproducible. It does not occur on iOS. Pasteboard contents are irrelevant. After triggering the bug repeatedly, at some point it stops occurring. Why does this bug occur? How can it be fixed? Here is some sample code to reproduce the issue. @end @implementation TestNoteViewController - (void)viewDidLoad { [super viewDidLoad]; [self createTextView]; } - (void)createTextView { NSAttributedString *attrString = [[NSAttributedString alloc] initWithString:self.note.text attributes:nil]; NSTextStorage *textStorage = [NSTextStorage new]; [textStorage appendAttributedString:attrString]; CGRect newTextViewRect = self.view.bounds; // Create the layout manager NSLayoutManager *layoutManager = [NSLayoutManager new]; [textStorage addLayoutManager:layoutManager]; // Create a text container NSTextContainer *container = [[NSTextContainer alloc] initWithSize:CGSizeMake(newTextViewRect.size.width, CGFLOAT_MAX)]; [layoutManager addTextContainer:container]; // Create and place a text view UITextView *textView = [[UITextView alloc] initWithFrame:newTextViewRect textContainer:container]; [self.view addSubview:textView]; textView.translatesAutoresizingMaskIntoConstraints = NO; UILayoutGuide *safeArea = textView.superview.safeAreaLayoutGuide; [textView.leadingAnchor constraintEqualToAnchor:safeArea.leadingAnchor].active = YES; [textView.trailingAnchor constraintEqualToAnchor:safeArea.trailingAnchor].active = YES; [textView.topAnchor constraintEqualToAnchor:safeArea.topAnchor].active = YES; [textView.bottomAnchor constraintEqualToAnchor:textView.superview.bottomAnchor].active = YES; } @end
Posted Last updated
.
Post not yet marked as solved
0 Replies
385 Views
What is the highest level of location precision achievable with the WeatherKit API? When latitude and longitude are given up to the fifth decimal place, the precision is around 1 meter. Could this ever be more accurate than providing the lat/long to the fourth decimal place, which has a precision of about 10 meters?
Posted Last updated
.
Post not yet marked as solved
20 Replies
4.7k Views
Sync between iOS and Mac Catalyst is intermitent. The fundamental issue is slow and inconsistent remote notifications being sent to and received by the Mac Catalyst app.When making changes in the Mac Catalyst app, those changes are successfully pushed to the iCloud private database and the iOS or iPadOS app successfully receives the remote notification indicating the change. In short, the MacOS -> iOS direction is seemless. When making changes in the other direction, we run into problems. A change in the iOS app successfully gets pushed up to the iCloud private database, and other iOS or iPadOS devices successfully receive the remote notification. However, Mac Catalyst apps most commonly will not receive the remote notification at all, or – occassionally – will receive it several minutes after the change took place. Rarely will the Mac Catalyst app receive the notification in a timeframe consistent with the performance of iOS apps (within 2-4 seconds).Why are Mac Catalyst apps having so much trouble receiving these CloudKit-triggered remote notifications? (Note that these issues are present in both development and production environments.)
Posted Last updated
.
Post marked as solved
1 Replies
833 Views
In attempting to deploy changes made in the development environment to the production environment, the confirmation dialogue shows that all Subscription Types are set to be deleted. Why? The Subscription Types are present in the development environment, and there appears to be no way to prevent deletion of the Subscription Types when deploying to production. As you might imagine, I'm worried deploying our changes will break cloud sync for everyone using our apps by invalidating subscriptions. What's going on here? How can I ensure that CloudKit subscriptions continue to work?
Posted Last updated
.
Post not yet marked as solved
0 Replies
617 Views
Is it possible to use the CKNotificationInfo's desiredKeys property for the CKDatabaseSubscription? I'd like to use have access to those values in the AppDelegate function... application:didReceiveRemoteNotification:fetchCompletionHandler: When I try to create subscriptions with desiredKeys, I get an error reading "cannot add additionalFields to this subscription type." Is that for real? Can we not use desiredKeys with CKDatabaseSubscriptions?
Posted Last updated
.
Post not yet marked as solved
0 Replies
589 Views
The desirable example is exhibited by the Apple Notes widgets. When adding an Apple Notes widget, WidgetKit goes ahead and assigns an IntentConfiguration to the new widget. You can see this by editing the widget and noticing that the selection element does not read "Choose" but instead includes the name of the note or folder that was automatically selected as default for the new widget. You'll also notice that this placeholder widget's data source does not change from one source to another – the assigned IntentConfiguration is respected. How can we do this in our Widgets? It should look like this: someone creates a new widget, we use their most recent data item for the placeholder, and that item is 1) persisted in the Widget until they change it 2) reflected in the edit widget dialogue.
Posted Last updated
.