mirror of
https://github.com/yattee/yattee.git
synced 2025-08-04 09:44:12 +00:00
Use Swift 5.7 if-let style
This commit is contained in:
@@ -11,7 +11,7 @@ import UIKit
|
||||
extension UIView {
|
||||
/// Returs frame in screen coordinates.
|
||||
var globalFrame: CGRect {
|
||||
if let window = window {
|
||||
if let window {
|
||||
return convert(bounds, to: window.screen.coordinateSpace)
|
||||
} else {
|
||||
return .zero
|
||||
|
@@ -31,7 +31,7 @@ final class ScrollViewMatcherViewController: UIViewController {
|
||||
private var scrollView: UIScrollView? {
|
||||
didSet {
|
||||
if oldValue != scrollView,
|
||||
let scrollView = scrollView
|
||||
let scrollView
|
||||
{
|
||||
onMatch(scrollView)
|
||||
}
|
||||
@@ -70,7 +70,7 @@ final class ScrollViewMatcherViewController: UIViewController {
|
||||
}
|
||||
|
||||
func matchUsingGeometry() {
|
||||
if let parent = parent {
|
||||
if let parent {
|
||||
if let scrollViewsInHierarchy: [UIScrollView] = parent.view.viewsInHierarchy() {
|
||||
// Return first match if only a single scroll view is found in the hierarchy.
|
||||
if scrollViewsInHierarchy.count == 1,
|
||||
|
Reference in New Issue
Block a user