Skip to content

Commit

Permalink
fix warning: 'contentEdgeInsets' was deprecated in iOS 15.0 (#308)
Browse files Browse the repository at this point in the history
  • Loading branch information
tony-yun authored Oct 23, 2023
1 parent 0964edf commit 5d3f8b3
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@ public class CoachMarkSkipDefaultView: UIButton, CoachMarkSkipView {
sendSubviewToBack(bodyBackground)
bodyBackground.fillSuperview()

contentEdgeInsets = UIEdgeInsets(top: 10.0, left: 15.0, bottom: 10.0, right: 15.0)
if #available(iOS 15, *) {
var config = UIButton.Configuration.plain()
config.contentInsets = NSDirectionalEdgeInsets(top: 10.0, leading: 15.0, bottom: 10.0, trailing: 15.0)
self.configuration = config
} else {
contentEdgeInsets = UIEdgeInsets(top: 10.0, left: 15.0, bottom: 10.0, right: 15.0)
}
sizeToFit()
}

Expand Down

0 comments on commit 5d3f8b3

Please sign in to comment.