Skip to content

Commit 17313e2

Browse files
committed
Merge branch 'fix_readme'
2 parents fc09d21 + 830bceb commit 17313e2

File tree

5 files changed

+16
-7
lines changed

5 files changed

+16
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class ViewController: UIViewController, ContainerControllerDelegate {
9292

9393
// Create ContainerController object, along with the container.view
9494
// Pass the current UIViewController
95-
container = ContainerController(addTo: self, layout: layout)
95+
let container = ContainerController(addTo: self, layout: layout)
9696
container.view.cornerRadius = 15
9797
container.view.addShadow()
9898

Sources/ContainerController/ContainerController.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import UIKit
1010

11+
@available(iOS 13.0, *)
1112
open class ContainerController: NSObject {
1213

1314
// MARK: Views
@@ -1090,6 +1091,7 @@ open class ContainerController: NSObject {
10901091

10911092
// MARK: - Gesture Delegate
10921093

1094+
@available(iOS 13.0, *)
10931095
extension ContainerController: UIGestureRecognizerDelegate {
10941096

10951097
public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
@@ -1100,6 +1102,7 @@ extension ContainerController: UIGestureRecognizerDelegate {
11001102

11011103
// MARK: - Table Delegate
11021104

1105+
@available(iOS 13.0, *)
11031106
extension ContainerController: UITableViewDelegate {
11041107

11051108
public func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
@@ -1119,6 +1122,7 @@ extension ContainerController: UITableViewDelegate {
11191122

11201123
// MARK: - Table DataSource
11211124

1125+
@available(iOS 13.0, *)
11221126
extension ContainerController: UITableViewDataSource {
11231127

11241128
public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
@@ -1151,6 +1155,7 @@ extension ContainerController: UITableViewDataSource {
11511155

11521156
// MARK: - Collection Delegate
11531157

1158+
@available(iOS 13.0, *)
11541159
extension ContainerController: UICollectionViewDelegate {
11551160

11561161
public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
@@ -1163,6 +1168,7 @@ extension ContainerController: UICollectionViewDelegate {
11631168

11641169
// MARK: - Collection DataSource
11651170

1171+
@available(iOS 13.0, *)
11661172
extension ContainerController: UICollectionViewDataSource {
11671173

11681174
public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
@@ -1182,6 +1188,7 @@ extension ContainerController: UICollectionViewDataSource {
11821188

11831189
// MARK: - Collection DelegateFlowLayout
11841190

1191+
@available(iOS 13.0, *)
11851192
extension ContainerController: UICollectionViewDelegateFlowLayout {
11861193

11871194
public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
@@ -1194,6 +1201,7 @@ extension ContainerController: UICollectionViewDelegateFlowLayout {
11941201

11951202
// MARK: - Scroll Delegate
11961203

1204+
@available(iOS 13.0, *)
11971205
extension ContainerController: UIScrollViewDelegate {
11981206

11991207
public func scrollViewDidScroll(_ scrollView: UIScrollView) {

Sources/ContainerController/ContainerControllerDelegate.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import UIKit
1010

11+
@available(iOS 13.0, *)
1112
public protocol ContainerControllerDelegate {
1213

1314
/// Reports rotation and orientation changes
@@ -21,6 +22,7 @@ public protocol ContainerControllerDelegate {
2122

2223
}
2324

25+
@available(iOS 13.0, *)
2426
public extension ContainerControllerDelegate {
2527

2628
func containerControllerRotation(_ containerController: ContainerController) {

Sources/ContainerController/ContainerDevice.swift

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import UIKit
1010

11+
@available(iOS 13.0, *)
1112
public extension ContainerDevice {
1213

1314
enum Orientation {
@@ -17,6 +18,7 @@ public extension ContainerDevice {
1718
}
1819
}
1920

21+
@available(iOS 13.0, *)
2022
open class ContainerDevice {
2123

2224
// MARK: - Size
@@ -62,12 +64,8 @@ open class ContainerDevice {
6264

6365
class public var statusBarHeight: CGFloat {
6466
var height: CGFloat = 0
65-
if #available(iOS 13.0, *) {
66-
let window = UIApplication.shared.windows.filter {$0.isKeyWindow}.first
67-
height = window?.windowScene?.statusBarManager?.statusBarFrame.height ?? 0
68-
} else {
69-
height = UIApplication.shared.statusBarFrame.height
70-
}
67+
let window = UIApplication.shared.windows.filter {$0.isKeyWindow}.first
68+
height = window?.windowScene?.statusBarManager?.statusBarFrame.height ?? 0
7169
return height
7270
}
7371

Sources/ContainerController/ContainerView.swift

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

99
import UIKit
1010

11+
@available(iOS 13.0, *)
1112
open class ContainerView: UIView {
1213

1314
public var contentView: UIView?

0 commit comments

Comments
 (0)