Skip to content

Commit af36127

Browse files
author
Luc Dion
committed
Update documentation
1 parent 2b5de4e commit af36127

File tree

3 files changed

+34
-17
lines changed

3 files changed

+34
-17
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,22 @@
77

88
# Change Log
99

10+
11+
12+
## [1.7.1](https://github.com/layoutBox/FlexLayout/releases/tag/1.7.1)
13+
Released on 2018-04-23
14+
15+
### 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)
23+
24+
25+
1026
## [1.7.0](https://github.com/layoutBox/FlexLayout/releases/tag/1.7.0)
1127
Released on 2018-04-20
1228

PinLayout.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Pod::Spec.new do |spec|
1010
spec.name = "PinLayout"
11-
spec.version = "1.7.0"
11+
spec.version = "1.7.1"
1212
spec.summary = "Fast Swift Views layouting without auto layout. No magic, pure code, full control and blazing fast. [iOS/macOS/tvOS]"
1313
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]"
1414
spec.homepage = "https://mirego.github.io/PinLayout/"

README.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,7 +1039,7 @@ NOTE: In that in that particular situation, the same results could have been ach
10391039
<a name="safeAreaInsets"></a>
10401040
## UIKit safeAreaInsets support
10411041

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.
10431043

10441044
##### Property:
10451045

@@ -1067,26 +1067,15 @@ The safe area of a view represent the area not covered by navigation bars, tab b
10671067

10681068
##### UIView.safeAreaInsetsDidChange():
10691069

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**.
10711071

10721072
* 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.
10731073

10741074
* **Controlling PinLayout UIView.safeAreaInsetsDidChange() calls:**
1075-
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).
10761076

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.
1077+
**The property `Pin.safeAreaInsetsDidChangeMode` supports 3 modes**:
1078+
* **always**: (Default mode) In this mode, PinLayout will call your views `safeAreaInsetsDidChange()` method automatically for iOS releases 7/8/9/10.
10901079

10911080
```swift
10921081
Pin.safeAreaInsetsDidChangeMode = .always
@@ -1099,6 +1088,18 @@ The safe area of a view represent the area not covered by navigation bars, tab b
10991088
}
11001089
}
11011090
```
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.
11021103
11031104
<br>
11041105

0 commit comments

Comments
 (0)