Post

Replies

Boosts

Views

Activity

Accessibility Inspector Bugs
Hello, i'm currently working on improving accessibility in my app using the built-in Xcode tool, Accessibility Inspector. For the most part, it works well — it correctly displays warnings about missing button labels or insufficient touch target sizes. However, it does not seem to handle certain cases properly, particularly dynamic fonts. Here is the approach I’m using for dynamic fonts: static func getDynamic(font: FontType, size: CGFloat, textStyle: UIFont.TextStyle) -> UIFont { let customFont = UIFont(name: font.rawValue, size: size)! return UIFontMetrics(forTextStyle: textStyle).scaledFont(for: customFont) } label.adjustsFontForContentSizeCategory = true My labels are configured with: numberOfLines = 0 no fixed height constraints This allows them to expand as needed without clipping. I have tested this visually on multiple devices, and everything appears to work correctly — fonts scale as expected, and text is not truncated. However, Accessibility Inspector still reports issues related to dynamic type and, in some cases, text clipping. On iOS 18, approximately 40% of the fonts configured this way still trigger warnings about missing dynamic type support, even though they scale correctly. On iOS 26+, the issue becomes consistent — every font in the app triggers this warning. There are no cases where the inspector passes without reporting a problem, despite the UI behaving correctly in practice. So my question is: Is there a known way to resolve this? Could this be an issue with Apple's tools? If so, is there any information on when it might be fixed?
1
1
175
23h
Determine which SIM is used to access the Internet
Initially, my task was to determine which type of connection is being used at the moment: 5G or 4G. And I found "CTTelephonyNetworkInfo().serviceCurrentRadioAccessTechnology" but there is a problem when the device has more than one sim. My iPhone has two sims, one physical and one electronic. I need to determine which one is used to access the network. I tried to use "CTTelephonyNetworkInfo().serviceCurrentRadioAccessTechnology" but it is a dictionary [String: String] that only indicates the connection of each of the cards, and it is not possible to find out which one is active from this dictionary. So how can I determine which of the two cards are currently being used to access the Internet?
3
0
1.1k
May ’24
Error when I try to instantiate @Model
I'm trying to instantiate my model and I'm getting an error on the set first property import Foundation import SwiftData @Model final class PointModel { var x: CGFloat var y: CGFloat init( x: CGFloat, y: CGFloat ) { self.x = x self.y = y } } extension PointModel { static var preview: PointModel { PointModel(x: 0, y: 0) } } let point = PointModel(x: location.x, y: location.y) { get { _$observationRegistrar.access(self, keyPath: \.x) return self.getValue(for: \.x) } set { _$observationRegistrar.withMutation(of: self, keyPath: \.x) { self.setValue(for: \.x, to: newValue) **Thread 1: Fatal error: Illegal attempt to use a nil as an Attribute - x + 151.0** } } } Has anyone else experienced this problem? Maybe someone knows how to solve this?
2
0
1.3k
Aug ’23
Accessibility Inspector Bugs
Hello, i'm currently working on improving accessibility in my app using the built-in Xcode tool, Accessibility Inspector. For the most part, it works well — it correctly displays warnings about missing button labels or insufficient touch target sizes. However, it does not seem to handle certain cases properly, particularly dynamic fonts. Here is the approach I’m using for dynamic fonts: static func getDynamic(font: FontType, size: CGFloat, textStyle: UIFont.TextStyle) -> UIFont { let customFont = UIFont(name: font.rawValue, size: size)! return UIFontMetrics(forTextStyle: textStyle).scaledFont(for: customFont) } label.adjustsFontForContentSizeCategory = true My labels are configured with: numberOfLines = 0 no fixed height constraints This allows them to expand as needed without clipping. I have tested this visually on multiple devices, and everything appears to work correctly — fonts scale as expected, and text is not truncated. However, Accessibility Inspector still reports issues related to dynamic type and, in some cases, text clipping. On iOS 18, approximately 40% of the fonts configured this way still trigger warnings about missing dynamic type support, even though they scale correctly. On iOS 26+, the issue becomes consistent — every font in the app triggers this warning. There are no cases where the inspector passes without reporting a problem, despite the UI behaving correctly in practice. So my question is: Is there a known way to resolve this? Could this be an issue with Apple's tools? If so, is there any information on when it might be fixed?
Replies
1
Boosts
1
Views
175
Activity
23h
Determine which SIM is used to access the Internet
Initially, my task was to determine which type of connection is being used at the moment: 5G or 4G. And I found "CTTelephonyNetworkInfo().serviceCurrentRadioAccessTechnology" but there is a problem when the device has more than one sim. My iPhone has two sims, one physical and one electronic. I need to determine which one is used to access the network. I tried to use "CTTelephonyNetworkInfo().serviceCurrentRadioAccessTechnology" but it is a dictionary [String: String] that only indicates the connection of each of the cards, and it is not possible to find out which one is active from this dictionary. So how can I determine which of the two cards are currently being used to access the Internet?
Replies
3
Boosts
0
Views
1.1k
Activity
May ’24
Error when I try to instantiate @Model
I'm trying to instantiate my model and I'm getting an error on the set first property import Foundation import SwiftData @Model final class PointModel { var x: CGFloat var y: CGFloat init( x: CGFloat, y: CGFloat ) { self.x = x self.y = y } } extension PointModel { static var preview: PointModel { PointModel(x: 0, y: 0) } } let point = PointModel(x: location.x, y: location.y) { get { _$observationRegistrar.access(self, keyPath: \.x) return self.getValue(for: \.x) } set { _$observationRegistrar.withMutation(of: self, keyPath: \.x) { self.setValue(for: \.x, to: newValue) **Thread 1: Fatal error: Illegal attempt to use a nil as an Attribute - x + 151.0** } } } Has anyone else experienced this problem? Maybe someone knows how to solve this?
Replies
2
Boosts
0
Views
1.3k
Activity
Aug ’23