Skip to content

Commit

Permalink
MOD: <ScreenShield> iOS13
Browse files Browse the repository at this point in the history
  • Loading branch information
RyukieSama committed Feb 28, 2022
1 parent 6c7023d commit 1df0c72
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
6 changes: 5 additions & 1 deletion Example/Swifty/OCScreenShieldViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ @interface OCScreenShieldViewController ()
@implementation OCScreenShieldViewController

- (void)loadView {
self.view = [ScreenShieldView createWithFrame:UIScreen.mainScreen.bounds];
if (@available(iOS 13.0, *)) {
self.view = [ScreenShieldView createWithFrame:UIScreen.mainScreen.bounds];
} else {
[super loadView];
}
}

- (void)viewDidLoad {
Expand Down
7 changes: 6 additions & 1 deletion Example/Swifty/ScreenShieldViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ import RyukieSwifty
class ScreenShieldViewController: UIViewController {

override func loadView() {
view = ScreenShieldView.create()
if #available(iOS 13.0, *) {
view = ScreenShieldView.create()
}
else {
super.loadView()
}
}

override func viewDidLoad() {
Expand Down
2 changes: 1 addition & 1 deletion Swifty/Classes/UIKit/UIView/View/ScreenShieldView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import UIKit

@available(iOS 10.0, *)
@available(iOS 13.0, *)
public class ScreenShieldView: UIView {
@objc
public static func create(frame: CGRect = .zero) -> ScreenShieldView {
Expand Down

0 comments on commit 1df0c72

Please sign in to comment.