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
### Fine tune UIView.pin.safeArea support for iOS 8 and "New Relic" framework
16
+
Changes:
17
+
18
+
* On iOS 8, PinLayout compatibility support of UIView.safeAreaInsetsDidChange was causing issues with the device's virtual keyboard. PinLayout still support UIView.pin.safeArea on this iOS release, but UIView.safeAreaInsetsDidChange won't be called on iOS 8
19
+
20
+
* Fix issue with "New Relic" framework: Add a Pin.initPinLayout() that can be called to initialize PinLayout before the "New Relic" framework is initialized. "New Relic" is conflicting with other popular frameworks including Mixpanel, ReactiveCocoa, Aspect, ..., and PinLayout. To fix the issue, Pin.initPinLayout() must be called BEFORE initializing "New Relic" with NewRelic.start(withApplicationToken:"APP_TOKEN"). See here for more information regarding this issue #130
21
+
22
+
Added by [Luc Dion](https://github.com/lucdion) in Pull Request [#134](https://github.com/mirego/PinLayout/pull/134)
Copy file name to clipboardExpand all lines: PinLayout.podspec
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@
8
8
9
9
Pod::Spec.newdo |spec|
10
10
spec.name="PinLayout"
11
-
spec.version="1.7.0"
11
+
spec.version="1.7.1"
12
12
spec.summary="Fast Swift Views layouting without auto layout. No magic, pure code, full control and blazing fast. [iOS/macOS/tvOS]"
13
13
spec.description="Fast Swift Views layouting without auto layout. No magic, pure code, full control and blazing fast. Concise syntax, intuitive, readable & chainable. [iOS/macOS/tvOS]"
Copy file name to clipboardExpand all lines: README.md
+17-16Lines changed: 17 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1039,7 +1039,7 @@ NOTE: In that in that particular situation, the same results could have been ach
1039
1039
<aname="safeAreaInsets"></a>
1040
1040
## UIKit safeAreaInsets support
1041
1041
1042
-
PinLayout can handle easily iOS 11 `UIView.safeAreaInsets`, but it goes further by supporting safeAreaInsets for previous iOS releases (including iOS 7/8/9/10) by adding a property `UIView.pin.safeArea`. PinLayout also extend the support of `UIView.safeAreaInsetsDidChange()` callback on iOS 7/8/9/10.
1042
+
PinLayout can handle easily iOS 11 `UIView.safeAreaInsets`, but it goes further by supporting safeAreaInsets for previous iOS releases (including iOS 7/8/9/10) by adding a property `UIView.pin.safeArea`. PinLayout also extends the support of `UIView.safeAreaInsetsDidChange()` callback on iOS 7/8/9/10.
1043
1043
1044
1044
##### Property:
1045
1045
@@ -1067,26 +1067,15 @@ The safe area of a view represent the area not covered by navigation bars, tab b
1067
1067
1068
1068
##### UIView.safeAreaInsetsDidChange():
1069
1069
1070
-
* iOS 11 has also introduced the method [`UIView.safeAreaInsetsDidChange()`](https://developer.apple.com/documentation/uikit/uiview/2891104-safeareainsetsdidchange) which is called when the safe area of the view changes. This method is called only when your app runs on a iOS 11 device. **PinLayout's extend that and support this method also on older iOS releases including iOS 7/8/9/10**.
1070
+
* iOS 11 has also introduced the method [`UIView.safeAreaInsetsDidChange()`](https://developer.apple.com/documentation/uikit/uiview/2891104-safeareainsetsdidchange) which is called when the safe area of the view changes. This method is called only when your app runs on a iOS 11 device. **PinLayout's extend that and support this method also on older iOS releases including iOS 9/10**.
1071
1071
1072
1072
* Note that if you handle the layout from `UIView.layoutSubviews()` or `UIViewController.viewDidLayoutSubviews()`, **you probably won't need to implement `safeAreaInsetsDidChange()`**. By default layout are invalidated and these methods are called when the safeAreaInsets changes.
You can control how PinLayout calls `UIView.safeAreaInsetsDidChange()` for iOS 7/8/9/10 (by default iOS 11 always calls this method).
1075
+
You can control how PinLayout calls `UIView.safeAreaInsetsDidChange()` for iOS 7/8/9/10 (by default iOS 11 natively calls this method).
1076
1076
1077
-
**The property `Pin.safeAreaInsetsDidChangeMode` supports two modes**:
1078
-
1. **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.
1079
-
1080
-
```swift
1081
-
class CustomerView: UIView, PinSafeAreaInsetsUpdate {
1082
-
override func safeAreaInsetsDidChange() {
1083
-
// This method will be called on iOS 11, but also on iOS 7/8/9/10
1084
-
// because the view implements the protocol PinSafeAreaInsetsUpdate
1085
-
}
1086
-
}
1087
-
```
1088
-
1089
-
2. **always**: In this mode, PinLayout will call your views `safeAreaInsetsDidChange()` method automatically for iOS releases 7/8/9/10.
* **always**: (Default mode) In this mode, PinLayout will call your views `safeAreaInsetsDidChange()` method automatically for iOS releases 7/8/9/10.
1090
1079
1091
1080
```swift
1092
1081
Pin.safeAreaInsetsDidChangeMode = .always
@@ -1099,6 +1088,18 @@ The safe area of a view represent the area not covered by navigation bars, tab b
1099
1088
}
1100
1089
}
1101
1090
```
1091
+
1092
+
* **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.
1093
+
1094
+
```swift
1095
+
class CustomerView: UIView, PinSafeAreaInsetsUpdate {
1096
+
override func safeAreaInsetsDidChange() {
1097
+
// This method will be called on iOS 11, but also on iOS 7/8/9/10
1098
+
// because the view implements the protocol PinSafeAreaInsetsUpdate
1099
+
}
1100
+
}
1101
+
```
1102
+
* **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