-
Notifications
You must be signed in to change notification settings - Fork 121
Fix 'contentEdgeInsets' was deprecated in iOS 15.0 #8094
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
iamgabrielma
merged 21 commits into
trunk
from
task/contentedgeinsets-deprecated-ios-15
Nov 24, 2022
Merged
Changes from 19 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
4f2f048
Use UIButton.Configuration on CustomerNote cell
iamgabrielma 2e3a9e8
Update applyLinkButtonStyle() with UIButton.Configuration
iamgabrielma 13ebacd
Update edgeInsets SurveySubmittedViewController
iamgabrielma f5f359b
Update edgeInsets applySecondaryButtonStyle
iamgabrielma 4a66349
Update paymentsModalCancelButtonStyle edgeInsets
iamgabrielma 3635604
Comment-out calls to pinSubviewToAllEdgeMargins
iamgabrielma 3fb5e8f
Use Button Configuration on applying button style
iamgabrielma 84eba80
Revert testing button backgrounds
iamgabrielma 5450244
Add Configuration to applyLinkButtonStyle
iamgabrielma 028beb1
revert testing button configuration
iamgabrielma fa02ba8
Add Button Configuration to VerticalButton
iamgabrielma ad6678a
Add ButtonConfiguration to EmptyStateViewController
iamgabrielma bc3c27e
Add ButtonConfiguration to CustomerNoteTableViewCell
iamgabrielma 7490c9f
Add ButtonConfiguration to FilteredOrdersHeaderBar
iamgabrielma 1a40698
Add Configuration to SurveySubmittedViewController
iamgabrielma dba89ac
Add label as subview to UIButton
iamgabrielma cf68aa2
Remove unnecessary var
iamgabrielma 87d67d8
Add label as subview on UIActivityIndicatorView
iamgabrielma 3fb678b
Change CustomerNote button configuration to plain
iamgabrielma a6df43f
Rename constants for readability
iamgabrielma db0bd1d
Removed custom init from ButtonActivityIndicator
iamgabrielma File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,10 +10,7 @@ class VerticalButton: UIButton { | |
|
|
||
| override func awakeFromNib() { | ||
| super.awakeFromNib() | ||
|
|
||
| contentEdgeInsets = Settings.edgeInsets | ||
| layer.cornerRadius = Settings.cornerRadius | ||
| titleLabel?.font = UIFont.footnote | ||
| configureButton() | ||
| } | ||
|
|
||
| override func layoutSubviews() { | ||
|
|
@@ -42,6 +39,18 @@ class VerticalButton: UIButton { | |
| width: titleSize.width, | ||
| height: titleSize.height).integral | ||
| } | ||
|
|
||
| private func configureButton() { | ||
| var configuration = UIButton.Configuration.filled() | ||
| configuration.contentInsets = .init( | ||
| top: .zero, | ||
| leading: Settings.horizontalEdgeInsets, | ||
| bottom: .zero, | ||
| trailing: Settings.horizontalEdgeInsets | ||
| ) | ||
| layer.cornerRadius = Settings.cornerRadius | ||
| titleLabel?.font = UIFont.footnote | ||
| } | ||
| } | ||
|
|
||
|
|
||
|
|
@@ -51,7 +60,7 @@ private extension VerticalButton { | |
|
|
||
| enum Settings { | ||
| static let cornerRadius = CGFloat(10) | ||
| static let edgeInsets = UIEdgeInsets(top: 5, left: 0, bottom: 5, right: 0) | ||
| static let horizontalEdgeInsets = CGFloat(5) | ||
|
||
| static let labelPaddingTop = CGFloat(2) | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -93,7 +93,9 @@ private extension SurveySubmittedViewController { | |||||
|
|
||||||
| contactUsButton.applyLinkButtonStyle() | ||||||
| contactUsButton.titleLabel?.applyCalloutStyle() | ||||||
| contactUsButton.contentEdgeInsets = .zero | ||||||
| var contactUsconfiguration = UIButton.Configuration.plain() | ||||||
|
||||||
| var contactUsconfiguration = UIButton.Configuration.plain() | |
| var contactUsConfiguration = UIButton.Configuration.plain() |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: since now it's a single value instead of
UIEdgeInsetstype, should we rename both constants to something likeInsetorPadding?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely! That reads much better. Changed on a6df43f along with the other nits 🙇