Post

Replies

Boosts

Views

Activity

Reply to Reading of Accessibility Label
I ended up doing this - taking that SKU/Product number - making it an array - then joining it back with a ',' so voice over pauses with each character. Not sure if this is the best practice - but it works for this case. So 4LN99 becomes 4,L,N,9,9 private func accessibilityProductCodeLabelText(_ productCode: String) -> String {         let productCodeArray = Array(productCode)         return productCodeArray.map { String($0) }.joined(separator: ",")     }
Oct ’22
Reply to Accessibility Trait or Hint for "Radio Buttons"
We ended up implementing it this way: "Delivery Method"; "Shipping, Radio Button, Unchecked, 1 of 2"; "Pickup, Radio Button, Checked, 2 of 2"; Thought it was important that the user knows how many of these "Radio Buttons" there are, and their status. (The "Checked" and "Unchecked" came from the web designers - which is how they implemented it.)
Oct ’22
Reply to Custom presentation container for UIDatePicker.inline triggered by UIDatePicker.compact
I ended up doing the following (hopefully you can view the attachment - the animated Gif isn't the smoothest). UITextFields made to look like UIDatePicker.compact. In the `textFieldShouldBeginEditing' delegate, make a call to display the UIDatePicker.inline display in the table cell below. (and return false so the keyboard doesn't show.) I used the built in UITableView animation to hide/show that row.
Topic: UI Frameworks SubTopic: UIKit Tags:
May ’23
Reply to Swift Package Manager "platforms" and Watch OS
I ended up doing this to files that used UIKit and WatchOS complained about them - not sure if this is the right way to do this - but I haven't heard any other solutions. #if !os(watchOS) import UIKit public class GenericButton: UIButton { .... } #endif And I also removed the StoryBoard that was in the package. And recreated the view programmatically (not optimal... But it works). A little background on the setup: This is a legacy (old) app - created back in 2016! It has a Watch Extension - pre-Swift UI - and co-existed with this Swift Package without an issue. I decided to finally convert the Watch App to SwiftUI. This is when it complained about the Swift Package that had UIKit elements in it. (This Watch App is dependent on the iPhone for its data still. My guess is that if the Watch App was built independent of the iPhone, then this Package wouldn't be an issue since the Package is embedded in the iPhone and not an independent watch app.)
Jul ’23
Reply to UIButton image not honoring dynamic type changes
I was able to get my image in the UIButton to size with the dynamic type changes by utilizing UIImage.SymbolConfiguration.init(font: font) For example - I am using SF Symbol image "checkmark.square.fill" for my Button's image. For it to resize - you need a SymbolConfiguration - I used the init(font:...) set up. let config = UIImage.SymbolConfiguration.init(font: UIFont.preferredFont(forTextStyle: .footnote)) let checkbox = UIImage(systemName: "checkmark.square.fill", withConfiguration: config) myButton.setImage(checkbox, for: .selected) myButton.adjustsImageSizeForAccessibilityContentSizeCategory = true
Topic: UI Frameworks SubTopic: UIKit Tags:
Feb ’24
Reply to Overuse of DispatchQueue.main.async?
Forgot - this is iOS 15.5, Xcode 13.4.1
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jul ’22
Reply to SwiftUI Preview not working in a large project
We've had to do that as well - make a temp/test project, do your code/layout/previews there - then copy/paste the code to the main project.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’22
Reply to Reading of Accessibility Label
I ended up doing this - taking that SKU/Product number - making it an array - then joining it back with a ',' so voice over pauses with each character. Not sure if this is the best practice - but it works for this case. So 4LN99 becomes 4,L,N,9,9 private func accessibilityProductCodeLabelText(_ productCode: String) -> String {         let productCodeArray = Array(productCode)         return productCodeArray.map { String($0) }.joined(separator: ",")     }
Replies
Boosts
Views
Activity
Oct ’22
Reply to Accessibility Trait or Hint for "Radio Buttons"
We ended up implementing it this way: "Delivery Method"; "Shipping, Radio Button, Unchecked, 1 of 2"; "Pickup, Radio Button, Checked, 2 of 2"; Thought it was important that the user knows how many of these "Radio Buttons" there are, and their status. (The "Checked" and "Unchecked" came from the web designers - which is how they implemented it.)
Replies
Boosts
Views
Activity
Oct ’22
Reply to Custom presentation container for UIDatePicker.inline triggered by UIDatePicker.compact
Is the Calendars app utilizing UICalendarView? I do need to support iOS 15 - so probably can't go that route.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
May ’23
Reply to Custom presentation container for UIDatePicker.inline triggered by UIDatePicker.compact
I ended up doing the following (hopefully you can view the attachment - the animated Gif isn't the smoothest). UITextFields made to look like UIDatePicker.compact. In the `textFieldShouldBeginEditing' delegate, make a call to display the UIDatePicker.inline display in the table cell below. (and return false so the keyboard doesn't show.) I used the built in UITableView animation to hide/show that row.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
May ’23
Reply to Swift Package Manager "platforms" and Watch OS
I ended up doing this to files that used UIKit and WatchOS complained about them - not sure if this is the right way to do this - but I haven't heard any other solutions. #if !os(watchOS) import UIKit public class GenericButton: UIButton { .... } #endif And I also removed the StoryBoard that was in the package. And recreated the view programmatically (not optimal... But it works). A little background on the setup: This is a legacy (old) app - created back in 2016! It has a Watch Extension - pre-Swift UI - and co-existed with this Swift Package without an issue. I decided to finally convert the Watch App to SwiftUI. This is when it complained about the Swift Package that had UIKit elements in it. (This Watch App is dependent on the iPhone for its data still. My guess is that if the Watch App was built independent of the iPhone, then this Package wouldn't be an issue since the Package is embedded in the iPhone and not an independent watch app.)
Replies
Boosts
Views
Activity
Jul ’23
Reply to Complications not rendering in Watch Series 9
Thanks for your reply and code sample! Works for me!
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Sep ’23
Reply to Can a Widget post a Local Notification?
I am happy to announce... it does work! A widget can post a local notification! The widget even presents the system dialog for notification permissions. Now we have widgets and notifications - let's see if our pull requests get closed sooner!!!
Replies
Boosts
Views
Activity
Jan ’24
Reply to UIButton image not honoring dynamic type changes
I was able to get my image in the UIButton to size with the dynamic type changes by utilizing UIImage.SymbolConfiguration.init(font: font) For example - I am using SF Symbol image "checkmark.square.fill" for my Button's image. For it to resize - you need a SymbolConfiguration - I used the init(font:...) set up. let config = UIImage.SymbolConfiguration.init(font: UIFont.preferredFont(forTextStyle: .footnote)) let checkbox = UIImage(systemName: "checkmark.square.fill", withConfiguration: config) myButton.setImage(checkbox, for: .selected) myButton.adjustsImageSizeForAccessibilityContentSizeCategory = true
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Feb ’24