Posts

Post not yet marked as solved
1 Replies
167 Views
So yesterday I noticed that some of images in my app stopped appearing. All of them were placed in the on-demand resources, that is I've assigned tags to them. Up until yesterday they were working correctly but since then whenever I try to load the assets I get the error message saying: Error Domain=NSCocoaErrorDomain Code=4099 "Connection invalidated to streaming unzip service." My code for loading the asset is pretty straightforward and it was working perfectly fine before: let resourceRequest = NSBundleResourceRequest(tags: ["vinyl"]) defer { resourceRequest.endAccessingResources() } do { if await !resourceRequest.conditionallyBeginAccessingResources() { try await resourceRequest.beginAccessingResources() } } catch { assertionFailure("Vinyl image was not available, error: \(error)") } I'm obviously using it in asynchronous context, but the old method which used completion handler gives me the same error. Has anyone encountered this issue as well? I just updated my devices to iOS 15.5, maybe that update broke on-demand resources? Tested on Xcode 13.4, iOS 15.5
Posted
by wiencheck.
Last updated
.
Post not yet marked as solved
0 Replies
527 Views
Up until iOS 15 it was possible to set maximum number of lines of the UIButton titleLabel property, but when UIButton.Configuration is used to configure button's properties setting the titleLabel?.numberOfLines to any value is always ignored and reset after assigning text to configuration. See the short piece of code below: import UIKit let button = UIButton(configuration: .plain()) button.titleLabel?.numberOfLines = 1 print("Lines: \(button.titleLabel?.numberOfLines ?? 999)") // <- prints "Lines: 1" var buttonConfiguration = button.configuration buttonConfiguration?.title = "Any text" button.configuration = buttonConfiguration print("Lines: \(button.titleLabel?.numberOfLines ?? 999)") // <- prints "Lines: 0" Even if you set the numberOfLines to 1 it is ignored and the button renders one, or more lines of text. I think it's a bug, there is no compiler warning about accessing the titleLabel property, as there is with imageEdgeInsets for example. If you access that one Xcode gives you a warning 'imageEdgeInsets' was deprecated in iOS 15.0: This property is ignored when using UIButtonConfiguration If modifying titleLabel directly there should be a warning as well, but if that's the case, the UIButton.Configuration is seriously lacking some features, like setting maximum number of lines, or even a font (this can be done via AttributedString but setting font is so common that constructing AttrbitutedString every time the title is changed feels so wrong and unnecessary) For the time being I'm forced to use the legacy button customisation
Posted
by wiencheck.
Last updated
.