Post

Replies

Boosts

Views

Activity

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
Feb ’24
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 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.
May ’23
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