Forgot - this is iOS 15.5, Xcode 13.4.1
Post
Replies
Boosts
Views
Activity
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.
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: ",")
}
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.)
Is the Calendars app utilizing UICalendarView?
I do need to support iOS 15 - so probably can't go that route.
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.
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.)
Thanks for your reply and code sample! Works for me!
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!!!
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