Posts

Post not yet marked as solved
0 Replies
747 Views
Hi, in my app I don't use PencilKit anywhere, yet I keep getting the following crash: Pencil Kit Crash.txt I don't even know where to start in debugging this. Could this be a bug within UIKit? It obviously only occurs in iPad devices and so far not in iOS16, but that may just be because of sample size. Do I need to handle touches differently for when a user uses an Apple Pen? Any help is appreciated. Thanks.
Posted Last updated
.
Post not yet marked as solved
0 Replies
1.1k Views
Hi, Using UITextInput, I'm gathering text from the keyboard to display in a custom text view. The user is only allowed to enter 10 characters in the lite version of my app and if that number is exceeded, the "shouldChangeTextInRange" method posts an alert asking the user to upgrade rather than insert the text in the text view. In iOS16, I'm noticing when I test with swipe typing and the character limit is exceeded, when I try to post the alert over the keyboard the app locks up and I get the following in the console: -[UIKeyboardTaskQueue lockWhenReadyForMainThread] timeout waiting for task on queue. Keyboard queue task timeout detected You can see what I mean in the following video: https://vimeo.com/752856336 The first part of the video is on the iOS15 simulator and it works, the alert pops up successfully. The second half is the iOS16 simulator where it freezes when I try to post the alert. I'm guessing that the suggestions toolbar that appears when you swipe type is what's causing this. Going to report this as a bug to Apple but was wondering if anyone might know a workaround for this? Thanks!
Posted Last updated
.
Post not yet marked as solved
1 Replies
1.2k Views
Hi, I have constructed a custom TextView built on CoreText for the purpose of allowing a user to enter text into odd shapes. In creating the CTTextFrame, I've noticed that when a new line character is added and a new line is created, the height of the new line is much smaller then the other lines. This is despite the fact that I'm adding the same font and size attributes to the newline character when I append it to the NSMutableAttributedString. Here is the code that's producing this: NSMutableAttributedString *textFramesetterText = [self.text mutableCopy]; //insert buffer area at the top and bottom of the rectangle [textFramesetterText insertAttributedString:@" \n" atIndex:0]; [textFramesetterText appendAttributedString:@"\n "]; CTFramesetterRef textFramesetter = CTFramesetterCreateWithAttributedString((__bridge CFMutableAttributedStringRef)textFramesetterText); //calculate the width and height based on the text CGFloat width = [self textFrameHeightForWidth: MaxTextWidth maxTextHeight:self.maxTextHeight textFramesetter:textFramesetter textFrameSetterText:textFramesetterText]; CGFloat height = [self textFrameWidthForHeight: size.height maxTextWidth:MaxTextWidth textFramesetter:textFramesetter textFrameSetterText:textFramesetterText]; CTFrameRef textFrame =  [self newTextFrameForFrame:CGRectMake(0,0,width,height) textFramesetter:textFramesetter]; self.textFrame = textFrame; CFRelease(textFrame); CFRelease(textFramesetter); I know this has been a issue with CTTextFrame for a long time and I'm wondering if there is any way to fix this. My workaround right now is to add a space after the newline character, but this can get messy. Any help would be appreciated. Thanks.
Posted Last updated
.
Post not yet marked as solved
2 Replies
828 Views
Hi, In my app, I have a custom text view so I've implemented the UITextInput protocol to help me gather text from the keyboard. I'm getting a strange memory leak when the method textInRange is called: - (NSString *)textInRange:(UITextRange *)range {     if (self.keyboardInputAccessoryMenuView)     {         IndexedRange *r = (IndexedRange *)range;         NSString *textString = self.labelView.labelTextView.text.string;                  if ([self rangeExists: r.range inString:textString])         {             return ([textString substringWithRange:r.range]);         }         else         {             return nil;         }     }     else     {         return nil;     } } "text" is an NSMutableAttributedString. The error exists at the following line: return ([textString substringWithRange:r.range]); This is the crash log I'm getting: Crashed: com.apple.main-thread 0  libsystem_platform.dylib       0x1e086f754 _platform_memmove + 340 1  CoreFoundation                 0x1942671cc __CFStringCreateImmutableFunnel3 + 2588 2  CoreFoundation                 0x19426b8a4 CFStringCreateWithSubstring + 524 3  CoreFoundation                 0x1941b24e0 -[__NSCFString substringWithRange:] + 164 4  Label Maker            0x102166604 -[LabelWindowView textInRange:] + 968 (LabelWindowView.m:968) 5  UIKit                          0x1e0b4bdb8 -[UITextInputUIResponderAccessibility accessibilityValue] + 172 6  UIAccessibility                0x1a85f7c40 -[NSObject(AXPrivCategory) _accessibilityPotentiallyAttributedValueForNonAttributedSelector:attributedSelector:] + 284 7  UIAccessibility                0x1a85f7ebc -[NSObject(AXPrivCategory) _accessibilityAXAttributedValue] + 48 8  UIAccessibility                0x1a85fdd10 -[NSObject(AXPrivCategory) _iosAccessibilityAttributeValue:] + 5516 9  UIAccessibility                0x1a862ebf8 _accessibilityAttributesForObject + 412 10 UIAccessibility                0x1a862e384 -[NSObject(UIAccessibilityAutomation) _accessibilityUserTestingSnapshotDescendantsWithAttributes:maxDepth:maxChildren:maxArrayCount:honorsModalViews:] + 888 11 UIAccessibility                0x1a862ff8c -[NSObject(UIAccessibilityAutomation) _accessibilityUserTestingSnapshotWithOptions:] + 1112 12 UIAccessibility                0x1a85fb8b0 -[NSObject(AXPrivCategory) _iosAccessibilityAttributeValue:forParameter:] + 11464 13 UIKit                          0x1e0abbae0 -[UIApplicationAccessibility _iosAccessibilityAttributeValue:forParameter:] + 308 14 UIAccessibility                0x1a85d6648 _copyParameterizedAttributeValueCallback + 408 15 AXRuntime                      0x1b3c50dd8 ___AXXMIGCopyParameterizedAttributeValue_block_invoke + 64 16 AXRuntime                      0x1b3c505e4 _handleNonMainThreadCallback + 68 17 AXRuntime                      0x1b3c50c60 _AXXMIGCopyParameterizedAttributeValue + 388 18 AXRuntime                      0x1b3c9f074 _XCopyParameterizedAttributeValue + 392 19 AXRuntime                      0x1b3c60200 mshMIGPerform + 272 20 CoreFoundation                 0x194245fe8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 60 21 CoreFoundation                 0x194245378 __CFRunLoopDoSource1 + 596 22 CoreFoundation                 0x19423f08c __CFRunLoopRun + 2360 23 CoreFoundation                 0x19423e21c CFRunLoopRunSpecific + 600 24 GraphicsServices               0x1abe0a784 GSEventRunModal + 164 25 UIKitCore                      0x196c7eee8 -[UIApplication _run] + 1072 26 UIKitCore                      0x196c8475c UIApplicationMain + 168 27 Label Maker            0x102140100 main + 15 (main.m:15) 28 libdyld.dylib                  0x193efe6b0 start + 4 This code in this function works most of the time, but occasionally I get this bug out of nowhere and can't recreate it. Can anyone offer any insight on this?
Posted Last updated
.
Post marked as solved
1 Replies
1k Views
Hi, I've recently added PHPicker to my app and have gotten some returns and low sales that may or may not be a result of the change and just want to make sure my implementation is correct. I'm concerned about the pickerDidFinishPicking function in particular. Here is my simple implementation that allows the user to select one image from their photo library: (void) presentPHPickerController {     PHPickerConfiguration *config = [[PHPickerConfiguration alloc] init];     config.filter = [PHPickerFilter imagesFilter];     PHPickerViewController *pickerViewController = [[PHPickerViewController alloc] initWithConfiguration:config];     pickerViewController.delegate = self;     [self.navigationController presentViewController:pickerViewController animated:YES completion:nil]; } (void) picker:(PHPickerViewController *)picker didFinishPicking:(NSArrayPHPickerResult * *)results {     PHPickerResult *result = [results firstObject];          if (result)     {        [result.itemProvider loadObjectOfClass:[UIImage class] completionHandler:^(__kindof idNSItemProviderReading  _Nullable object, NSError * _Nullable error)        {              dispatch_async(dispatch_get_main_queue(),             ^{                 [picker dismissViewControllerAnimated:YES completion:nil];                                   if (!error)                 {                     /*do something with the image*/                 }                 else                 {                     /*present alert*/                 }             });        }];     }     else     {         [picker dismissViewControllerAnimated:YES completion:nil];     } } My main concern is dismissing the picker on the main thread after the image has been loaded successfully. In most examples, I see people dismiss the picker at the very start of this function. I prefer to have the behavior where it gets dismissed after the user selects the photo however. Is there any issue with doing this? My other question is, if the loadObjectOfClass executes successfully without error, is it guarenteed there will be a UIImage in "object"? Thanks for the help.
Posted Last updated
.
Post not yet marked as solved
2 Replies
1.2k Views
On Monday, I had a major decrease in the people who bought my app via in app purchase. Normally, this would be a very rare result, an outlier that happens once in a blue moon. But I got the same result on Tuesday, and while Wednesday was better, I've noticed the overall rate at which people purchase the app per download has suddenly decreased significantly. It had been about a week since my most recent update and the app had been working fine. Since the decline, I've had no no complaints from the users about the app's functionality.I've really combed through the numbers and tested my app on all devices (except for the new full screen devices, but I'm going to buy one today) but have been unable to find the cause. I am wondering if anyone is experiencing similar issues? My only hope is that this has some thing to do with iOS12.3 and a change to StoreKit possibly as I noticed Monday was the date when 12.3 users started to pick up. Otherwise I'm completely lost as to what exactly is going on here. Any insight would be appreciated!
Posted Last updated
.