Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand All @@ -64,3 +64,5 @@ fastlane/screenshots
.DS_Store
examples/.DS_Store
examples/Sample/.DS_Store

Sample.xcworkspace/
12 changes: 6 additions & 6 deletions FileBrowser/FBFile.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
4 changes: 2 additions & 2 deletions FileBrowser/FileListSearch.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions FileBrowser/FileListTableView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down
4 changes: 2 additions & 2 deletions FileBrowser/PreviewTransitionViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

}
2 changes: 1 addition & 1 deletion examples/Sample/Sample/Supporting Files/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down