CopyPastor

Detecting plagiarism made easy.

Score: 0.8221628069877625; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2019-10-03
by Krunal Nagvadia

Original Post

Original - Posted on 2019-08-07
by isHidden



            
Present in both answers; Present only in the new answer; Present only in the old answer;

extension UIApplication { var statusBarUIView: UIView? { if #available(iOS 13.0, *) { let tag = 38482458385 if let statusBar = keyWindow?.viewWithTag(tag) { return statusBar } else { let statusBarView = UIView(frame: UIApplication.shared.statusBarFrame) statusBarView.tag = tag keyWindow?.addSubview(statusBarView) return statusBarView } } else if responds(to: Selector(("statusBar"))) { return value(forKey: "statusBar") as? UIView } else { return nil } } }
You can add some conditions or use first one. Just create some extension for UIApplication.
extension UIApplication { var statusBarUIView: UIView? { if #available(iOS 13.0, *) { let tag = 38482458385 if let statusBar = keyWindow?.viewWithTag(tag) { return statusBar } else { let statusBarView = UIView(frame: UIApplication.shared.statusBarFrame) statusBarView.tag = tag keyWindow?.addSubview(statusBarView) return statusBarView } } else if responds(to: Selector(("statusBar"))) { return value(forKey: "statusBar") as? UIView } else { return nil } } }

        
Present in both answers; Present only in the new answer; Present only in the old answer;