Post

Replies

Boosts

Views

Activity

HStack required to get columns in a Grid
I've looked at lots of Grid examples. I've seen it documented that views within a GridRow are treated as if they were in an HStack. That's not happening for me. I have to explicitly put them into an HStack or they are treated as new rows. Here's my code: @State private var gridRows : Int = 4 @State private var gridCols : Int = 2 @State private var myItems : [Int] = Array(0...8) var body: some View { Group { if myItems.count > 0 { ScrollView([.vertical]) { Grid(alignment: .leading) { ForEach(0..<gridRows, id: \.self) { rowNdx in GridRow { HStack // <<--- { ForEach(0..<gridCols, id: \.self) { colNdx in Text("\(rowNdx) \(colNdx)") } } } } } } } } } With the HStack I get (as expected). 0 0 0 1 1 0 1 1 2 0 2 1 3 0 3 1 Without the HStack I get 0 0 0 1 1 0 1 1 ... What have I done wrong?
Topic: UI Frameworks SubTopic: SwiftUI
2
0
376
Nov ’24
PushKit (fileProvider) calling didInvalidatePushTokenFor instead of didUpdate (credentials)
I think I've got all the keys and entitlements set up ok. I have no problem receiving normal alerts via the UNUserNotifications framework. Now I'm trying to use PushKit (for fileProvider). I have the following in my AppDelegate fileProvider = PKPushRegistry(queue: nil) fileProvider.delegate = self fileProvider.desiredPushTypes = [.fileProvider] along with the required delegate functions. I am never provided with credentials, only an immediate call to the didInvalidatePushToken delegate. Any suggestions appreciated.
0
0
995
Apr ’24
UITableView editing broken in iOS 17
I have a dynamic table with 2 sections; 5 rows in the top section and the rest in the second section. I have only the drag handles editing enabled. In earlier versions of iOS, when a row is dragged into the top section from the lower section, it forces a row to move from the end of the top section into the bottom section (so that the top section remains at 5 rows). In iOS17, this no longer happens. The top section (which is specified as 5 rows in the numberOfRowsInSection delegate method) now has 6 rows. Similar problem if rows are dragged out of the top section. It shrinks rather than bringing in a row from the section below it. I will open a formal report on this. Barry
2
0
646
Sep ’23
How to force a dot for decimal pad
I have a UITextField that I am using to enter IP Addresses. I am using the Decimal Pad keyboard for this field.IP Addresses are dotted-decimal in all regions (to best of my knowledge). I want to force the "decimal" on the pad to be DOT regardless of region. I have searched here and found several bug reports, but no answer.On another site I saw a recommendation to subclass UITextField to deliver a UITextInputMode.primaryLanguage that keeps DOT. I found that UITextField does call for UITextInputMode, but it never queries the "primaryLanguage" of that mode (so overriding it doesn't help).I've also seen some reports that say that the decimal is determined by the Region rather than the language (and I don't know how to override region for a UITextField).How do I make the decimal stay a DOT for UITextField? Thanks!
Topic: UI Frameworks SubTopic: UIKit Tags:
9
0
12k
May ’22
error: The WKWatchOnly key must be present in your WatchKit extension's Info.plist, not the WatchKit app's.
I am receiving the subject error when building my watch-only app to install on my actual watch via iPhone. It does not occur when building for the simulator. This is Xcode 13 so the Info.plist isn't a separate file anymore. Indeed, this key is present in both places, but I didn't add it there and to my knowledge I can't remove it. Any Help appreciated. All operating systems at latest levels. Barry
0
0
683
Feb ’22
HStack required to get columns in a Grid
I've looked at lots of Grid examples. I've seen it documented that views within a GridRow are treated as if they were in an HStack. That's not happening for me. I have to explicitly put them into an HStack or they are treated as new rows. Here's my code: @State private var gridRows : Int = 4 @State private var gridCols : Int = 2 @State private var myItems : [Int] = Array(0...8) var body: some View { Group { if myItems.count > 0 { ScrollView([.vertical]) { Grid(alignment: .leading) { ForEach(0..<gridRows, id: \.self) { rowNdx in GridRow { HStack // <<--- { ForEach(0..<gridCols, id: \.self) { colNdx in Text("\(rowNdx) \(colNdx)") } } } } } } } } } With the HStack I get (as expected). 0 0 0 1 1 0 1 1 2 0 2 1 3 0 3 1 Without the HStack I get 0 0 0 1 1 0 1 1 ... What have I done wrong?
Topic: UI Frameworks SubTopic: SwiftUI
Replies
2
Boosts
0
Views
376
Activity
Nov ’24
PushKit (fileProvider) calling didInvalidatePushTokenFor instead of didUpdate (credentials)
I think I've got all the keys and entitlements set up ok. I have no problem receiving normal alerts via the UNUserNotifications framework. Now I'm trying to use PushKit (for fileProvider). I have the following in my AppDelegate fileProvider = PKPushRegistry(queue: nil) fileProvider.delegate = self fileProvider.desiredPushTypes = [.fileProvider] along with the required delegate functions. I am never provided with credentials, only an immediate call to the didInvalidatePushToken delegate. Any suggestions appreciated.
Replies
0
Boosts
0
Views
995
Activity
Apr ’24
UITableView editing broken in iOS 17
I have a dynamic table with 2 sections; 5 rows in the top section and the rest in the second section. I have only the drag handles editing enabled. In earlier versions of iOS, when a row is dragged into the top section from the lower section, it forces a row to move from the end of the top section into the bottom section (so that the top section remains at 5 rows). In iOS17, this no longer happens. The top section (which is specified as 5 rows in the numberOfRowsInSection delegate method) now has 6 rows. Similar problem if rows are dragged out of the top section. It shrinks rather than bringing in a row from the section below it. I will open a formal report on this. Barry
Replies
2
Boosts
0
Views
646
Activity
Sep ’23
How to force a dot for decimal pad
I have a UITextField that I am using to enter IP Addresses. I am using the Decimal Pad keyboard for this field.IP Addresses are dotted-decimal in all regions (to best of my knowledge). I want to force the "decimal" on the pad to be DOT regardless of region. I have searched here and found several bug reports, but no answer.On another site I saw a recommendation to subclass UITextField to deliver a UITextInputMode.primaryLanguage that keeps DOT. I found that UITextField does call for UITextInputMode, but it never queries the "primaryLanguage" of that mode (so overriding it doesn't help).I've also seen some reports that say that the decimal is determined by the Region rather than the language (and I don't know how to override region for a UITextField).How do I make the decimal stay a DOT for UITextField? Thanks!
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
9
Boosts
0
Views
12k
Activity
May ’22
error: The WKWatchOnly key must be present in your WatchKit extension's Info.plist, not the WatchKit app's.
I am receiving the subject error when building my watch-only app to install on my actual watch via iPhone. It does not occur when building for the simulator. This is Xcode 13 so the Info.plist isn't a separate file anymore. Indeed, this key is present in both places, but I didn't add it there and to my knowledge I can't remove it. Any Help appreciated. All operating systems at latest levels. Barry
Replies
0
Boosts
0
Views
683
Activity
Feb ’22