diff --git a/.gitignore b/.gitignore index 4eec927..0b19947 100644 --- a/.gitignore +++ b/.gitignore @@ -43,7 +43,7 @@ playground.xcworkspace # you should judge for yourself, the pros and cons are mentioned at: # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control # -# Pods/ +Pods/ # Carthage # @@ -64,3 +64,5 @@ fastlane/screenshots .DS_Store examples/.DS_Store examples/Sample/.DS_Store + +Sample.xcworkspace/ diff --git a/FileBrowser/FBFile.swift b/FileBrowser/FBFile.swift index ff3869d..6ca9006 100644 --- a/FileBrowser/FBFile.swift +++ b/FileBrowser/FBFile.swift @@ -11,17 +11,17 @@ import Foundation /// FBFile is a class representing a file in FileBrowser @objc open class FBFile: NSObject { /// Display name. String. - @objc open let displayName: String + @objc public let displayName: String // is Directory. Bool. - open let isDirectory: Bool + public let isDirectory: Bool /// File extension. - open let fileExtension: String? + public let fileExtension: String? /// File attributes (including size, creation date etc). - open let fileAttributes: NSDictionary? + public let fileAttributes: NSDictionary? /// NSURL file path. - open let filePath: URL + public let filePath: URL // FBFileType - open let type: FBFileType + public let type: FBFileType open func delete() { diff --git a/FileBrowser/FileListSearch.swift b/FileBrowser/FileListSearch.swift index ede8f3a..c808be2 100644 --- a/FileBrowser/FileListSearch.swift +++ b/FileBrowser/FileListSearch.swift @@ -12,11 +12,11 @@ extension FileListViewController: UISearchBarDelegate, UISearchControllerDelegat // MARK: UISearchControllerDelegate func willPresentSearchController(_ searchController: UISearchController) { - self.tableView.contentInset = UIEdgeInsetsMake(20, 0, 0, 0) + self.tableView.contentInset = UIEdgeInsets.init(top: 20, left: 0, bottom: 0, right: 0) } func willDismissSearchController(_ searchController: UISearchController) { - self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0) + self.tableView.contentInset = UIEdgeInsets.init(top: 0, left: 0, bottom: 0, right: 0) } // MARK: UISearchBarDelegate diff --git a/FileBrowser/FileListTableView.swift b/FileBrowser/FileListTableView.swift index 2caba43..d4ff3ea 100644 --- a/FileBrowser/FileListTableView.swift +++ b/FileBrowser/FileListTableView.swift @@ -86,13 +86,13 @@ extension FileListViewController: UITableViewDataSource, UITableViewDelegate { return collation.section(forSectionIndexTitle: index) } - func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) { - if (editingStyle == UITableViewCellEditingStyle.delete) { + func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) { + if (editingStyle == UITableViewCell.EditingStyle.delete) { let selectedFile = fileForIndexPath(indexPath) selectedFile.delete() prepareData() - tableView.reloadSections([indexPath.section], with: UITableViewRowAnimation.automatic) + tableView.reloadSections([indexPath.section], with: UITableView.RowAnimation.automatic) } } diff --git a/FileBrowser/PreviewTransitionViewController.swift b/FileBrowser/PreviewTransitionViewController.swift index a2c5e28..c314db4 100644 --- a/FileBrowser/PreviewTransitionViewController.swift +++ b/FileBrowser/PreviewTransitionViewController.swift @@ -18,10 +18,10 @@ class PreviewTransitionViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() - self.addChildViewController(quickLookPreviewController) + self.addChild(quickLookPreviewController) containerView.addSubview(quickLookPreviewController.view) quickLookPreviewController.view.frame = containerView.bounds - quickLookPreviewController.didMove(toParentViewController: self) + quickLookPreviewController.didMove(toParent: self) } } diff --git a/examples/Sample/Sample/Supporting Files/AppDelegate.swift b/examples/Sample/Sample/Supporting Files/AppDelegate.swift index 5be52d3..5479e87 100644 --- a/examples/Sample/Sample/Supporting Files/AppDelegate.swift +++ b/examples/Sample/Sample/Supporting Files/AppDelegate.swift @@ -14,7 +14,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. self.populateTableViewWithFiles()