Posts

Post not yet marked as solved
3 Replies
319 Views
Hi there, I wanted to make a UILabel with a gradient as its text color, and its fairly easy doing it like this: let gradientImage = ... // Create a Gradient image using CAGradientLayer label.textColor = UIColor(patternImage: gradientImage) Problem is that as soon as I set this pattern image color, the UILabel is not accessible anymore. So isAccessibilityElement is set to false and I have no way of changing this back. The issue doesn't lie in the gradientImage, as using any other image as the patternImage for the textColor results in the same issue. Did anyone else experience this before and knows a way around this? Thanks, Klemens
Posted Last updated
.
Post not yet marked as solved
1 Replies
519 Views
Hi there, when awaiting a message through an GroupSessionMessenger, I can get the Participant who sent the message through the context.source. But is there any way to get the actual name of that Participant? I haven't seen any way - but I guess it would have to go through the Contacts API? The reason I need this is because of the VoiceOver support in my app. If a Participant triggers an interaction, I would like to announce who triggered the interaction instead of just announcing "Someone did XY". Best, Klemens
Posted Last updated
.
Post not yet marked as solved
1 Replies
489 Views
Hi there, I'm currently trying to implement SharePlay for one of my apps. Thanks to session wwdc21-10187, most of it went pretty smoothly. But at the end of the video, Adam talks about how to change activities and that's where I now struggle. He says that it is the preferred way to just replace the GroupActivity and demonstrates it for the reset button of the DrawTogether app. But this causes some behavior in iOS 15.1 that I would rather avoid. Let's say we have a FaceTime call with two participants, A and B and use the DrawTogether app. A starts the GroupActivity. If A now resets the canvas, a notification stating Started Draw Together will appear for both users. This is not super nice, but I could live with that. But if B wants to reset the canvas, B will see an alert that states: Replace Draw Together? This will end the existing SharePlay activity and start a new one , with the option to "Replace Existing" or "Cancel". This will most likely throw the user B off - B just wanted to clean the canvas and stay in the same session (they shouldn't even need to think about sessions) So my question is - Is changing the GroupActivity by replacing it still the preferred way if we want to have a clean slate? And if it is, how can I get rid of that alert that B sees? This is probably possible by actually doing the replacement through A (so through the GroupActivity "creator/owner"), but as far as I saw it in the documentation, there is currently no way to get that "owner", right? To give a bit more context - I have an app where participants go through lessons together. They do not care about the history of completed lessons, every lesson should start from a clean slate. Through interaction, any participant could trigger the progression to the next lesson and so it is pretty distracting if this progression is interrupted by the aforementioned alert. BTW: The code example is great, but as someone already noted over here, it does not compile since the API changed a bit (currently on iOS 15.1, but it was already broken before that). Thanks! Klemens
Posted Last updated
.
Post not yet marked as solved
0 Replies
238 Views
Hi there, I have a question about printing under Big Sur. We are offering support for a bunch of custom paper formats, updating the NSPrintInfo by creating a custom PMPaper, creating a PMPageFormat, setting it to the printInfo and then calling updateFromPMPageFormat. This worked perfectly fine over the years, but has stopped working under Big Sur. The print preview in the NSPrintPanel is still displaying the resulting file correctly and saving it as PDF also gives us a file with correctly sized pages. But since Big Sur, printers we've tried fail to print on custom sized paper from our app. The error seems to indicate that the printer thinks the file is in A4. Interestingly, the printSettings of NSPrintInfo now holds has a value of "A4" for the key com_apple_print_PageToPaperMappingMediaName. There is no documentation around that key though and I can't seem to figure out where its coming from in the first place. Also can't see any API changes we would need to adapt to for Big Sur. Any ideas what we're doing wrong here?
Posted Last updated
.
Post not yet marked as solved
0 Replies
263 Views
Hi there, I have a question about creating new scenes via drag and drop. Let's say I have an app with a custom view that goes edge to edge. The view is split horizontally in 10 equally sized containers, where each container holds multiple items. Items can be moved in between the containers with an UIDragInteraction/UIDropInteraction. If I want t see the details of an item, I tap on it to get a popover. So far the dummy app. Now say I want to add multi-scene support to the app and allow creating a new window that shows the details of an item by dragging it to the far left or far right part of the screen. As soon as I allow this (by adding an URL representation of the dragged item with my custom URL scheme), I am not able to drag items anymore to the leftmost or to the rightmost container. As soon as I'm closer than ~75px to either edge, the system thinks I want to create a new scene as a popover. Is there any way to thin down that threshold of ~75px? Or any other way to tell the system that this drag is still relevant to the underlying UI and no window should be created yet? My assumption is that there is no way to adjust it, but I hope I'm wrong here. It would be a shame to remove the feature to create new scenes via DnD, but with that big of a threshold, it seems to be impractical for my app. Best, Klemens
Posted Last updated
.
Post marked as solved
2 Replies
449 Views
Hi there, I'm currently playing around with Scribble and ran into an odd behavior. Let's say I have an app where I can scribble on a canvas. After scribble has finished, a custom view with a textView should appear and the scribbled text should be forwarded to the textView. Depending on where I wrote on the canvas, additional info is forwarded to the view and put in as a prefix for the textView. That at least was the idea. To implement this, I've added a UIIndirectScribbleInteraction to the canvas and implemented the UIIndirectScribbleInteractionDelegate. When the focus is requested through indirectScribbleInteraction:focusElementIfNeeded:referencePoint:completion:, I bring up the custom view, insert the prefix based on the referencePoint into the textView, make it become firstResponder and hand over the textView in the completion block. Now since the appearance of that custom view is pretty disruptive, I return true for indirectScribbleInteraction:shouldDelayFocusForElement:. And here is where the problem starts. As soon as I do that, the scribble input is always inserted at the start of the textView, so in front of my prefix. If I do not delay the focus and insert my prefix, the scribble input is correctly appended after the prefix. I do not fully understand why delaying the focus should change the behavior here. Scribble always only gets to know the target textView through calling the completion of indirectScribbleInteraction:focusElementIfNeeded:referencePoint:completion:, and before completion is called, the prefix is inserted. So I feel like scribble should be able to see that there is already text inside that textView and append its text, instead of inserting it into the front. I would welcome any clarification on my issue :) Thanks, Klemens
Posted Last updated
.
Post marked as solved
1 Replies
709 Views
Hey,I have a question to the following scenario: We have a `UNUserNotification` that is scheduled for a certain date. The content of this notification might be subject to change as we get closer to its delivery. We now want to have a way to wake up (not earlier then a certain interval), refetch content and if something change, update/reschedule the Notification. We thought of using the BackgroundTasks to do it.My question is:Which type of task is the right one to use here? Or shouldn't we use the BackgroundTasks framework for this at all?Problem with `BGAppRefreshTask`: My understanding was that the `BGAppRefreshTask` is scheduled intelengently before the app ususually is woken up by the user. So using it for refreshing a something that won't be followed by an app launch seems wrong.Problem with 'BGProcessingTask': We do not need any heavy processing for our task. But I guess the system will think that we will need to do heavy processing since it is a `BGProcessingTask` and schedule it only if the system has a downtime. Also, just to be clear once and for all: Can there be only one `BGAppRefreshTask` for the app at a time? It kinda makes sense, but it isn't stated anywhere explicitly. Thanks,Klemens
Posted Last updated
.
Post not yet marked as solved
4 Replies
1.5k Views
Hey,I've made a playground book with an first page that just features the title, an note (that sound needs to be enabeld) and a link to the next page. There is a space between the note and the link and one after the link, so the user can click there to enter some text. Is there any way to make this whole page non-editable? Best,Klemens
Posted Last updated
.
Post not yet marked as solved
0 Replies
309 Views
Hey,for any UIDragDropSession, there is an method to get the location of the session within an view (aka the position of your finger during the drag). Is there also a way to get the area the dragession currently covers? I could calculate that myself, but for that I would need the position of the sessions location in the UIDragPreview and the scaling of the UIDragPreview. The position and the scaling are altered automatically by the system if the dragged preview is too large and I haven't found a way to access them.Best,Klemens
Posted Last updated
.
Post not yet marked as solved
1 Replies
502 Views
Hey,during my drag, I need to update the UIDragPreview of the dragged item depending on it's location. I'm currently doing that by setting a new previewProvider each time the preview needs to be updated. When doing this, the current preview gets scaled down a little bit and the new one scales up, which looks a bit weird.Is there a better way to update the DragPreview? Or is there at least a way to get rid of the scaling?Best,Klemens
Posted Last updated
.
Post not yet marked as solved
4 Replies
642 Views
Hey,I'm currently working on implementing dragging an custom view, which has a button spanned over it. Starting the drag works without any problem because this requires a long press on the view. Problems arise if I want to add another custom view to this drag session via tapping onto it. Tapping on the view will automatically trigger the UIControlEventTouchUpInside event of the button and thus, the dragInteraction:itemsForAddingToSession:withTouchAtPoint: will never be called. Is there any way to kinda give the UIDragAddItemsGesture a higher priority over the UIControlEventTouchUpInside of the button?
Posted Last updated
.