-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNeed+UIViewController.swift
69 lines (54 loc) · 1.83 KB
/
Need+UIViewController.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//
// Need+UIViewController.swift
// Needs
//
// Created by Jérôme Alves on 23/12/2020.
// Copyright © 2020 Needs. All rights reserved.
//
#if os(iOS) || os(tvOS)
import Foundation
import UIKit
extension Need where EnclosingSelf: UIViewController {
#if os(iOS)
public static var statusBarAppearanceUpdate: Need<EnclosingSelf> {
Need { $0.setNeedsStatusBarAppearanceUpdate() }
}
@available(iOS 11.0, *)
public static var updateOfHomeIndicatorAutoHidden: Need<EnclosingSelf> {
Need { $0.setNeedsUpdateOfHomeIndicatorAutoHidden() }
}
@available(iOS 11.0, *)
public static var updateOfScreenEdgesDeferringSystemGestures: Need<EnclosingSelf> {
Need { $0.setNeedsUpdateOfScreenEdgesDeferringSystemGestures() }
}
@available(iOS 14.0, *)
public static var updateOfPrefersPointerLocked: Need<EnclosingSelf> {
Need { $0.setNeedsUpdateOfPrefersPointerLocked() }
}
#endif
#if os(tvOS)
@available(tvOS 11.0, *)
public static var userInterfaceAppearanceUpdate: Need<EnclosingSelf> {
Need { $0.setNeedsUserInterfaceAppearanceUpdate() }
}
#endif
public static var focusUpdate: Need<EnclosingSelf> {
Need { $0.setNeedsFocusUpdate() }
}
// MARK: - View Needs
public static var viewDisplay: Need<EnclosingSelf> {
Need { $0.viewIfLoaded?.setNeedsDisplay() }
}
public static var viewLayout: Need<EnclosingSelf> {
Need { $0.viewIfLoaded?.setNeedsLayout() }
}
public static var updateViewConstraints: Need<EnclosingSelf> {
Need { $0.viewIfLoaded?.setNeedsUpdateConstraints() }
}
}
extension Need where EnclosingSelf: UITableViewController {
public static var reloadData: Need<EnclosingSelf> {
Need { $0.tableView.reloadData() }
}
}
#endif