if #available(iOS 13.0, *) {
    let app = UIApplication.shared
    let statusBarHeight: CGFloat = app.statusBarFrame.size.height
    
    let statusbarView = UIView()
    statusbarView.backgroundColor = UIColor.red
    view.addSubview(statusbarView)
  
 statusbarView.translatesAutoresizingMaskIntoConstraints = false
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | protocol MovieListTableViewDelegate: class { | |
| func showMovieDetail(_ movie: Movie) | |
| } | |
| class MovieListTableViewDataSource: NSObject, UITableViewDataSource, UITableViewDelegate { | |
| private weak var delegate: MovieListTableViewDelegate? | |
| private let tableView: UITableView | |
| var movies: [Movie] = [] { | |
| didSet { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | - (UIViewController *)topViewController{ | |
| return [self topViewController:[UIApplication sharedApplication].keyWindow.rootViewController]; | |
| } | |
| - (UIViewController *)topViewController:(UIViewController *)rootViewController | |
| { | |
| if (rootViewController.presentedViewController == nil) { | |
| return rootViewController; | |
| } | |
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | extension UIViewController { | |
| func topMostViewController() -> UIViewController { | |
| if self.presentedViewController == nil { | |
| return self | |
| } | |
| if let navigation = self.presentedViewController as? UINavigationController { | |
| return navigation.visibleViewController.topMostViewController() | |
| } | |
| if let tab = self.presentedViewController as? UITabBarController { | |
| if let selectedTab = tab.selectedViewController { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // | |
| // ViewController.swift | |
| // PageViewController | |
| // | |
| // Created by Miguel Fermin on 5/8/17. | |
| // Copyright © 2017 MAF Software LLC. All rights reserved. | |
| // | |
| import UIKit | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import UIKit | |
| import XLPagerTabStrip | |
| class ProfileTabsVC: ButtonBarPagerTabStripViewController { | |
| //MARK: - Life Cycle | |
| override func viewDidLoad() { | |
| setupPager() | |
| super.viewDidLoad() | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) { | |
| let lastSectionIndex = tableView.numberOfSections - 1 | |
| let lastRowIndex = tableView.numberOfRows(inSection: lastSectionIndex) - 1 | |
| if indexPath.section == lastSectionIndex && indexPath.row == lastRowIndex { | |
| // print("this is the last cell") | |
| let spinner = UIActivityIndicatorView(activityIndicatorStyle: .gray) | |
| spinner.startAnimating() | |
| spinner.frame = CGRect(x: CGFloat(0), y: CGFloat(0), width: tableView.bounds.width, height: CGFloat(44)) | |
| self.tableView.tableFooterView = spinner | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import UIKit | |
| public extension UITableView { | |
| public func beginRefreshing() { | |
| // Make sure that a refresh control to be shown was actually set on the view | |
| // controller and the it is not already animating. Otherwise there's nothing | |
| // to refresh. | |
| guard let refreshControl = refreshControl, !refreshControl.isRefreshing else { | |
| return | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | func countLabelLines(label: UILabel) -> Int { | |
| // Call self.layoutIfNeeded() if your view uses auto layout | |
| let myText = label.text! as NSString | |
| let rect = CGSize(width: label.bounds.width, height: CGFloat.greatestFiniteMagnitude) | |
| let labelSize = myText.boundingRect(with: rect, options: .usesLineFragmentOrigin, attributes: [NSAttributedStringKey.font: label.font], context: nil) | |
| return Int(ceil(CGFloat(labelSize.height) / label.font.lineHeight)) | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | po String.init(data: response.data!, encoding: NSUTF8StringEncoding) | 
NewerOlder