Skip to content

Drop iOS 14 Support: Address UIButton API deprecations (#1) - #20897

Merged
kean merged 7 commits into
trunkfrom
task/ios-15-remove-deprecated-uibutton-apis
Jun 19, 2023
Merged

Drop iOS 14 Support: Address UIButton API deprecations (#1)#20897
kean merged 7 commits into
trunkfrom
task/ios-15-remove-deprecated-uibutton-apis

Conversation

@kean

@kean kean commented Jun 16, 2023

Copy link
Copy Markdown
Contributor

Related Issue #20860

Replace a few places that were using deprecated UIButton APIs. Some of the code was dead, so I removed it.

To test:

Menus

  • Open Menus
  • Add a new menu
  • Verify that "Cancel" button is still there and is rendered correctly (before / after)

Notification Comment Details

  • This feature has been disabled since 2022, so you'll need to disable “Notification Comment Details” first
  • Open Notifications
  • Select a comment
  • Verify that action buttons are displayed

Regression Notes

  1. Potential unintended areas of impact:
  2. What I did to test those areas of impact (or what existing automated tests I relied on): manual testing
  3. What automated tests I added (or what prevented me from doing so): n/a

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding unit tests for my changes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.


[self.accessoryStackView addArrangedSubview:button];
[button setContentHuggingPriority:UILayoutPriorityDefaultHigh forAxis:UILayoutConstraintAxisHorizontal];
[button setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why hugging behavior changes with the new button configuration. I couldn't find any related documentation. I asked on Mastodon, and other folks also encountered it. The goal is to ensure the label on the right has a lower hugging priority.

[trashButton setImage:[UIImage gridiconOfType:GridiconTypeTrash] forState:UIControlStateNormal];
[trashButton addTarget:self action:@selector(trashButtonPressed) forControlEvents:UIControlEventTouchUpInside];
trashButton.backgroundColor = [UIColor clearColor];
trashButton.adjustsImageWhenHighlighted = YES;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is no-op because true is the default value. (Yes, it's deprecated in iOS 15).

@kean kean added this to the Pending milestone Jun 16, 2023
@kean
kean requested a review from momo-ozawa June 16, 2023 20:07
@wpmobilebot

wpmobilebot commented Jun 16, 2023

Copy link
Copy Markdown
Contributor
WordPress Alpha📲 You can test the changes from this Pull Request in WordPress Alpha by scanning the QR code below to install the corresponding build.
App NameWordPress Alpha WordPress Alpha
ConfigurationRelease-Alpha
Build Numberpr20897-44943c0
Version22.6
Bundle IDorg.wordpress.alpha
Commit44943c0
App Center BuildWPiOS - One-Offs #6025
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@wpmobilebot

Copy link
Copy Markdown
Contributor
Jetpack Alpha📲 You can test the changes from this Pull Request in Jetpack Alpha by scanning the QR code below to install the corresponding build.
App NameJetpack Alpha Jetpack Alpha
ConfigurationRelease-Alpha
Build Numberpr20897-44943c0
Version22.6
Bundle IDcom.jetpack.alpha
Commit44943c0
App Center Buildjetpack-installable-builds #5050
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@kean
kean merged commit 89ce632 into trunk Jun 19, 2023
@kean
kean deleted the task/ios-15-remove-deprecated-uibutton-apis branch June 19, 2023 12:22
@kean kean changed the title Drop iOS 14 Support: Migrate to UIButton.Configuration APIs (#1) Drop iOS 14 Support: Address UIButton API deprecations (#1) Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants