Merge pull request #34 from brendan09/swift4
Swift4 syntax & fix compilation issue
This commit is contained in:
@@ -259,11 +259,11 @@
|
||||
TargetAttributes = {
|
||||
344169531C67812400B93D28 = {
|
||||
CreatedOnToolsVersion = 7.2.1;
|
||||
LastSwiftMigration = 0800;
|
||||
LastSwiftMigration = 0900;
|
||||
};
|
||||
3441695D1C67812400B93D28 = {
|
||||
CreatedOnToolsVersion = 7.2.1;
|
||||
LastSwiftMigration = 0800;
|
||||
LastSwiftMigration = 0900;
|
||||
ProvisioningStyle = Manual;
|
||||
};
|
||||
};
|
||||
@@ -463,7 +463,8 @@
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 3.0;
|
||||
SWIFT_SWIFT3_OBJC_INFERENCE = On;
|
||||
SWIFT_VERSION = 4.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -482,7 +483,8 @@
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.roymarmelstein.FileBrowser;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_VERSION = 3.0;
|
||||
SWIFT_SWIFT3_OBJC_INFERENCE = On;
|
||||
SWIFT_VERSION = 4.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
@@ -494,7 +496,8 @@
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.roymarmelstein.FileBrowserTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 3.0;
|
||||
SWIFT_SWIFT3_OBJC_INFERENCE = On;
|
||||
SWIFT_VERSION = 4.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -506,7 +509,8 @@
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.roymarmelstein.FileBrowserTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 3.0;
|
||||
SWIFT_SWIFT3_OBJC_INFERENCE = On;
|
||||
SWIFT_VERSION = 4.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
|
||||
@@ -48,12 +48,14 @@ open class FileBrowser: UINavigationController {
|
||||
/// - initialPath: NSURL filepath to containing directory.
|
||||
/// - allowEditing: Whether to allow editing.
|
||||
/// - showCancelButton: Whether to show the cancel button.
|
||||
public convenience init(initialPath: URL = FileParser.sharedInstance.documentsURL(), allowEditing: Bool = false, showCancelButton: Bool = true) {
|
||||
let fileListViewController = FileListViewController(initialPath: initialPath, showCancelButton: showCancelButton)
|
||||
public convenience init(initialPath: URL? = nil, allowEditing: Bool = false, showCancelButton: Bool = true) {
|
||||
|
||||
let validInitialPath = initialPath ?? FileParser.sharedInstance.documentsURL()
|
||||
|
||||
let fileListViewController = FileListViewController(initialPath: validInitialPath, showCancelButton: showCancelButton)
|
||||
fileListViewController.allowEditing = allowEditing
|
||||
self.init(rootViewController: fileListViewController)
|
||||
self.view.backgroundColor = UIColor.white
|
||||
self.fileList = fileListViewController
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ class WebviewPreviewViewContoller: UIViewController {
|
||||
|
||||
//MARK: Share
|
||||
|
||||
func shareFile(_ sender: UIBarButtonItem) {
|
||||
@objc func shareFile(_ sender: UIBarButtonItem) {
|
||||
guard let file = file else {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user