You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// This method will be called on iOS 11, but also on iOS 7/8/9/10
1087
-
// because "Pin.safeAreaInsetsDidChangeMode" has been set to ".always".
1088
-
if #available(iOS 11.0, *) {
1089
-
super.safeAreaInsetsDidChange()
1090
-
}
1091
-
...
1092
-
}
1093
-
}
1086
+
// This method will be called on iOS 11, but also on iOS 7/8/9/10
1087
+
// because "Pin.safeAreaInsetsDidChangeMode" has been set to ".always".
1088
+
if #available(iOS 11.0, *) {
1089
+
super.safeAreaInsetsDidChange()
1090
+
}
1091
+
...
1092
+
}
1093
+
}
1094
1094
```
1095
1095
1096
1096
* **optIn**: (Default mode) In this mode PinLayout will call your view's `safeAreaInsetsDidChange()` method only if the view implements the `PinSafeAreaInsetsUpdate` protocol. This ensure that PinLayout doesn't interfere with any source code that expect that `safeAreaInsetsDidChange()` is called only on iOS 11.
1097
1097
1098
1098
```swift
1099
+
Pin.safeAreaInsetsDidChangeMode = .optIn
1100
+
...
1101
+
1099
1102
class CustomerView: UIView, PinSafeAreaInsetsUpdate {
1100
1103
override func safeAreaInsetsDidChange() {
1101
-
// This method will be called on iOS 11, but also on iOS 7/8/9/10
1102
-
// because the view implements the protocol PinSafeAreaInsetsUpdate
1103
-
if #available(iOS 11.0, *) {
1104
-
super.safeAreaInsetsDidChange()
1105
-
}
1104
+
// This method will be called on iOS 11, but also on iOS 7/8/9/10
1105
+
// because the view implements the protocol PinSafeAreaInsetsUpdate
1106
+
if #available(iOS 11.0, *) {
1107
+
super.safeAreaInsetsDidChange()
1108
+
}
1106
1109
...
1107
-
}
1108
-
}
1110
+
}
1111
+
}
1109
1112
```
1110
1113
* **disable**: In this mode PinLayout won't call `UIView.safeAreaInsetsDidChange` on iOS 8/9/10. Note that this is the default mode on iOS 8.
0 commit comments