From ed5a54b19f774a7f5a9d1d997c7a90391b418dec Mon Sep 17 00:00:00 2001 From: David Whetstone Date: Mon, 12 Sep 2016 10:57:06 -0700 Subject: [PATCH 1/7] Update to Swift 2.3 / Xcode 8 GM / CocoaPods 1.1.0.rc.1 --- FileBrowser.xcodeproj/project.pbxproj | 6 ++ FileBrowser/PreviewManager.swift | 2 +- Gemfile | 3 + Gemfile.lock | 69 +++++++++++++++++++ examples/Sample/Podfile | 4 +- .../Sample/Sample.xcodeproj/project.pbxproj | 6 ++ examples/Sample/Sample/AppDelegate.swift | 6 +- 7 files changed, 91 insertions(+), 5 deletions(-) create mode 100644 Gemfile create mode 100644 Gemfile.lock diff --git a/FileBrowser.xcodeproj/project.pbxproj b/FileBrowser.xcodeproj/project.pbxproj index 28a6d72..78f1a76 100644 --- a/FileBrowser.xcodeproj/project.pbxproj +++ b/FileBrowser.xcodeproj/project.pbxproj @@ -259,9 +259,11 @@ TargetAttributes = { 344169531C67812400B93D28 = { CreatedOnToolsVersion = 7.2.1; + LastSwiftMigration = 0800; }; 3441695D1C67812400B93D28 = { CreatedOnToolsVersion = 7.2.1; + LastSwiftMigration = 0800; }; }; }; @@ -453,6 +455,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 2.3; }; name = Debug; }; @@ -471,6 +474,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.roymarmelstein.FileBrowser; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; + SWIFT_VERSION = 2.3; }; name = Release; }; @@ -481,6 +485,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.roymarmelstein.FileBrowserTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 2.3; }; name = Debug; }; @@ -491,6 +496,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.roymarmelstein.FileBrowserTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 2.3; }; name = Release; }; diff --git a/FileBrowser/PreviewManager.swift b/FileBrowser/PreviewManager.swift index 4cd82d4..7c21069 100644 --- a/FileBrowser/PreviewManager.swift +++ b/FileBrowser/PreviewManager.swift @@ -51,7 +51,7 @@ class PreviewItem: NSObject, QLPreviewItem { var filePath: NSURL? - internal var previewItemURL: NSURL { + internal var previewItemURL: NSURL? { if let filePath = filePath { return filePath } diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..d2e8888 --- /dev/null +++ b/Gemfile @@ -0,0 +1,3 @@ +source 'https://rubygems.org' + +gem 'cocoapods', '1.1.0.rc.1' diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..f279a83 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,69 @@ +GEM + remote: https://rubygems.org/ + specs: + activesupport (4.2.7.1) + i18n (~> 0.7) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) + thread_safe (~> 0.3, >= 0.3.4) + tzinfo (~> 1.1) + claide (1.0.0) + cocoapods (1.1.0.rc.1) + activesupport (>= 4.0.2, < 5) + claide (>= 1.0.0, < 2.0) + cocoapods-core (= 1.1.0.rc.1) + cocoapods-deintegrate (>= 1.0.1, < 2.0) + cocoapods-downloader (>= 1.1.1, < 2.0) + cocoapods-plugins (>= 1.0.0, < 2.0) + cocoapods-search (>= 1.0.0, < 2.0) + cocoapods-stats (>= 1.0.0, < 2.0) + cocoapods-trunk (>= 1.0.0, < 2.0) + cocoapods-try (>= 1.1.0, < 2.0) + colored (~> 1.2) + escape (~> 0.0.4) + fourflusher (~> 1.0.1) + gh_inspector (~> 1.0) + molinillo (~> 0.5.0) + nap (~> 1.0) + xcodeproj (>= 1.3.1, < 2.0) + cocoapods-core (1.1.0.rc.1) + activesupport (>= 4.0.2, < 5) + fuzzy_match (~> 2.0.4) + nap (~> 1.0) + cocoapods-deintegrate (1.0.1) + cocoapods-downloader (1.1.1) + cocoapods-plugins (1.0.0) + nap + cocoapods-search (1.0.0) + cocoapods-stats (1.0.0) + cocoapods-trunk (1.0.0) + nap (>= 0.8, < 2.0) + netrc (= 0.7.8) + cocoapods-try (1.1.0) + colored (1.2) + escape (0.0.4) + fourflusher (1.0.1) + fuzzy_match (2.0.4) + gh_inspector (1.0.2) + i18n (0.7.0) + json (1.8.3) + minitest (5.9.0) + molinillo (0.5.0) + nap (1.1.0) + netrc (0.7.8) + thread_safe (0.3.5) + tzinfo (1.2.2) + thread_safe (~> 0.1) + xcodeproj (1.3.1) + activesupport (>= 3) + claide (>= 1.0.0, < 2.0) + colored (~> 1.2) + +PLATFORMS + ruby + +DEPENDENCIES + cocoapods (= 1.1.0.rc.1) + +BUNDLED WITH + 1.12.5 diff --git a/examples/Sample/Podfile b/examples/Sample/Podfile index ea0472b..c42d04e 100644 --- a/examples/Sample/Podfile +++ b/examples/Sample/Podfile @@ -2,4 +2,6 @@ source 'https://github.com/CocoaPods/Specs.git' platform :ios, "8.0" use_frameworks! -pod 'FileBrowser', :path => '../..' +target 'Sample' do + pod 'FileBrowser', :path => '../..' +end diff --git a/examples/Sample/Sample.xcodeproj/project.pbxproj b/examples/Sample/Sample.xcodeproj/project.pbxproj index eb1eceb..6375af8 100644 --- a/examples/Sample/Sample.xcodeproj/project.pbxproj +++ b/examples/Sample/Sample.xcodeproj/project.pbxproj @@ -172,9 +172,11 @@ TargetAttributes = { 3430F66C1C45C930007473A6 = { CreatedOnToolsVersion = 7.2; + LastSwiftMigration = 0800; }; 3430F6801C45C930007473A6 = { CreatedOnToolsVersion = 7.2; + LastSwiftMigration = 0800; TestTargetID = 3430F66C1C45C930007473A6; }; }; @@ -360,6 +362,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.roymarmelstein.Sample; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 2.3; }; name = Debug; }; @@ -372,6 +375,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.roymarmelstein.Sample; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 2.3; }; name = Release; }; @@ -383,6 +387,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.roymarmelstein.SampleTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 2.3; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Sample.app/Sample"; }; name = Debug; @@ -395,6 +400,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.roymarmelstein.SampleTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 2.3; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Sample.app/Sample"; }; name = Release; diff --git a/examples/Sample/Sample/AppDelegate.swift b/examples/Sample/Sample/AppDelegate.swift index 2ec6d1e..d23393a 100644 --- a/examples/Sample/Sample/AppDelegate.swift +++ b/examples/Sample/Sample/AppDelegate.swift @@ -24,7 +24,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { let bundleUrl = NSBundle.mainBundle().resourceURL // Copy images to documents folder for file in fileNames { - if let srcPath = bundleUrl?.URLByAppendingPathComponent(file).path, let toPath = documentsUrl.URLByAppendingPathComponent(file).path{ + if let srcPath = bundleUrl?.URLByAppendingPathComponent(file)!.path, let toPath = documentsUrl.URLByAppendingPathComponent(file)!.path{ do { try fileManager.copyItemAtPath(srcPath, toPath: toPath) } catch {} @@ -34,10 +34,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate { // Copy zip file to an images directory let imagesDirectoryURL = documentsUrl.URLByAppendingPathComponent("images") let zipFileName = "Images.zip" - if let imagesDirectoryPath = imagesDirectoryURL.path { + if let imagesDirectoryPath = imagesDirectoryURL!.path { do { try fileManager.createDirectoryAtPath(imagesDirectoryPath, withIntermediateDirectories: false, attributes: nil) - if let srcPath = bundleUrl?.URLByAppendingPathComponent(zipFileName).path, let toPath = imagesDirectoryURL.URLByAppendingPathComponent(zipFileName).path{ + if let srcPath = bundleUrl?.URLByAppendingPathComponent(zipFileName)!.path, let toPath = imagesDirectoryURL!.URLByAppendingPathComponent(zipFileName)!.path{ do { try fileManager.copyItemAtPath(srcPath, toPath: toPath) } catch {} From f95bac9ee511d41c77430ae0e40113f6835163fa Mon Sep 17 00:00:00 2001 From: David Whetstone Date: Thu, 15 Sep 2016 09:55:17 -0700 Subject: [PATCH 2/7] Update Travis image to Xcode 8 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e97bc3c..96e9b49 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -osx_image: xcode7.3 +osx_image: xcode8 language: objective-c env: global: From f379913f1d91934313a63aaea1b8606baf323e4a Mon Sep 17 00:00:00 2001 From: Developer Date: Fri, 16 Sep 2016 17:13:25 +0300 Subject: [PATCH 3/7] Updated to Swift 3, fixed bugs. --- FileBrowser.xcodeproj/project.pbxproj | 23 ++++++++-- .../xcschemes/FileBrowser.xcscheme | 2 +- FileBrowser/FBFile.swift | 44 +++++++++--------- FileBrowser/FileBrowser.swift | 16 +++---- FileBrowser/FileListPreview.swift | 12 ++--- FileBrowser/FileListSearch.swift | 8 ++-- FileBrowser/FileListTableView.swift | 38 +++++++-------- FileBrowser/FileListViewController.swift | 46 +++++++++---------- FileBrowser/FileParser.swift | 22 ++++----- FileBrowser/PreviewManager.swift | 24 ++++++---- .../PreviewTransitionViewController.swift | 2 +- FileBrowser/WebviewPreviewViewContoller.swift | 24 +++++----- 12 files changed, 138 insertions(+), 123 deletions(-) diff --git a/FileBrowser.xcodeproj/project.pbxproj b/FileBrowser.xcodeproj/project.pbxproj index 28a6d72..fa4160f 100644 --- a/FileBrowser.xcodeproj/project.pbxproj +++ b/FileBrowser.xcodeproj/project.pbxproj @@ -254,14 +254,16 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 0720; + LastUpgradeCheck = 0800; ORGANIZATIONNAME = "Roy Marmelstein"; TargetAttributes = { 344169531C67812400B93D28 = { CreatedOnToolsVersion = 7.2.1; + LastSwiftMigration = 0800; }; 3441695D1C67812400B93D28 = { CreatedOnToolsVersion = 7.2.1; + LastSwiftMigration = 0800; }; }; }; @@ -361,8 +363,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -385,7 +389,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -409,8 +413,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -427,9 +433,10 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; @@ -441,18 +448,20 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_MODULES = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 5; DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = FileBrowser/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.roymarmelstein.FileBrowser; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; }; name = Debug; }; @@ -460,17 +469,19 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_MODULES = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 5; DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = FileBrowser/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.roymarmelstein.FileBrowser; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; + SWIFT_VERSION = 3.0; }; name = Release; }; @@ -481,6 +492,7 @@ 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; }; name = Debug; }; @@ -491,6 +503,7 @@ 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; }; name = Release; }; diff --git a/FileBrowser.xcodeproj/xcshareddata/xcschemes/FileBrowser.xcscheme b/FileBrowser.xcodeproj/xcshareddata/xcschemes/FileBrowser.xcscheme index 738a650..88866a2 100644 --- a/FileBrowser.xcodeproj/xcshareddata/xcschemes/FileBrowser.xcscheme +++ b/FileBrowser.xcodeproj/xcshareddata/xcschemes/FileBrowser.xcscheme @@ -1,6 +1,6 @@ UIImage? { - let bundle = NSBundle(forClass: FileParser.self) + let bundle = Bundle(for: FileParser.self) var fileName = String() switch self { - case Directory: fileName = "folder@2x.png" - case JPG, PNG, GIF: fileName = "image@2x.png" - case PDF: fileName = "pdf@2x.png" - case ZIP: fileName = "zip@2x.png" + case .Directory: fileName = "folder@2x.png" + case .JPG, .PNG, .GIF: fileName = "image@2x.png" + case .PDF: fileName = "pdf@2x.png" + case .ZIP: fileName = "zip@2x.png" default: fileName = "file@2x.png" } - let file = UIImage(named: fileName, inBundle: bundle, compatibleWithTraitCollection: nil) + let file = UIImage(named: fileName, in: bundle, compatibleWith: nil) return file } } @@ -103,12 +103,12 @@ public enum FBFileType: String { - returns: isDirectory Bool. */ -func checkDirectory(filePath: NSURL) -> Bool { +func checkDirectory(_ filePath: URL) -> Bool { var isDirectory = false do { var resourceValue: AnyObject? - try filePath.getResourceValue(&resourceValue, forKey: NSURLIsDirectoryKey) - if let number = resourceValue as? NSNumber where number == true { + try (filePath as NSURL).getResourceValue(&resourceValue, forKey: URLResourceKey.isDirectoryKey) + if let number = resourceValue as? NSNumber , number == true { isDirectory = true } } @@ -116,13 +116,11 @@ func checkDirectory(filePath: NSURL) -> Bool { return isDirectory } -func getFileAttributes(filePath: NSURL) -> NSDictionary? { - guard let path = filePath.path else { - return nil - } +func getFileAttributes(_ filePath: URL) -> NSDictionary? { + let path = filePath.path let fileManager = FileParser.sharedInstance.fileManager do { - let attributes = try fileManager.attributesOfItemAtPath(path) as NSDictionary + let attributes = try fileManager.attributesOfItem(atPath: path) as NSDictionary return attributes } catch {} return nil diff --git a/FileBrowser/FileBrowser.swift b/FileBrowser/FileBrowser.swift index e5c9fc7..340183f 100644 --- a/FileBrowser/FileBrowser.swift +++ b/FileBrowser/FileBrowser.swift @@ -9,28 +9,28 @@ import Foundation /// File browser containing navigation controller. -public class FileBrowser: UINavigationController { +open class FileBrowser: UINavigationController { let parser = FileParser.sharedInstance var fileList: FileListViewController? /// File types to exclude from the file browser. - public var excludesFileExtensions: [String]? { + open var excludesFileExtensions: [String]? { didSet { parser.excludesFileExtensions = excludesFileExtensions } } /// File paths to exclude from the file browser. - public var excludesFilepaths: [NSURL]? { + open var excludesFilepaths: [URL]? { didSet { parser.excludesFilepaths = excludesFilepaths } } /// Override default preview and actionsheet behaviour in favour of custom file handling. - public var didSelectFile: ((FBFile) -> ())? { + open var didSelectFile: ((FBFile) -> ())? { didSet { fileList?.didSelectFile = didSelectFile } @@ -44,7 +44,7 @@ public class FileBrowser: UINavigationController { public convenience init() { let parser = FileParser.sharedInstance let path = parser.documentsURL() - self.init(initialPath: path) + self.init(initialPath: path as URL) } /** @@ -54,11 +54,11 @@ public class FileBrowser: UINavigationController { - returns: File browser view controller. */ - public convenience init(initialPath: NSURL) { + public convenience init(initialPath: URL) { let fileListViewController = FileListViewController(initialPath: initialPath) self.init(rootViewController: fileListViewController) - self.view.backgroundColor = UIColor.whiteColor() + self.view.backgroundColor = UIColor.white self.fileList = fileListViewController } -} \ No newline at end of file +} diff --git a/FileBrowser/FileListPreview.swift b/FileBrowser/FileListPreview.swift index 1a2cc33..240413d 100644 --- a/FileBrowser/FileListPreview.swift +++ b/FileBrowser/FileListPreview.swift @@ -15,17 +15,17 @@ extension FileListViewController: UIViewControllerPreviewingDelegate { func registerFor3DTouch() { if #available(iOS 9.0, *) { - if self.traitCollection.forceTouchCapability == UIForceTouchCapability.Available { - registerForPreviewingWithDelegate(self, sourceView: tableView) + if self.traitCollection.forceTouchCapability == UIForceTouchCapability.available { + registerForPreviewing(with: self, sourceView: tableView) } } } - func previewingContext(previewingContext: UIViewControllerPreviewing, viewControllerForLocation location: CGPoint) -> UIViewController? { + func previewingContext(_ previewingContext: UIViewControllerPreviewing, viewControllerForLocation location: CGPoint) -> UIViewController? { if #available(iOS 9.0, *) { - if let indexPath = tableView.indexPathForRowAtPoint(location) { + if let indexPath = tableView.indexPathForRow(at: location) { let selectedFile = fileForIndexPath(indexPath) - previewingContext.sourceRect = tableView.rectForRowAtIndexPath(indexPath) + previewingContext.sourceRect = tableView.rectForRow(at: indexPath) if selectedFile.isDirectory == false { return previewManager.previewViewControllerForFile(selectedFile, fromNavigation: false) } @@ -34,7 +34,7 @@ extension FileListViewController: UIViewControllerPreviewingDelegate { return nil } - func previewingContext(previewingContext: UIViewControllerPreviewing, commitViewController viewControllerToCommit: UIViewController) { + func previewingContext(_ previewingContext: UIViewControllerPreviewing, commit viewControllerToCommit: UIViewController) { if let previewTransitionViewController = viewControllerToCommit as? PreviewTransitionViewController { self.navigationController?.pushViewController(previewTransitionViewController.quickLookPreviewController, animated: true) } diff --git a/FileBrowser/FileListSearch.swift b/FileBrowser/FileListSearch.swift index 76175dc..ede8f3a 100644 --- a/FileBrowser/FileListSearch.swift +++ b/FileBrowser/FileListSearch.swift @@ -11,21 +11,21 @@ import Foundation extension FileListViewController: UISearchBarDelegate, UISearchControllerDelegate, UISearchResultsUpdating { // MARK: UISearchControllerDelegate - func willPresentSearchController(searchController: UISearchController) { + func willPresentSearchController(_ searchController: UISearchController) { self.tableView.contentInset = UIEdgeInsetsMake(20, 0, 0, 0) } - func willDismissSearchController(searchController: UISearchController) { + func willDismissSearchController(_ searchController: UISearchController) { self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0) } // MARK: UISearchBarDelegate - func searchBar(searchBar: UISearchBar, textDidChange searchText: String) { + func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) { filterContentForSearchText(searchBar.text!) } // MARK: UISearchResultsUpdating - func updateSearchResultsForSearchController(searchController: UISearchController) { + func updateSearchResults(for searchController: UISearchController) { filterContentForSearchText(searchController.searchBar.text!) } } diff --git a/FileBrowser/FileListTableView.swift b/FileBrowser/FileListTableView.swift index 00e2545..bb2a290 100644 --- a/FileBrowser/FileListTableView.swift +++ b/FileBrowser/FileListTableView.swift @@ -12,36 +12,36 @@ extension FileListViewController: UITableViewDataSource, UITableViewDelegate { //MARK: UITableViewDataSource, UITableViewDelegate - func numberOfSectionsInTableView(tableView: UITableView) -> Int { - if searchController.active { + func numberOfSections(in tableView: UITableView) -> Int { + if searchController.isActive { return 1 } return sections.count } - func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - if searchController.active { + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + if searchController.isActive { return filteredFiles.count } return sections[section].count } - func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cellIdentifier = "FileCell" - var cell = UITableViewCell(style: .Subtitle, reuseIdentifier: cellIdentifier) - if let reuseCell = tableView.dequeueReusableCellWithIdentifier(cellIdentifier) { + var cell = UITableViewCell(style: .subtitle, reuseIdentifier: cellIdentifier) + if let reuseCell = tableView.dequeueReusableCell(withIdentifier: cellIdentifier) { cell = reuseCell } - cell.selectionStyle = .Blue + cell.selectionStyle = .blue let selectedFile = fileForIndexPath(indexPath) cell.textLabel?.text = selectedFile.displayName cell.imageView?.image = selectedFile.type.image() return cell } - func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { let selectedFile = fileForIndexPath(indexPath) - searchController.active = false + searchController.isActive = false if selectedFile.isDirectory { let fileListViewController = FileListViewController(initialPath: selectedFile.filePath) fileListViewController.didSelectFile = didSelectFile @@ -57,11 +57,11 @@ extension FileListViewController: UITableViewDataSource, UITableViewDelegate { self.navigationController?.pushViewController(filePreview, animated: true) } } - tableView.deselectRowAtIndexPath(indexPath, animated: true) + tableView.deselectRow(at: indexPath, animated: true) } - func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? { - if searchController.active { + func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? { + if searchController.isActive { return nil } if sections[section].count > 0 { @@ -72,19 +72,19 @@ extension FileListViewController: UITableViewDataSource, UITableViewDelegate { } } - func sectionIndexTitlesForTableView(tableView: UITableView) -> [String]? { - if searchController.active { + func sectionIndexTitles(for tableView: UITableView) -> [String]? { + if searchController.isActive { return nil } return collation.sectionIndexTitles } - func tableView(tableView: UITableView, sectionForSectionIndexTitle title: String, atIndex index: Int) -> Int { - if searchController.active { + func tableView(_ tableView: UITableView, sectionForSectionIndexTitle title: String, at index: Int) -> Int { + if searchController.isActive { return 0 } - return collation.sectionForSectionIndexTitleAtIndex(index) + return collation.section(forSectionIndexTitle: index) } -} \ No newline at end of file +} diff --git a/FileBrowser/FileListViewController.swift b/FileBrowser/FileListViewController.swift index edd8cd6..b898c5e 100644 --- a/FileBrowser/FileListViewController.swift +++ b/FileBrowser/FileListViewController.swift @@ -12,12 +12,12 @@ class FileListViewController: UIViewController { // TableView @IBOutlet weak var tableView: UITableView! - let collation = UILocalizedIndexedCollation.currentCollation() + let collation = UILocalizedIndexedCollation.current() /// Data var didSelectFile: ((FBFile) -> ())? var files = [FBFile]() - var initialPath: NSURL? + var initialPath: URL? let parser = FileParser.sharedInstance let previewManager = PreviewManager() var sections: [[FBFile]] = [] @@ -26,8 +26,8 @@ class FileListViewController: UIViewController { var filteredFiles = [FBFile]() let searchController: UISearchController = { let searchController = UISearchController(searchResultsController: nil) - searchController.searchBar.searchBarStyle = .Minimal - searchController.searchBar.backgroundColor = UIColor.whiteColor() + searchController.searchBar.searchBarStyle = .minimal + searchController.searchBar.backgroundColor = UIColor.white searchController.dimsBackgroundDuringPresentation = false return searchController }() @@ -35,9 +35,9 @@ class FileListViewController: UIViewController { //MARK: Lifecycle - convenience init (initialPath: NSURL) { - self.init(nibName: "FileBrowser", bundle: NSBundle(forClass: FileListViewController.self)) - self.edgesForExtendedLayout = .None + convenience init (initialPath: URL) { + self.init(nibName: "FileBrowser", bundle: Bundle(for: FileListViewController.self)) + self.edgesForExtendedLayout = UIRectEdge() // Set initial path self.initialPath = initialPath @@ -49,7 +49,7 @@ class FileListViewController: UIViewController { searchController.delegate = self // Add dismiss button - let dismissButton = UIBarButtonItem(barButtonSystemItem: .Cancel, target: self, action: #selector(FileListViewController.dismiss)) + let dismissButton = UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: #selector(FileListViewController.dismiss(button:))) self.navigationItem.rightBarButtonItem = dismissButton } @@ -79,47 +79,47 @@ class FileListViewController: UIViewController { self.registerFor3DTouch() } - override func viewWillAppear(animated: Bool) { + override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) // Scroll to hide search bar - self.tableView.contentOffset = CGPointMake(0, searchController.searchBar.frame.size.height) + self.tableView.contentOffset = CGPoint(x: 0, y: searchController.searchBar.frame.size.height) // Make sure navigation bar is visible - self.navigationController?.navigationBarHidden = false + self.navigationController?.isNavigationBarHidden = false } - func dismiss() { - self.dismissViewControllerAnimated(true, completion: nil) + @objc func dismiss(button: UIBarButtonItem = UIBarButtonItem()) { + self.dismiss(animated: true, completion: nil) } //MARK: Data func indexFiles() { - let selector: Selector = Selector("displayName") - sections = Array(count: collation.sectionTitles.count, repeatedValue: []) - if let sortedObjects = collation.sortedArrayFromArray(files, collationStringSelector: selector) as? [FBFile]{ + let selector: Selector = #selector(getter: UIPrinter.displayName) + sections = Array(repeating: [], count: collation.sectionTitles.count) + if let sortedObjects = collation.sortedArray(from: files, collationStringSelector: selector) as? [FBFile]{ for object in sortedObjects { - let sectionNumber = collation.sectionForObject(object, collationStringSelector: selector) + let sectionNumber = collation.section(for: object, collationStringSelector: selector) sections[sectionNumber].append(object) } } } - func fileForIndexPath(indexPath: NSIndexPath) -> FBFile { + func fileForIndexPath(_ indexPath: IndexPath) -> FBFile { var file: FBFile - if searchController.active { - file = filteredFiles[indexPath.row] + if searchController.isActive { + file = filteredFiles[(indexPath as NSIndexPath).row] } else { - file = sections[indexPath.section][indexPath.row] + file = sections[(indexPath as NSIndexPath).section][(indexPath as NSIndexPath).row] } return file } - func filterContentForSearchText(searchText: String) { + func filterContentForSearchText(_ searchText: String) { filteredFiles = files.filter({ (file: FBFile) -> Bool in - return file.displayName.lowercaseString.containsString(searchText.lowercaseString) + return file.displayName.lowercased().contains(searchText.lowercased()) }) tableView.reloadData() } diff --git a/FileBrowser/FileParser.swift b/FileBrowser/FileParser.swift index 53d4c78..c0e364f 100644 --- a/FileBrowser/FileParser.swift +++ b/FileBrowser/FileParser.swift @@ -17,7 +17,7 @@ class FileParser { /// Mapped for case insensitivity var excludesFileExtensions: [String]? { get { - return _excludesFileExtensions.map({$0.lowercaseString}) + return _excludesFileExtensions.map({$0.lowercased()}) } set { if let newValue = newValue { @@ -26,30 +26,30 @@ class FileParser { } } - var excludesFilepaths: [NSURL]? + var excludesFilepaths: [URL]? - let fileManager = NSFileManager.defaultManager() + let fileManager = FileManager.default - func documentsURL() -> NSURL { - return fileManager.URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask)[0] as NSURL + func documentsURL() -> URL { + return fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] as URL } - func filesForDirectory(directoryPath: NSURL) -> [FBFile] { + func filesForDirectory(_ directoryPath: URL) -> [FBFile] { var files = [FBFile]() - var filePaths = [NSURL]() + var filePaths = [URL]() // Get contents do { - filePaths = try self.fileManager.contentsOfDirectoryAtURL(directoryPath, includingPropertiesForKeys: [], options: [.SkipsHiddenFiles]) + filePaths = try self.fileManager.contentsOfDirectory(at: directoryPath, includingPropertiesForKeys: [], options: [.skipsHiddenFiles]) } catch { return files } // Parse for filePath in filePaths { let file = FBFile(filePath: filePath) - if let excludesFileExtensions = excludesFileExtensions, let fileExtensions = file.fileExtension where excludesFileExtensions.contains(fileExtensions) { + if let excludesFileExtensions = excludesFileExtensions, let fileExtensions = file.fileExtension , excludesFileExtensions.contains(fileExtensions) { continue } - if let excludesFilepaths = excludesFilepaths where excludesFilepaths.contains(file.filePath) { + if let excludesFilepaths = excludesFilepaths , excludesFilepaths.contains(file.filePath) { continue } if file.displayName.isEmpty == false { @@ -57,7 +57,7 @@ class FileParser { } } // Sort - files = files.sort(){$0.displayName < $1.displayName} + files = files.sorted(){$0.displayName < $1.displayName} return files } diff --git a/FileBrowser/PreviewManager.swift b/FileBrowser/PreviewManager.swift index 4cd82d4..672283b 100644 --- a/FileBrowser/PreviewManager.swift +++ b/FileBrowser/PreviewManager.swift @@ -11,20 +11,20 @@ import QuickLook class PreviewManager: NSObject, QLPreviewControllerDataSource { - var filePath: NSURL? + var filePath: URL? - func previewViewControllerForFile(file: FBFile, fromNavigation: Bool) -> UIViewController { + func previewViewControllerForFile(_ file: FBFile, fromNavigation: Bool) -> UIViewController { if file.type == .PLIST || file.type == .JSON{ - let webviewPreviewViewContoller = WebviewPreviewViewContoller(nibName: "WebviewPreviewViewContoller", bundle: NSBundle(forClass: WebviewPreviewViewContoller.self)) + let webviewPreviewViewContoller = WebviewPreviewViewContoller(nibName: "WebviewPreviewViewContoller", bundle: Bundle(for: WebviewPreviewViewContoller.self)) webviewPreviewViewContoller.file = file return webviewPreviewViewContoller } else { - let previewTransitionViewController = PreviewTransitionViewController(nibName: "PreviewTransitionViewController", bundle: NSBundle(forClass: PreviewTransitionViewController.self)) + let previewTransitionViewController = PreviewTransitionViewController(nibName: "PreviewTransitionViewController", bundle: Bundle(for: PreviewTransitionViewController.self)) previewTransitionViewController.quickLookPreviewController.dataSource = self - self.filePath = file.filePath + self.filePath = file.filePath as URL if fromNavigation == true { return previewTransitionViewController.quickLookPreviewController } @@ -33,11 +33,11 @@ class PreviewManager: NSObject, QLPreviewControllerDataSource { } - func numberOfPreviewItemsInPreviewController(controller: QLPreviewController) -> Int { + func numberOfPreviewItems(in controller: QLPreviewController) -> Int { return 1 } - func previewController(controller: QLPreviewController, previewItemAtIndex index: Int) -> QLPreviewItem { + func previewController(_ controller: QLPreviewController, previewItemAt index: Int) -> QLPreviewItem { let item = PreviewItem() if let filePath = filePath { item.filePath = filePath @@ -49,13 +49,17 @@ class PreviewManager: NSObject, QLPreviewControllerDataSource { class PreviewItem: NSObject, QLPreviewItem { - var filePath: NSURL? + /*! + * @abstract The URL of the item to preview. + * @discussion The URL must be a file URL. + */ - internal var previewItemURL: NSURL { + var filePath: URL? + public var previewItemURL: URL? { if let filePath = filePath { return filePath } - return NSURL() + return nil } } diff --git a/FileBrowser/PreviewTransitionViewController.swift b/FileBrowser/PreviewTransitionViewController.swift index 77d5955..a2c5e28 100644 --- a/FileBrowser/PreviewTransitionViewController.swift +++ b/FileBrowser/PreviewTransitionViewController.swift @@ -21,7 +21,7 @@ class PreviewTransitionViewController: UIViewController { self.addChildViewController(quickLookPreviewController) containerView.addSubview(quickLookPreviewController.view) quickLookPreviewController.view.frame = containerView.bounds - quickLookPreviewController.didMoveToParentViewController(self) + quickLookPreviewController.didMove(toParentViewController: self) } } diff --git a/FileBrowser/WebviewPreviewViewContoller.swift b/FileBrowser/WebviewPreviewViewContoller.swift index 9b363be..0c89067 100644 --- a/FileBrowser/WebviewPreviewViewContoller.swift +++ b/FileBrowser/WebviewPreviewViewContoller.swift @@ -28,7 +28,7 @@ class WebviewPreviewViewContoller: UIViewController { self.view.addSubview(webView) // Add share button - let shareButton = UIBarButtonItem(barButtonSystemItem: .Action, target: self, action: #selector(WebviewPreviewViewContoller.shareFile)) + let shareButton = UIBarButtonItem(barButtonSystemItem: .action, target: self, action: #selector(WebviewPreviewViewContoller.shareFile)) self.navigationItem.rightBarButtonItem = shareButton } @@ -44,14 +44,14 @@ class WebviewPreviewViewContoller: UIViewController { return } let activityViewController = UIActivityViewController(activityItems: [file.filePath], applicationActivities: nil) - self.presentViewController(activityViewController, animated: true, completion: nil) + self.present(activityViewController, animated: true, completion: nil) } //MARK: Processing func processForDisplay() { - guard let file = file, let data = NSData(contentsOfURL: file.filePath) else { + guard let file = file, let data = try? Data(contentsOf: file.filePath as URL) else { return } var rawString: String? @@ -59,7 +59,7 @@ class WebviewPreviewViewContoller: UIViewController { // Prepare plist for display if file.type == .PLIST { do { - if let plistDescription = try NSPropertyListSerialization.propertyListWithData(data, options: [], format: nil).description { + if let plistDescription = try (PropertyListSerialization.propertyList(from: data, options: [], format: nil) as AnyObject).description { rawString = plistDescription } } catch {} @@ -68,12 +68,12 @@ class WebviewPreviewViewContoller: UIViewController { // Prepare json file for display else if file.type == .JSON { do { - let jsonObject = try NSJSONSerialization.JSONObjectWithData(data, options: []) - if NSJSONSerialization.isValidJSONObject(jsonObject) { - let prettyJSON = try NSJSONSerialization.dataWithJSONObject(jsonObject, options: .PrettyPrinted) - var jsonString = String(data: prettyJSON, encoding: NSUTF8StringEncoding) + let jsonObject = try JSONSerialization.jsonObject(with: data, options: []) + if JSONSerialization.isValidJSONObject(jsonObject) { + let prettyJSON = try JSONSerialization.data(withJSONObject: jsonObject, options: .prettyPrinted) + var jsonString = String(data: prettyJSON, encoding: String.Encoding.utf8) // Unescape forward slashes - jsonString = jsonString?.stringByReplacingOccurrencesOfString("\\/", withString: "/") + jsonString = jsonString?.replacingOccurrences(of: "\\/", with: "/") rawString = jsonString } } catch {} @@ -81,7 +81,7 @@ class WebviewPreviewViewContoller: UIViewController { // Default prepare for display if rawString == nil { - rawString = String(data: data, encoding: NSUTF8StringEncoding) + rawString = String(data: data, encoding: String.Encoding.utf8) } // Convert and display string @@ -95,7 +95,7 @@ class WebviewPreviewViewContoller: UIViewController { // Make sure we convert HTML special characters // Code from https://gist.github.com/mikesteele/70ae98d04fdc35cb1d5f - func convertSpecialCharacters(string: String?) -> String? { + func convertSpecialCharacters(_ string: String?) -> String? { guard let string = string else { return nil } @@ -108,7 +108,7 @@ class WebviewPreviewViewContoller: UIViewController { "'": "'" ]; for (escaped_char, unescaped_char) in char_dictionary { - newString = newString.stringByReplacingOccurrencesOfString(escaped_char, withString: unescaped_char, options: NSStringCompareOptions.RegularExpressionSearch, range: nil) + newString = newString.replacingOccurrences(of: escaped_char, with: unescaped_char, options: NSString.CompareOptions.regularExpression, range: nil) } return newString } From ac3c3daefb716725441f2c39e2bd1fc9f3c0d5d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mihail=20S=CC=A6alari?= Date: Fri, 16 Sep 2016 19:50:46 +0300 Subject: [PATCH 4/7] Updated to Swift 3 --- FileBrowser.xcodeproj/project.pbxproj | 8 +- .../contents.xcworkspacedata | 10 + examples/Sample/Podfile | 5 - .../Sample/Sample.xcodeproj/project.pbxproj | 343 ++++++++---------- .../xcshareddata/xcschemes/Sample.xcscheme | 101 ------ examples/Sample/Sample/AppDelegate.swift | 75 ---- .../AppIcon.appiconset/Contents.json | 30 ++ .../Sample/Assets.xcassets/Contents.json | 6 - .../File.imageset/738-document-1.png | Bin 226 -> 0 bytes .../File.imageset/738-document-1@2x.png | Bin 382 -> 0 bytes .../File.imageset/Contents.json | 22 -- .../Folder.imageset/710-folder.png | Bin 300 -> 0 bytes .../Folder.imageset/710-folder@2x.png | Bin 577 -> 0 bytes .../Folder.imageset/Contents.json | 22 -- .../Sample/Base.lproj/LaunchScreen.storyboard | 10 +- .../Sample/Sample/Base.lproj/Main.storyboard | 72 ++-- .../Sample/Supporting Files/AppDelegate.swift | 87 +++++ .../Sample/{ => Supporting Files}/Info.plist | 9 +- .../View Controller/MainViewController.swift | 32 ++ examples/Sample/Sample/ViewController.swift | 19 - examples/Sample/SampleTests/Info.plist | 24 -- examples/Sample/SampleTests/SampleTests.swift | 36 -- 22 files changed, 359 insertions(+), 552 deletions(-) create mode 100644 FileBrowserWorkspace.xcworkspace/contents.xcworkspacedata delete mode 100644 examples/Sample/Podfile delete mode 100644 examples/Sample/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme delete mode 100644 examples/Sample/Sample/AppDelegate.swift delete mode 100644 examples/Sample/Sample/Assets.xcassets/Contents.json delete mode 100644 examples/Sample/Sample/Assets.xcassets/File.imageset/738-document-1.png delete mode 100644 examples/Sample/Sample/Assets.xcassets/File.imageset/738-document-1@2x.png delete mode 100644 examples/Sample/Sample/Assets.xcassets/File.imageset/Contents.json delete mode 100644 examples/Sample/Sample/Assets.xcassets/Folder.imageset/710-folder.png delete mode 100644 examples/Sample/Sample/Assets.xcassets/Folder.imageset/710-folder@2x.png delete mode 100644 examples/Sample/Sample/Assets.xcassets/Folder.imageset/Contents.json create mode 100644 examples/Sample/Sample/Supporting Files/AppDelegate.swift rename examples/Sample/Sample/{ => Supporting Files}/Info.plist (79%) create mode 100644 examples/Sample/Sample/View Controller/MainViewController.swift delete mode 100644 examples/Sample/Sample/ViewController.swift delete mode 100644 examples/Sample/SampleTests/Info.plist delete mode 100644 examples/Sample/SampleTests/SampleTests.swift diff --git a/FileBrowser.xcodeproj/project.pbxproj b/FileBrowser.xcodeproj/project.pbxproj index fa4160f..bea4b78 100644 --- a/FileBrowser.xcodeproj/project.pbxproj +++ b/FileBrowser.xcodeproj/project.pbxproj @@ -389,7 +389,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; + IPHONEOS_DEPLOYMENT_TARGET = 8.1; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -433,7 +433,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; + IPHONEOS_DEPLOYMENT_TARGET = 8.1; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; @@ -455,7 +455,7 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = FileBrowser/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.roymarmelstein.FileBrowser; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -476,7 +476,7 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = FileBrowser/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.roymarmelstein.FileBrowser; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/FileBrowserWorkspace.xcworkspace/contents.xcworkspacedata b/FileBrowserWorkspace.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..877319b --- /dev/null +++ b/FileBrowserWorkspace.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/examples/Sample/Podfile b/examples/Sample/Podfile deleted file mode 100644 index ea0472b..0000000 --- a/examples/Sample/Podfile +++ /dev/null @@ -1,5 +0,0 @@ -source 'https://github.com/CocoaPods/Specs.git' -platform :ios, "8.0" -use_frameworks! - -pod 'FileBrowser', :path => '../..' diff --git a/examples/Sample/Sample.xcodeproj/project.pbxproj b/examples/Sample/Sample.xcodeproj/project.pbxproj index eb1eceb..5b4c8d7 100644 --- a/examples/Sample/Sample.xcodeproj/project.pbxproj +++ b/examples/Sample/Sample.xcodeproj/project.pbxproj @@ -7,30 +7,20 @@ objects = { /* Begin PBXBuildFile section */ - 3430F6711C45C930007473A6 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3430F6701C45C930007473A6 /* AppDelegate.swift */; }; - 3430F6761C45C930007473A6 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3430F6741C45C930007473A6 /* Main.storyboard */; }; - 3430F6781C45C930007473A6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3430F6771C45C930007473A6 /* Assets.xcassets */; }; - 3430F67B1C45C930007473A6 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3430F6791C45C930007473A6 /* LaunchScreen.storyboard */; }; - 3430F6861C45C930007473A6 /* SampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3430F6851C45C930007473A6 /* SampleTests.swift */; }; - 3437406C1C6E7ECB0090FD6A /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3437406B1C6E7ECB0090FD6A /* ViewController.swift */; }; - 3467DAF31C4BF17900BA3DB8 /* Baymax.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 3467DAEF1C4BF17900BA3DB8 /* Baymax.jpg */; }; - 3467DAF41C4BF17900BA3DB8 /* BB8.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 3467DAF01C4BF17900BA3DB8 /* BB8.jpg */; }; - 3467DAF51C4BF17900BA3DB8 /* Stitch.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 3467DAF11C4BF17900BA3DB8 /* Stitch.jpg */; }; - 3467DAF61C4BF17900BA3DB8 /* Images.zip in Resources */ = {isa = PBXBuildFile; fileRef = 3467DAF21C4BF17900BA3DB8 /* Images.zip */; }; + 48A199B61D8C53AC00C443D3 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 48A199B41D8C53AC00C443D3 /* Main.storyboard */; }; + 48A199B81D8C53AC00C443D3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 48A199B71D8C53AC00C443D3 /* Assets.xcassets */; }; + 48A199BB1D8C53AC00C443D3 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 48A199B91D8C53AC00C443D3 /* LaunchScreen.storyboard */; }; + 48A199C51D8C53DB00C443D3 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48A199C31D8C53DB00C443D3 /* AppDelegate.swift */; }; + 48A199C81D8C53E200C443D3 /* MainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48A199C71D8C53E200C443D3 /* MainViewController.swift */; }; + 48A199CD1D8C546000C443D3 /* Baymax.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 48A199C91D8C546000C443D3 /* Baymax.jpg */; }; + 48A199CE1D8C546000C443D3 /* BB8.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 48A199CA1D8C546000C443D3 /* BB8.jpg */; }; + 48A199CF1D8C546000C443D3 /* Images.zip in Resources */ = {isa = PBXBuildFile; fileRef = 48A199CB1D8C546000C443D3 /* Images.zip */; }; + 48A199D01D8C546000C443D3 /* Stitch.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 48A199CC1D8C546000C443D3 /* Stitch.jpg */; }; + 48A24C331D8C59250044C697 /* FileBrowser.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 48A24C321D8C59250044C697 /* FileBrowser.framework */; }; /* End PBXBuildFile section */ -/* Begin PBXContainerItemProxy section */ - 3430F6821C45C930007473A6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 3430F6651C45C930007473A6 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 3430F66C1C45C930007473A6; - remoteInfo = Sample; - }; -/* End PBXContainerItemProxy section */ - /* Begin PBXCopyFilesBuildPhase section */ - 3430F69D1C45C949007473A6 /* Embed Frameworks */ = { + 48A199DD1D8C564100C443D3 /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; @@ -43,95 +33,109 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 3430F66D1C45C930007473A6 /* Sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Sample.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 3430F6701C45C930007473A6 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 3430F6751C45C930007473A6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 3430F6771C45C930007473A6 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 3430F67A1C45C930007473A6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 3430F67C1C45C930007473A6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 3430F6811C45C930007473A6 /* SampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 3430F6851C45C930007473A6 /* SampleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleTests.swift; sourceTree = ""; }; - 3430F6871C45C930007473A6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 3437406B1C6E7ECB0090FD6A /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - 3467DAEF1C4BF17900BA3DB8 /* Baymax.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = Baymax.jpg; sourceTree = ""; }; - 3467DAF01C4BF17900BA3DB8 /* BB8.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = BB8.jpg; sourceTree = ""; }; - 3467DAF11C4BF17900BA3DB8 /* Stitch.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = Stitch.jpg; sourceTree = ""; }; - 3467DAF21C4BF17900BA3DB8 /* Images.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = Images.zip; sourceTree = ""; }; + 48A199AD1D8C53AC00C443D3 /* Sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Sample.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 48A199B51D8C53AC00C443D3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 48A199B71D8C53AC00C443D3 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 48A199BA1D8C53AC00C443D3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 48A199C31D8C53DB00C443D3 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = "Supporting Files/AppDelegate.swift"; sourceTree = ""; }; + 48A199C41D8C53DB00C443D3 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = "Supporting Files/Info.plist"; sourceTree = ""; }; + 48A199C71D8C53E200C443D3 /* MainViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MainViewController.swift; path = "View Controller/MainViewController.swift"; sourceTree = ""; }; + 48A199C91D8C546000C443D3 /* Baymax.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = Baymax.jpg; sourceTree = ""; }; + 48A199CA1D8C546000C443D3 /* BB8.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = BB8.jpg; sourceTree = ""; }; + 48A199CB1D8C546000C443D3 /* Images.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = Images.zip; sourceTree = ""; }; + 48A199CC1D8C546000C443D3 /* Stitch.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = Stitch.jpg; sourceTree = ""; }; + 48A24C321D8C59250044C697 /* FileBrowser.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FileBrowser.framework; path = "../../../../Library/Developer/Xcode/DerivedData/FileBrowserWorkspace-gvwbufuzyigeyaecovnmsyswnfyi/Build/Products/Debug-iphoneos/FileBrowser.framework"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 3430F66A1C45C930007473A6 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 3430F67E1C45C930007473A6 /* Frameworks */ = { + 48A199AA1D8C53AC00C443D3 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 48A24C331D8C59250044C697 /* FileBrowser.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 3430F6641C45C930007473A6 = { + 48A199A41D8C53AC00C443D3 = { isa = PBXGroup; children = ( - 3430F66F1C45C930007473A6 /* Sample */, - 3430F6841C45C930007473A6 /* SampleTests */, - 3430F66E1C45C930007473A6 /* Products */, + 48A199AF1D8C53AC00C443D3 /* Sample */, + 48A199AE1D8C53AC00C443D3 /* Products */, + 48A24C2F1D8C57390044C697 /* Frameworks */, ); sourceTree = ""; }; - 3430F66E1C45C930007473A6 /* Products */ = { + 48A199AE1D8C53AC00C443D3 /* Products */ = { isa = PBXGroup; children = ( - 3430F66D1C45C930007473A6 /* Sample.app */, - 3430F6811C45C930007473A6 /* SampleTests.xctest */, + 48A199AD1D8C53AC00C443D3 /* Sample.app */, ); name = Products; sourceTree = ""; }; - 3430F66F1C45C930007473A6 /* Sample */ = { + 48A199AF1D8C53AC00C443D3 /* Sample */ = { isa = PBXGroup; children = ( - 3430F6701C45C930007473A6 /* AppDelegate.swift */, - 3437406B1C6E7ECB0090FD6A /* ViewController.swift */, - 3467DAEF1C4BF17900BA3DB8 /* Baymax.jpg */, - 3467DAF01C4BF17900BA3DB8 /* BB8.jpg */, - 3467DAF11C4BF17900BA3DB8 /* Stitch.jpg */, - 3467DAF21C4BF17900BA3DB8 /* Images.zip */, - 3430F6741C45C930007473A6 /* Main.storyboard */, - 3430F6771C45C930007473A6 /* Assets.xcassets */, - 3430F6791C45C930007473A6 /* LaunchScreen.storyboard */, - 3430F67C1C45C930007473A6 /* Info.plist */, + 48A199D21D8C546F00C443D3 /* View Controller */, + 48A199C21D8C53B700C443D3 /* Supporting Files */, ); path = Sample; sourceTree = ""; }; - 3430F6841C45C930007473A6 /* SampleTests */ = { + 48A199C21D8C53B700C443D3 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 48A199D11D8C546500C443D3 /* Resources */, + 48A199C31D8C53DB00C443D3 /* AppDelegate.swift */, + 48A199C41D8C53DB00C443D3 /* Info.plist */, + 48A199B41D8C53AC00C443D3 /* Main.storyboard */, + 48A199B71D8C53AC00C443D3 /* Assets.xcassets */, + 48A199B91D8C53AC00C443D3 /* LaunchScreen.storyboard */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 48A199D11D8C546500C443D3 /* Resources */ = { + isa = PBXGroup; + children = ( + 48A199C91D8C546000C443D3 /* Baymax.jpg */, + 48A199CA1D8C546000C443D3 /* BB8.jpg */, + 48A199CB1D8C546000C443D3 /* Images.zip */, + 48A199CC1D8C546000C443D3 /* Stitch.jpg */, + ); + name = Resources; + sourceTree = ""; + }; + 48A199D21D8C546F00C443D3 /* View Controller */ = { isa = PBXGroup; children = ( - 3430F6851C45C930007473A6 /* SampleTests.swift */, - 3430F6871C45C930007473A6 /* Info.plist */, + 48A199C71D8C53E200C443D3 /* MainViewController.swift */, ); - path = SampleTests; + name = "View Controller"; + sourceTree = ""; + }; + 48A24C2F1D8C57390044C697 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 48A24C321D8C59250044C697 /* FileBrowser.framework */, + ); + name = Frameworks; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 3430F66C1C45C930007473A6 /* Sample */ = { + 48A199AC1D8C53AC00C443D3 /* Sample */ = { isa = PBXNativeTarget; - buildConfigurationList = 3430F68A1C45C930007473A6 /* Build configuration list for PBXNativeTarget "Sample" */; + buildConfigurationList = 48A199BF1D8C53AC00C443D3 /* Build configuration list for PBXNativeTarget "Sample" */; buildPhases = ( - 3430F6691C45C930007473A6 /* Sources */, - 3430F66A1C45C930007473A6 /* Frameworks */, - 3430F66B1C45C930007473A6 /* Resources */, - 3430F69D1C45C949007473A6 /* Embed Frameworks */, + 48A199A91D8C53AC00C443D3 /* Sources */, + 48A199AA1D8C53AC00C443D3 /* Frameworks */, + 48A199AB1D8C53AC00C443D3 /* Resources */, + 48A199DD1D8C564100C443D3 /* Embed Frameworks */, ); buildRules = ( ); @@ -139,47 +143,28 @@ ); name = Sample; productName = Sample; - productReference = 3430F66D1C45C930007473A6 /* Sample.app */; + productReference = 48A199AD1D8C53AC00C443D3 /* Sample.app */; productType = "com.apple.product-type.application"; }; - 3430F6801C45C930007473A6 /* SampleTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 3430F68D1C45C930007473A6 /* Build configuration list for PBXNativeTarget "SampleTests" */; - buildPhases = ( - 3430F67D1C45C930007473A6 /* Sources */, - 3430F67E1C45C930007473A6 /* Frameworks */, - 3430F67F1C45C930007473A6 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 3430F6831C45C930007473A6 /* PBXTargetDependency */, - ); - name = SampleTests; - productName = SampleTests; - productReference = 3430F6811C45C930007473A6 /* SampleTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ - 3430F6651C45C930007473A6 /* Project object */ = { + 48A199A51D8C53AC00C443D3 /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 0720; - ORGANIZATIONNAME = "Roy Marmelstein"; + LastSwiftUpdateCheck = 0800; + LastUpgradeCheck = 0800; + ORGANIZATIONNAME = "Mihail Șalari"; TargetAttributes = { - 3430F66C1C45C930007473A6 = { - CreatedOnToolsVersion = 7.2; - }; - 3430F6801C45C930007473A6 = { - CreatedOnToolsVersion = 7.2; - TestTargetID = 3430F66C1C45C930007473A6; + 48A199AC1D8C53AC00C443D3 = { + CreatedOnToolsVersion = 8.0; + DevelopmentTeam = U82TG7992X; + LastSwiftMigration = 0800; + ProvisioningStyle = Automatic; }; }; }; - buildConfigurationList = 3430F6681C45C930007473A6 /* Build configuration list for PBXProject "Sample" */; + buildConfigurationList = 48A199A81D8C53AC00C443D3 /* Build configuration list for PBXProject "Sample" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; @@ -187,82 +172,58 @@ en, Base, ); - mainGroup = 3430F6641C45C930007473A6; - productRefGroup = 3430F66E1C45C930007473A6 /* Products */; + mainGroup = 48A199A41D8C53AC00C443D3; + productRefGroup = 48A199AE1D8C53AC00C443D3 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( - 3430F66C1C45C930007473A6 /* Sample */, - 3430F6801C45C930007473A6 /* SampleTests */, + 48A199AC1D8C53AC00C443D3 /* Sample */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - 3430F66B1C45C930007473A6 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 3467DAF41C4BF17900BA3DB8 /* BB8.jpg in Resources */, - 3467DAF51C4BF17900BA3DB8 /* Stitch.jpg in Resources */, - 3430F67B1C45C930007473A6 /* LaunchScreen.storyboard in Resources */, - 3467DAF61C4BF17900BA3DB8 /* Images.zip in Resources */, - 3467DAF31C4BF17900BA3DB8 /* Baymax.jpg in Resources */, - 3430F6781C45C930007473A6 /* Assets.xcassets in Resources */, - 3430F6761C45C930007473A6 /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 3430F67F1C45C930007473A6 /* Resources */ = { + 48A199AB1D8C53AC00C443D3 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 48A199BB1D8C53AC00C443D3 /* LaunchScreen.storyboard in Resources */, + 48A199CF1D8C546000C443D3 /* Images.zip in Resources */, + 48A199B81D8C53AC00C443D3 /* Assets.xcassets in Resources */, + 48A199B61D8C53AC00C443D3 /* Main.storyboard in Resources */, + 48A199CD1D8C546000C443D3 /* Baymax.jpg in Resources */, + 48A199D01D8C546000C443D3 /* Stitch.jpg in Resources */, + 48A199CE1D8C546000C443D3 /* BB8.jpg in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - 3430F6691C45C930007473A6 /* Sources */ = { + 48A199A91D8C53AC00C443D3 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 3437406C1C6E7ECB0090FD6A /* ViewController.swift in Sources */, - 3430F6711C45C930007473A6 /* AppDelegate.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 3430F67D1C45C930007473A6 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 3430F6861C45C930007473A6 /* SampleTests.swift in Sources */, + 48A199C81D8C53E200C443D3 /* MainViewController.swift in Sources */, + 48A199C51D8C53DB00C443D3 /* AppDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXTargetDependency section */ - 3430F6831C45C930007473A6 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 3430F66C1C45C930007473A6 /* Sample */; - targetProxy = 3430F6821C45C930007473A6 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - /* Begin PBXVariantGroup section */ - 3430F6741C45C930007473A6 /* Main.storyboard */ = { + 48A199B41D8C53AC00C443D3 /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( - 3430F6751C45C930007473A6 /* Base */, + 48A199B51D8C53AC00C443D3 /* Base */, ); name = Main.storyboard; sourceTree = ""; }; - 3430F6791C45C930007473A6 /* LaunchScreen.storyboard */ = { + 48A199B91D8C53AC00C443D3 /* LaunchScreen.storyboard */ = { isa = PBXVariantGroup; children = ( - 3430F67A1C45C930007473A6 /* Base */, + 48A199BA1D8C53AC00C443D3 /* Base */, ); name = LaunchScreen.storyboard; sourceTree = ""; @@ -270,10 +231,11 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ - 3430F6881C45C930007473A6 /* Debug */ = { + 48A199BD1D8C53AC00C443D3 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -281,10 +243,13 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVES = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -306,18 +271,21 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; - 3430F6891C45C930007473A6 /* Release */ = { + 48A199BE1D8C53AC00C443D3 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -325,10 +293,13 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVES = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -344,92 +315,74 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; name = Release; }; - 3430F68B1C45C930007473A6 /* Debug */ = { + 48A199C01D8C53AC00C443D3 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = Sample/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + CLANG_ENABLE_MODULES = YES; + DEVELOPMENT_TEAM = U82TG7992X; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Sample/Frameworks", + ); + INFOPLIST_FILE = "$(SRCROOT)/Sample/Supporting Files/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.roymarmelstein.Sample; + PRODUCT_BUNDLE_IDENTIFIER = com.mihailsalari.Sample; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; }; name = Debug; }; - 3430F68C1C45C930007473A6 /* Release */ = { + 48A199C11D8C53AC00C443D3 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = Sample/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + CLANG_ENABLE_MODULES = YES; + DEVELOPMENT_TEAM = U82TG7992X; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Sample/Frameworks", + ); + INFOPLIST_FILE = "$(SRCROOT)/Sample/Supporting Files/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.roymarmelstein.Sample; + PRODUCT_BUNDLE_IDENTIFIER = com.mihailsalari.Sample; PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; - 3430F68E1C45C930007473A6 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - INFOPLIST_FILE = SampleTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.roymarmelstein.SampleTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Sample.app/Sample"; - }; - name = Debug; - }; - 3430F68F1C45C930007473A6 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - INFOPLIST_FILE = SampleTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.roymarmelstein.SampleTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Sample.app/Sample"; + SWIFT_VERSION = 3.0; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 3430F6681C45C930007473A6 /* Build configuration list for PBXProject "Sample" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 3430F6881C45C930007473A6 /* Debug */, - 3430F6891C45C930007473A6 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 3430F68A1C45C930007473A6 /* Build configuration list for PBXNativeTarget "Sample" */ = { + 48A199A81D8C53AC00C443D3 /* Build configuration list for PBXProject "Sample" */ = { isa = XCConfigurationList; buildConfigurations = ( - 3430F68B1C45C930007473A6 /* Debug */, - 3430F68C1C45C930007473A6 /* Release */, + 48A199BD1D8C53AC00C443D3 /* Debug */, + 48A199BE1D8C53AC00C443D3 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 3430F68D1C45C930007473A6 /* Build configuration list for PBXNativeTarget "SampleTests" */ = { + 48A199BF1D8C53AC00C443D3 /* Build configuration list for PBXNativeTarget "Sample" */ = { isa = XCConfigurationList; buildConfigurations = ( - 3430F68E1C45C930007473A6 /* Debug */, - 3430F68F1C45C930007473A6 /* Release */, + 48A199C01D8C53AC00C443D3 /* Debug */, + 48A199C11D8C53AC00C443D3 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; - rootObject = 3430F6651C45C930007473A6 /* Project object */; + rootObject = 48A199A51D8C53AC00C443D3 /* Project object */; } diff --git a/examples/Sample/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme b/examples/Sample/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme deleted file mode 100644 index 4d43f07..0000000 --- a/examples/Sample/Sample.xcodeproj/xcshareddata/xcschemes/Sample.xcscheme +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/Sample/Sample/AppDelegate.swift b/examples/Sample/Sample/AppDelegate.swift deleted file mode 100644 index 2ec6d1e..0000000 --- a/examples/Sample/Sample/AppDelegate.swift +++ /dev/null @@ -1,75 +0,0 @@ -// -// AppDelegate.swift -// Sample -// -// Created by Roy Marmelstein on 13/01/2016. -// Copyright © 2016 Roy Marmelstein. All rights reserved. -// - -import UIKit - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - - func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { - if NSUserDefaults.standardUserDefaults().boolForKey("firstLaunch") == false { - NSUserDefaults.standardUserDefaults().setBool(true, forKey: "firstLaunch") - NSUserDefaults.standardUserDefaults().synchronize() - let fileManager = NSFileManager.defaultManager() - let fileNames = ["Baymax.jpg", "BB8.jpg", "Stitch.jpg", "Info.plist"] - let documentsUrl = fileManager.URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask)[0] as NSURL - let bundleUrl = NSBundle.mainBundle().resourceURL - // Copy images to documents folder - for file in fileNames { - if let srcPath = bundleUrl?.URLByAppendingPathComponent(file).path, let toPath = documentsUrl.URLByAppendingPathComponent(file).path{ - do { - try fileManager.copyItemAtPath(srcPath, toPath: toPath) - } catch {} - } - } - - // Copy zip file to an images directory - let imagesDirectoryURL = documentsUrl.URLByAppendingPathComponent("images") - let zipFileName = "Images.zip" - if let imagesDirectoryPath = imagesDirectoryURL.path { - do { - try fileManager.createDirectoryAtPath(imagesDirectoryPath, withIntermediateDirectories: false, attributes: nil) - if let srcPath = bundleUrl?.URLByAppendingPathComponent(zipFileName).path, let toPath = imagesDirectoryURL.URLByAppendingPathComponent(zipFileName).path{ - do { - try fileManager.copyItemAtPath(srcPath, toPath: toPath) - } catch {} - } - } catch {} - } - } - return true - } - - func applicationWillResignActive(application: UIApplication) { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. - } - - func applicationDidEnterBackground(application: UIApplication) { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. - } - - func applicationWillEnterForeground(application: UIApplication) { - // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. - } - - func applicationDidBecomeActive(application: UIApplication) { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - } - - func applicationWillTerminate(application: UIApplication) { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. - } - - -} - diff --git a/examples/Sample/Sample/Assets.xcassets/AppIcon.appiconset/Contents.json b/examples/Sample/Sample/Assets.xcassets/AppIcon.appiconset/Contents.json index 118c98f..36d2c80 100644 --- a/examples/Sample/Sample/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/examples/Sample/Sample/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -29,6 +29,36 @@ "idiom" : "iphone", "size" : "60x60", "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" } ], "info" : { diff --git a/examples/Sample/Sample/Assets.xcassets/Contents.json b/examples/Sample/Sample/Assets.xcassets/Contents.json deleted file mode 100644 index da4a164..0000000 --- a/examples/Sample/Sample/Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/examples/Sample/Sample/Assets.xcassets/File.imageset/738-document-1.png b/examples/Sample/Sample/Assets.xcassets/File.imageset/738-document-1.png deleted file mode 100644 index b604d45eedb687f3c5ba340f9c0a110c5fd81ed8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 226 zcmeAS@N?(olHy`uVBq!ia0vp^B0wy|!3HD~Z_Q5tQY$@O978;KlS|6V>`t9Hk#W>P zX2s3D)#ci8OZD{h{x>!>3b3tYe$?&|)9bG*9C!PI%FG!vWEz|@*R5N3H6y4%&y(%l zot>ZU6rDYd1fK9XwN1)VP;@?NBrtzrigd^6fG(aRX&T%f6Ffc$&WQOZ9B|udOXC3< zC5HnBY!g~VswMAE3S_?M+*0x{Lt>I#+6ybU!veN09?$y^7^E<6W9kzO6cQGl;jp=n afuSWONB5KG9(ACj89ZJ6T-G@yGywp2&{7=$ diff --git a/examples/Sample/Sample/Assets.xcassets/File.imageset/738-document-1@2x.png b/examples/Sample/Sample/Assets.xcassets/File.imageset/738-document-1@2x.png deleted file mode 100644 index 358af8b165fd3b6c9131221c3049291cd1bfefb9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 382 zcmV-^0fGLBP) z%?*M;6olE0O<0RJ0tf5xU<*=#Hen-hw-FNU0)1;j!a>Gi|KRXQNC-2${rL960aKRc z(OP>iiefKk%%kbL?iM;w*pk3Gu4`S_mry`cRn^-Kk+(IW!`$-%^_@4F6=c#*2F1P{ zw>QXSGC(9W{vTFq!*j;VH$~e|#`&Go9WJ!*G)3i)m-> c^ul)j0P7rU*O6)iod5s;07*qoM6N<$f}9JU=Kufz diff --git a/examples/Sample/Sample/Assets.xcassets/File.imageset/Contents.json b/examples/Sample/Sample/Assets.xcassets/File.imageset/Contents.json deleted file mode 100644 index 826f17f..0000000 --- a/examples/Sample/Sample/Assets.xcassets/File.imageset/Contents.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "738-document-1.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "738-document-1@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/examples/Sample/Sample/Assets.xcassets/Folder.imageset/710-folder.png b/examples/Sample/Sample/Assets.xcassets/Folder.imageset/710-folder.png deleted file mode 100644 index b1a422b6a9a232d05feb4588ca4ec9b03b5e32cd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 300 zcmV+{0n`48P)71Q{0002cy;FcRh))qKMt5Gw;Q6F&9W zFr1)C(g7&Is+0L4L=EC38iE1<@;B)gO>+kl!tQ3gsU;205P^^BGoL1HKG7HqEF>{GEnCL00001r;P)2xZ- z@4pNSoYZ$FpU>wqnam?LoF8%15co>F-9BzK8m$p?B?dReV(}U-Y$NXA;$F2{{TMbo zinD;?tOL6b%nrgvydie$_4)&@Q(wk)-7m0kKy>Lp;`*5*&nARk;rS{e#Ie0Z!Onvq zc!Hzf{ohaOo&-j;87gi@-4u?_WwY5ch&w#BBU-g4a(pzKxl2Y*?$+o{{%x9JvSO^gM47#l3)wTl8m`)-f8yll`9h2sKMe zfS%x{P9O>U(=44-3M7&7>NT18LE5gVcd*w*llTuxa=%n6b^q_FcTfdNI(8f`>L90T zk}&F^BsVx*)ImH@OkY{ P00000NkvXXu0mjf!H)|< diff --git a/examples/Sample/Sample/Assets.xcassets/Folder.imageset/Contents.json b/examples/Sample/Sample/Assets.xcassets/Folder.imageset/Contents.json deleted file mode 100644 index 8999357..0000000 --- a/examples/Sample/Sample/Assets.xcassets/Folder.imageset/Contents.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "710-folder.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "710-folder@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/examples/Sample/Sample/Base.lproj/LaunchScreen.storyboard b/examples/Sample/Sample/Base.lproj/LaunchScreen.storyboard index 78686cd..fdf3f97 100644 --- a/examples/Sample/Sample/Base.lproj/LaunchScreen.storyboard +++ b/examples/Sample/Sample/Base.lproj/LaunchScreen.storyboard @@ -1,8 +1,8 @@ - + - - + + @@ -14,9 +14,9 @@ - + - + diff --git a/examples/Sample/Sample/Base.lproj/Main.storyboard b/examples/Sample/Sample/Base.lproj/Main.storyboard index 53f254b..bb4bbb2 100644 --- a/examples/Sample/Sample/Base.lproj/Main.storyboard +++ b/examples/Sample/Sample/Base.lproj/Main.storyboard @@ -1,57 +1,57 @@ - + - + + - - - - - - - - - - - - - - - - - - + + - + - - + + - - + + - - - - - - + - + - + + + + + + + + + + + + + + + + + + + - + diff --git a/examples/Sample/Sample/Supporting Files/AppDelegate.swift b/examples/Sample/Sample/Supporting Files/AppDelegate.swift new file mode 100644 index 0000000..5be52d3 --- /dev/null +++ b/examples/Sample/Sample/Supporting Files/AppDelegate.swift @@ -0,0 +1,87 @@ +// +// AppDelegate.swift +// Sample +// +// Created by Mihail Șalari on 9/16/16. +// Copyright © 2016 Mihail Șalari. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + + self.populateTableViewWithFiles() + + return true + } + + func applicationWillResignActive(_ application: UIApplication) { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(_ application: UIApplication) { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(_ application: UIApplication) { + // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(_ application: UIApplication) { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + fileprivate func populateTableViewWithFiles() { + let defaultsKey = "firstLaunch" + let userDefaults = UserDefaults.standard + let fileManager = FileManager.default + let fileNames = ["Baymax.jpg", "BB8.jpg", "Stitch.jpg", "Info.plist"] + let documentsUrl = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] as URL + let bundleUrl = Bundle.main.resourceURL + + // Copy zip file to an images directory + let imagesDirectoryURL = documentsUrl.appendingPathComponent("images") + let zipFileName = "Images.zip" + let imagesDirectoryPath = imagesDirectoryURL.path + + if userDefaults.bool(forKey: defaultsKey) == false { + userDefaults.set(true, forKey: defaultsKey) + userDefaults.synchronize() + + // Copy images to documents folder + for file in fileNames { + if let srcPath = bundleUrl?.appendingPathComponent(file).path { + let toPath = documentsUrl.appendingPathComponent(file).path + do { + try fileManager.copyItem(atPath: srcPath, toPath: toPath) + } catch {} + } + } + + // Copy zip file to an images directory + do { + try fileManager.createDirectory(atPath: imagesDirectoryPath, withIntermediateDirectories: false, attributes: nil) + if let srcPath = bundleUrl?.appendingPathComponent(zipFileName).path { + let toPath = imagesDirectoryURL.appendingPathComponent(zipFileName).path + do { + try fileManager.copyItem(atPath: srcPath, toPath: toPath) + } catch {} + } + } catch {} + } + } +} + diff --git a/examples/Sample/Sample/Info.plist b/examples/Sample/Sample/Supporting Files/Info.plist similarity index 79% rename from examples/Sample/Sample/Info.plist rename to examples/Sample/Sample/Supporting Files/Info.plist index 6905cc6..d052473 100644 --- a/examples/Sample/Sample/Info.plist +++ b/examples/Sample/Sample/Supporting Files/Info.plist @@ -16,8 +16,6 @@ APPL CFBundleShortVersionString 1.0 - CFBundleSignature - ???? CFBundleVersion 1 LSRequiresIPhoneOS @@ -36,5 +34,12 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + diff --git a/examples/Sample/Sample/View Controller/MainViewController.swift b/examples/Sample/Sample/View Controller/MainViewController.swift new file mode 100644 index 0000000..c5594fe --- /dev/null +++ b/examples/Sample/Sample/View Controller/MainViewController.swift @@ -0,0 +1,32 @@ +// +// MainViewController.swift +// Sample +// +// Created by Mihail Șalari on 9/16/16. +// Copyright © 2016 Mihail Șalari. All rights reserved. +// + +import UIKit +import FileBrowser + +class MainViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view, typically from a nib. + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + // MARK: - FileBrowser + + @IBAction func showFileBrowser(sender: AnyObject) { + let file = FileBrowser() + present(file, animated: true, completion: nil) + //self.present(fileBrowser, animated: true, completion: nil) + } +} + diff --git a/examples/Sample/Sample/ViewController.swift b/examples/Sample/Sample/ViewController.swift deleted file mode 100644 index ec202b6..0000000 --- a/examples/Sample/Sample/ViewController.swift +++ /dev/null @@ -1,19 +0,0 @@ -// -// ViewController.swift -// Sample -// -// Created by Roy Marmelstein on 12/02/2016. -// Copyright © 2016 Roy Marmelstein. All rights reserved. -// - -import UIKit -import FileBrowser - -class ViewController: UIViewController { - - @IBAction func showFileBrowser(sender: AnyObject) { - let fileBrowser = FileBrowser() - self.presentViewController(fileBrowser, animated: true, completion: nil) - } - -} diff --git a/examples/Sample/SampleTests/Info.plist b/examples/Sample/SampleTests/Info.plist deleted file mode 100644 index ba72822..0000000 --- a/examples/Sample/SampleTests/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - - diff --git a/examples/Sample/SampleTests/SampleTests.swift b/examples/Sample/SampleTests/SampleTests.swift deleted file mode 100644 index e293980..0000000 --- a/examples/Sample/SampleTests/SampleTests.swift +++ /dev/null @@ -1,36 +0,0 @@ -// -// SampleTests.swift -// SampleTests -// -// Created by Roy Marmelstein on 13/01/2016. -// Copyright © 2016 Roy Marmelstein. All rights reserved. -// - -import XCTest -@testable import Sample - -class SampleTests: XCTestCase { - - override func setUp() { - super.setUp() - // Put setup code here. This method is called before the invocation of each test method in the class. - } - - override func tearDown() { - // Put teardown code here. This method is called after the invocation of each test method in the class. - super.tearDown() - } - - func testExample() { - // This is an example of a functional test case. - // Use XCTAssert and related functions to verify your tests produce the correct results. - } - - func testPerformanceExample() { - // This is an example of a performance test case. - self.measureBlock { - // Put the code you want to measure the time of here. - } - } - -} From 057ac3aaed1f07182aee65b4416af0becc79727a Mon Sep 17 00:00:00 2001 From: Roy Marmelstein Date: Mon, 19 Sep 2016 14:16:12 +0200 Subject: [PATCH 5/7] Fixing test --- FileBrowserTests/FileBrowserTests.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/FileBrowserTests/FileBrowserTests.swift b/FileBrowserTests/FileBrowserTests.swift index c18dcc5..286b019 100644 --- a/FileBrowserTests/FileBrowserTests.swift +++ b/FileBrowserTests/FileBrowserTests.swift @@ -22,7 +22,7 @@ class FileBrowserTests: XCTestCase { } func testGifFBFileParse() { - let filePath = NSBundle(forClass: FileBrowserTests.self).URLForResource("3crBXeO", withExtension: "gif")! + let filePath = Bundle(for: FileBrowserTests.self).url(forResource: "3crBXeO", withExtension: "gif")! let file = FBFile(filePath: filePath) XCTAssertEqual(file.filePath, filePath) XCTAssertEqual(file.isDirectory, false) @@ -31,7 +31,7 @@ class FileBrowserTests: XCTestCase { } func testJpgFBFileParse() { - let filePath = NSBundle(forClass: FileBrowserTests.self).URLForResource("Stitch", withExtension: "jpg")! + let filePath = Bundle(for: FileBrowserTests.self).url(forResource: "Stitch", withExtension: "jpg")! let file = FBFile(filePath: filePath) XCTAssertEqual(file.filePath, filePath) XCTAssertEqual(file.isDirectory, false) @@ -40,14 +40,14 @@ class FileBrowserTests: XCTestCase { } func testDirectoryFBFileParse() { - let filePath = NSBundle(forClass: FileBrowserTests.self).bundleURL + let filePath = Bundle(for: FileBrowserTests.self).bundleURL let file = FBFile(filePath: filePath) XCTAssertEqual(file.type, FBFileType.Directory) } func testDirectoryContentsParse() { let parser = FileParser.sharedInstance - let directoryPath = NSBundle(forClass: FileBrowserTests.self).bundleURL + let directoryPath = Bundle(for: FileBrowserTests.self).bundleURL let directoryContents = parser.filesForDirectory(directoryPath) XCTAssertTrue(directoryContents.count > 0) let stitchFile = directoryContents.filter({$0.displayName == "Stitch.jpg"}).first @@ -60,7 +60,7 @@ class FileBrowserTests: XCTestCase { func testCaseSensitiveExclusion() { let parser = FileParser.sharedInstance parser.excludesFileExtensions = ["gIf"] - let directoryPath = NSBundle(forClass: FileBrowserTests.self).bundleURL + let directoryPath = Bundle(for: FileBrowserTests.self).bundleURL let directoryContents = parser.filesForDirectory(directoryPath) for file in directoryContents { if let fileExtension = file.fileExtension { From cfe4dafe14e239cafe8b1f22633e6079d01a3298 Mon Sep 17 00:00:00 2001 From: Roy Marmelstein Date: Mon, 19 Sep 2016 14:21:30 +0200 Subject: [PATCH 6/7] Fix sample --- .../Sample/Sample.xcodeproj/project.pbxproj | 343 ++++++++---------- examples/Sample/Sample/AppDelegate.swift | 75 ---- 2 files changed, 143 insertions(+), 275 deletions(-) delete mode 100644 examples/Sample/Sample/AppDelegate.swift diff --git a/examples/Sample/Sample.xcodeproj/project.pbxproj b/examples/Sample/Sample.xcodeproj/project.pbxproj index 6375af8..87a3b67 100644 --- a/examples/Sample/Sample.xcodeproj/project.pbxproj +++ b/examples/Sample/Sample.xcodeproj/project.pbxproj @@ -7,30 +7,20 @@ objects = { /* Begin PBXBuildFile section */ - 3430F6711C45C930007473A6 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3430F6701C45C930007473A6 /* AppDelegate.swift */; }; - 3430F6761C45C930007473A6 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3430F6741C45C930007473A6 /* Main.storyboard */; }; - 3430F6781C45C930007473A6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3430F6771C45C930007473A6 /* Assets.xcassets */; }; - 3430F67B1C45C930007473A6 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3430F6791C45C930007473A6 /* LaunchScreen.storyboard */; }; - 3430F6861C45C930007473A6 /* SampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3430F6851C45C930007473A6 /* SampleTests.swift */; }; - 3437406C1C6E7ECB0090FD6A /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3437406B1C6E7ECB0090FD6A /* ViewController.swift */; }; - 3467DAF31C4BF17900BA3DB8 /* Baymax.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 3467DAEF1C4BF17900BA3DB8 /* Baymax.jpg */; }; - 3467DAF41C4BF17900BA3DB8 /* BB8.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 3467DAF01C4BF17900BA3DB8 /* BB8.jpg */; }; - 3467DAF51C4BF17900BA3DB8 /* Stitch.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 3467DAF11C4BF17900BA3DB8 /* Stitch.jpg */; }; - 3467DAF61C4BF17900BA3DB8 /* Images.zip in Resources */ = {isa = PBXBuildFile; fileRef = 3467DAF21C4BF17900BA3DB8 /* Images.zip */; }; + 48A199B61D8C53AC00C443D3 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 48A199B41D8C53AC00C443D3 /* Main.storyboard */; }; + 48A199B81D8C53AC00C443D3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 48A199B71D8C53AC00C443D3 /* Assets.xcassets */; }; + 48A199BB1D8C53AC00C443D3 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 48A199B91D8C53AC00C443D3 /* LaunchScreen.storyboard */; }; + 48A199C51D8C53DB00C443D3 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48A199C31D8C53DB00C443D3 /* AppDelegate.swift */; }; + 48A199C81D8C53E200C443D3 /* MainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48A199C71D8C53E200C443D3 /* MainViewController.swift */; }; + 48A199CD1D8C546000C443D3 /* Baymax.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 48A199C91D8C546000C443D3 /* Baymax.jpg */; }; + 48A199CE1D8C546000C443D3 /* BB8.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 48A199CA1D8C546000C443D3 /* BB8.jpg */; }; + 48A199CF1D8C546000C443D3 /* Images.zip in Resources */ = {isa = PBXBuildFile; fileRef = 48A199CB1D8C546000C443D3 /* Images.zip */; }; + 48A199D01D8C546000C443D3 /* Stitch.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 48A199CC1D8C546000C443D3 /* Stitch.jpg */; }; + 48A24C331D8C59250044C697 /* FileBrowser.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 48A24C321D8C59250044C697 /* FileBrowser.framework */; }; /* End PBXBuildFile section */ -/* Begin PBXContainerItemProxy section */ - 3430F6821C45C930007473A6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 3430F6651C45C930007473A6 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 3430F66C1C45C930007473A6; - remoteInfo = Sample; - }; -/* End PBXContainerItemProxy section */ - /* Begin PBXCopyFilesBuildPhase section */ - 3430F69D1C45C949007473A6 /* Embed Frameworks */ = { + 48A199DD1D8C564100C443D3 /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; @@ -43,95 +33,109 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 3430F66D1C45C930007473A6 /* Sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Sample.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 3430F6701C45C930007473A6 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 3430F6751C45C930007473A6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 3430F6771C45C930007473A6 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 3430F67A1C45C930007473A6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 3430F67C1C45C930007473A6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 3430F6811C45C930007473A6 /* SampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 3430F6851C45C930007473A6 /* SampleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleTests.swift; sourceTree = ""; }; - 3430F6871C45C930007473A6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 3437406B1C6E7ECB0090FD6A /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - 3467DAEF1C4BF17900BA3DB8 /* Baymax.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = Baymax.jpg; sourceTree = ""; }; - 3467DAF01C4BF17900BA3DB8 /* BB8.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = BB8.jpg; sourceTree = ""; }; - 3467DAF11C4BF17900BA3DB8 /* Stitch.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = Stitch.jpg; sourceTree = ""; }; - 3467DAF21C4BF17900BA3DB8 /* Images.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = Images.zip; sourceTree = ""; }; + 48A199AD1D8C53AC00C443D3 /* Sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Sample.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 48A199B51D8C53AC00C443D3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 48A199B71D8C53AC00C443D3 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 48A199BA1D8C53AC00C443D3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 48A199C31D8C53DB00C443D3 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = "Supporting Files/AppDelegate.swift"; sourceTree = ""; }; + 48A199C41D8C53DB00C443D3 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = "Supporting Files/Info.plist"; sourceTree = ""; }; + 48A199C71D8C53E200C443D3 /* MainViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MainViewController.swift; path = "View Controller/MainViewController.swift"; sourceTree = ""; }; + 48A199C91D8C546000C443D3 /* Baymax.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = Baymax.jpg; sourceTree = ""; }; + 48A199CA1D8C546000C443D3 /* BB8.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = BB8.jpg; sourceTree = ""; }; + 48A199CB1D8C546000C443D3 /* Images.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = Images.zip; sourceTree = ""; }; + 48A199CC1D8C546000C443D3 /* Stitch.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = Stitch.jpg; sourceTree = ""; }; + 48A24C321D8C59250044C697 /* FileBrowser.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FileBrowser.framework; path = "../../../../Library/Developer/Xcode/DerivedData/FileBrowserWorkspace-gvwbufuzyigeyaecovnmsyswnfyi/Build/Products/Debug-iphoneos/FileBrowser.framework"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 3430F66A1C45C930007473A6 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 3430F67E1C45C930007473A6 /* Frameworks */ = { + 48A199AA1D8C53AC00C443D3 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 48A24C331D8C59250044C697 /* FileBrowser.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 3430F6641C45C930007473A6 = { + 48A199A41D8C53AC00C443D3 = { isa = PBXGroup; children = ( - 3430F66F1C45C930007473A6 /* Sample */, - 3430F6841C45C930007473A6 /* SampleTests */, - 3430F66E1C45C930007473A6 /* Products */, + 48A199AF1D8C53AC00C443D3 /* Sample */, + 48A199AE1D8C53AC00C443D3 /* Products */, + 48A24C2F1D8C57390044C697 /* Frameworks */, ); sourceTree = ""; }; - 3430F66E1C45C930007473A6 /* Products */ = { + 48A199AE1D8C53AC00C443D3 /* Products */ = { isa = PBXGroup; children = ( - 3430F66D1C45C930007473A6 /* Sample.app */, - 3430F6811C45C930007473A6 /* SampleTests.xctest */, + 48A199AD1D8C53AC00C443D3 /* Sample.app */, ); name = Products; sourceTree = ""; }; - 3430F66F1C45C930007473A6 /* Sample */ = { + 48A199AF1D8C53AC00C443D3 /* Sample */ = { isa = PBXGroup; children = ( - 3430F6701C45C930007473A6 /* AppDelegate.swift */, - 3437406B1C6E7ECB0090FD6A /* ViewController.swift */, - 3467DAEF1C4BF17900BA3DB8 /* Baymax.jpg */, - 3467DAF01C4BF17900BA3DB8 /* BB8.jpg */, - 3467DAF11C4BF17900BA3DB8 /* Stitch.jpg */, - 3467DAF21C4BF17900BA3DB8 /* Images.zip */, - 3430F6741C45C930007473A6 /* Main.storyboard */, - 3430F6771C45C930007473A6 /* Assets.xcassets */, - 3430F6791C45C930007473A6 /* LaunchScreen.storyboard */, - 3430F67C1C45C930007473A6 /* Info.plist */, + 48A199D21D8C546F00C443D3 /* View Controller */, + 48A199C21D8C53B700C443D3 /* Supporting Files */, ); path = Sample; sourceTree = ""; }; - 3430F6841C45C930007473A6 /* SampleTests */ = { + 48A199C21D8C53B700C443D3 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 48A199D11D8C546500C443D3 /* Resources */, + 48A199C31D8C53DB00C443D3 /* AppDelegate.swift */, + 48A199C41D8C53DB00C443D3 /* Info.plist */, + 48A199B41D8C53AC00C443D3 /* Main.storyboard */, + 48A199B71D8C53AC00C443D3 /* Assets.xcassets */, + 48A199B91D8C53AC00C443D3 /* LaunchScreen.storyboard */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 48A199D11D8C546500C443D3 /* Resources */ = { + isa = PBXGroup; + children = ( + 48A199C91D8C546000C443D3 /* Baymax.jpg */, + 48A199CA1D8C546000C443D3 /* BB8.jpg */, + 48A199CB1D8C546000C443D3 /* Images.zip */, + 48A199CC1D8C546000C443D3 /* Stitch.jpg */, + ); + name = Resources; + sourceTree = ""; + }; + 48A199D21D8C546F00C443D3 /* View Controller */ = { isa = PBXGroup; children = ( - 3430F6851C45C930007473A6 /* SampleTests.swift */, - 3430F6871C45C930007473A6 /* Info.plist */, + 48A199C71D8C53E200C443D3 /* MainViewController.swift */, ); - path = SampleTests; + name = "View Controller"; + sourceTree = ""; + }; + 48A24C2F1D8C57390044C697 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 48A24C321D8C59250044C697 /* FileBrowser.framework */, + ); + name = Frameworks; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 3430F66C1C45C930007473A6 /* Sample */ = { + 48A199AC1D8C53AC00C443D3 /* Sample */ = { isa = PBXNativeTarget; - buildConfigurationList = 3430F68A1C45C930007473A6 /* Build configuration list for PBXNativeTarget "Sample" */; + buildConfigurationList = 48A199BF1D8C53AC00C443D3 /* Build configuration list for PBXNativeTarget "Sample" */; buildPhases = ( - 3430F6691C45C930007473A6 /* Sources */, - 3430F66A1C45C930007473A6 /* Frameworks */, - 3430F66B1C45C930007473A6 /* Resources */, - 3430F69D1C45C949007473A6 /* Embed Frameworks */, + 48A199A91D8C53AC00C443D3 /* Sources */, + 48A199AA1D8C53AC00C443D3 /* Frameworks */, + 48A199AB1D8C53AC00C443D3 /* Resources */, + 48A199DD1D8C564100C443D3 /* Embed Frameworks */, ); buildRules = ( ); @@ -139,49 +143,28 @@ ); name = Sample; productName = Sample; - productReference = 3430F66D1C45C930007473A6 /* Sample.app */; + productReference = 48A199AD1D8C53AC00C443D3 /* Sample.app */; productType = "com.apple.product-type.application"; }; - 3430F6801C45C930007473A6 /* SampleTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 3430F68D1C45C930007473A6 /* Build configuration list for PBXNativeTarget "SampleTests" */; - buildPhases = ( - 3430F67D1C45C930007473A6 /* Sources */, - 3430F67E1C45C930007473A6 /* Frameworks */, - 3430F67F1C45C930007473A6 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 3430F6831C45C930007473A6 /* PBXTargetDependency */, - ); - name = SampleTests; - productName = SampleTests; - productReference = 3430F6811C45C930007473A6 /* SampleTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ - 3430F6651C45C930007473A6 /* Project object */ = { + 48A199A51D8C53AC00C443D3 /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 0720; - ORGANIZATIONNAME = "Roy Marmelstein"; + LastSwiftUpdateCheck = 0800; + LastUpgradeCheck = 0800; + ORGANIZATIONNAME = "Mihail Șalari"; TargetAttributes = { - 3430F66C1C45C930007473A6 = { - CreatedOnToolsVersion = 7.2; - LastSwiftMigration = 0800; - }; - 3430F6801C45C930007473A6 = { - CreatedOnToolsVersion = 7.2; + 48A199AC1D8C53AC00C443D3 = { + CreatedOnToolsVersion = 8.0; + DevelopmentTeam = U82TG7992X; LastSwiftMigration = 0800; - TestTargetID = 3430F66C1C45C930007473A6; + ProvisioningStyle = Automatic; }; }; }; - buildConfigurationList = 3430F6681C45C930007473A6 /* Build configuration list for PBXProject "Sample" */; + buildConfigurationList = 48A199A81D8C53AC00C443D3 /* Build configuration list for PBXProject "Sample" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; @@ -189,82 +172,58 @@ en, Base, ); - mainGroup = 3430F6641C45C930007473A6; - productRefGroup = 3430F66E1C45C930007473A6 /* Products */; + mainGroup = 48A199A41D8C53AC00C443D3; + productRefGroup = 48A199AE1D8C53AC00C443D3 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( - 3430F66C1C45C930007473A6 /* Sample */, - 3430F6801C45C930007473A6 /* SampleTests */, + 48A199AC1D8C53AC00C443D3 /* Sample */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - 3430F66B1C45C930007473A6 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 3467DAF41C4BF17900BA3DB8 /* BB8.jpg in Resources */, - 3467DAF51C4BF17900BA3DB8 /* Stitch.jpg in Resources */, - 3430F67B1C45C930007473A6 /* LaunchScreen.storyboard in Resources */, - 3467DAF61C4BF17900BA3DB8 /* Images.zip in Resources */, - 3467DAF31C4BF17900BA3DB8 /* Baymax.jpg in Resources */, - 3430F6781C45C930007473A6 /* Assets.xcassets in Resources */, - 3430F6761C45C930007473A6 /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 3430F67F1C45C930007473A6 /* Resources */ = { + 48A199AB1D8C53AC00C443D3 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 48A199BB1D8C53AC00C443D3 /* LaunchScreen.storyboard in Resources */, + 48A199CF1D8C546000C443D3 /* Images.zip in Resources */, + 48A199B81D8C53AC00C443D3 /* Assets.xcassets in Resources */, + 48A199B61D8C53AC00C443D3 /* Main.storyboard in Resources */, + 48A199CD1D8C546000C443D3 /* Baymax.jpg in Resources */, + 48A199D01D8C546000C443D3 /* Stitch.jpg in Resources */, + 48A199CE1D8C546000C443D3 /* BB8.jpg in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - 3430F6691C45C930007473A6 /* Sources */ = { + 48A199A91D8C53AC00C443D3 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 3437406C1C6E7ECB0090FD6A /* ViewController.swift in Sources */, - 3430F6711C45C930007473A6 /* AppDelegate.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 3430F67D1C45C930007473A6 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 3430F6861C45C930007473A6 /* SampleTests.swift in Sources */, + 48A199C81D8C53E200C443D3 /* MainViewController.swift in Sources */, + 48A199C51D8C53DB00C443D3 /* AppDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXTargetDependency section */ - 3430F6831C45C930007473A6 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 3430F66C1C45C930007473A6 /* Sample */; - targetProxy = 3430F6821C45C930007473A6 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - /* Begin PBXVariantGroup section */ - 3430F6741C45C930007473A6 /* Main.storyboard */ = { + 48A199B41D8C53AC00C443D3 /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( - 3430F6751C45C930007473A6 /* Base */, + 48A199B51D8C53AC00C443D3 /* Base */, ); name = Main.storyboard; sourceTree = ""; }; - 3430F6791C45C930007473A6 /* LaunchScreen.storyboard */ = { + 48A199B91D8C53AC00C443D3 /* LaunchScreen.storyboard */ = { isa = PBXVariantGroup; children = ( - 3430F67A1C45C930007473A6 /* Base */, + 48A199BA1D8C53AC00C443D3 /* Base */, ); name = LaunchScreen.storyboard; sourceTree = ""; @@ -272,10 +231,11 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ - 3430F6881C45C930007473A6 /* Debug */ = { + 48A199BD1D8C53AC00C443D3 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -283,10 +243,13 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVES = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -308,18 +271,21 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; - 3430F6891C45C930007473A6 /* Release */ = { + 48A199BE1D8C53AC00C443D3 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -327,10 +293,13 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVES = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -346,96 +315,70 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; name = Release; }; - 3430F68B1C45C930007473A6 /* Debug */ = { + 48A199C01D8C53AC00C443D3 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = Sample/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + CLANG_ENABLE_MODULES = YES; + DEVELOPMENT_TEAM = U82TG7992X; + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; + INFOPLIST_FILE = "$(SRCROOT)/Sample/Supporting Files/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.roymarmelstein.Sample; + PRODUCT_BUNDLE_IDENTIFIER = com.mihailsalari.Sample; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 2.3; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; }; name = Debug; }; - 3430F68C1C45C930007473A6 /* Release */ = { + 48A199C11D8C53AC00C443D3 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - INFOPLIST_FILE = Sample/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + CLANG_ENABLE_MODULES = YES; + DEVELOPMENT_TEAM = U82TG7992X; + FRAMEWORK_SEARCH_PATHS = "$(inherited)"; + INFOPLIST_FILE = "$(SRCROOT)/Sample/Supporting Files/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.roymarmelstein.Sample; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 2.3; - }; - name = Release; - }; - 3430F68E1C45C930007473A6 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - INFOPLIST_FILE = SampleTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.roymarmelstein.SampleTests; + PRODUCT_BUNDLE_IDENTIFIER = com.mihailsalari.Sample; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 2.3; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Sample.app/Sample"; - }; - name = Debug; - }; - 3430F68F1C45C930007473A6 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - INFOPLIST_FILE = SampleTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.roymarmelstein.SampleTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 2.3; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Sample.app/Sample"; + SWIFT_VERSION = 3.0; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 3430F6681C45C930007473A6 /* Build configuration list for PBXProject "Sample" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 3430F6881C45C930007473A6 /* Debug */, - 3430F6891C45C930007473A6 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 3430F68A1C45C930007473A6 /* Build configuration list for PBXNativeTarget "Sample" */ = { + 48A199A81D8C53AC00C443D3 /* Build configuration list for PBXProject "Sample" */ = { isa = XCConfigurationList; buildConfigurations = ( - 3430F68B1C45C930007473A6 /* Debug */, - 3430F68C1C45C930007473A6 /* Release */, + 48A199BD1D8C53AC00C443D3 /* Debug */, + 48A199BE1D8C53AC00C443D3 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 3430F68D1C45C930007473A6 /* Build configuration list for PBXNativeTarget "SampleTests" */ = { + 48A199BF1D8C53AC00C443D3 /* Build configuration list for PBXNativeTarget "Sample" */ = { isa = XCConfigurationList; buildConfigurations = ( - 3430F68E1C45C930007473A6 /* Debug */, - 3430F68F1C45C930007473A6 /* Release */, + 48A199C01D8C53AC00C443D3 /* Debug */, + 48A199C11D8C53AC00C443D3 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; - rootObject = 3430F6651C45C930007473A6 /* Project object */; + rootObject = 48A199A51D8C53AC00C443D3 /* Project object */; } diff --git a/examples/Sample/Sample/AppDelegate.swift b/examples/Sample/Sample/AppDelegate.swift deleted file mode 100644 index d23393a..0000000 --- a/examples/Sample/Sample/AppDelegate.swift +++ /dev/null @@ -1,75 +0,0 @@ -// -// AppDelegate.swift -// Sample -// -// Created by Roy Marmelstein on 13/01/2016. -// Copyright © 2016 Roy Marmelstein. All rights reserved. -// - -import UIKit - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - - func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { - if NSUserDefaults.standardUserDefaults().boolForKey("firstLaunch") == false { - NSUserDefaults.standardUserDefaults().setBool(true, forKey: "firstLaunch") - NSUserDefaults.standardUserDefaults().synchronize() - let fileManager = NSFileManager.defaultManager() - let fileNames = ["Baymax.jpg", "BB8.jpg", "Stitch.jpg", "Info.plist"] - let documentsUrl = fileManager.URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask)[0] as NSURL - let bundleUrl = NSBundle.mainBundle().resourceURL - // Copy images to documents folder - for file in fileNames { - if let srcPath = bundleUrl?.URLByAppendingPathComponent(file)!.path, let toPath = documentsUrl.URLByAppendingPathComponent(file)!.path{ - do { - try fileManager.copyItemAtPath(srcPath, toPath: toPath) - } catch {} - } - } - - // Copy zip file to an images directory - let imagesDirectoryURL = documentsUrl.URLByAppendingPathComponent("images") - let zipFileName = "Images.zip" - if let imagesDirectoryPath = imagesDirectoryURL!.path { - do { - try fileManager.createDirectoryAtPath(imagesDirectoryPath, withIntermediateDirectories: false, attributes: nil) - if let srcPath = bundleUrl?.URLByAppendingPathComponent(zipFileName)!.path, let toPath = imagesDirectoryURL!.URLByAppendingPathComponent(zipFileName)!.path{ - do { - try fileManager.copyItemAtPath(srcPath, toPath: toPath) - } catch {} - } - } catch {} - } - } - return true - } - - func applicationWillResignActive(application: UIApplication) { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. - } - - func applicationDidEnterBackground(application: UIApplication) { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. - } - - func applicationWillEnterForeground(application: UIApplication) { - // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. - } - - func applicationDidBecomeActive(application: UIApplication) { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - } - - func applicationWillTerminate(application: UIApplication) { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. - } - - -} - From 8798ba3a2912ecd5c01096a64830183a03188a93 Mon Sep 17 00:00:00 2001 From: Roy Marmelstein Date: Mon, 19 Sep 2016 14:24:33 +0200 Subject: [PATCH 7/7] Release 0.2.0 --- .swift-version | 1 + .travis.yml | 4 +--- FileBrowser.podspec | 2 +- FileBrowser.xcodeproj/project.pbxproj | 8 ++++---- FileBrowser/Info.plist | 4 ++-- FileBrowserTests/Info.plist | 4 ++-- README.md | 4 ++-- build.sh | 4 ++-- 8 files changed, 15 insertions(+), 16 deletions(-) create mode 100644 .swift-version diff --git a/.swift-version b/.swift-version new file mode 100644 index 0000000..9f55b2c --- /dev/null +++ b/.swift-version @@ -0,0 +1 @@ +3.0 diff --git a/.travis.yml b/.travis.yml index 96e9b49..e1e0f7f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,9 +5,7 @@ env: - LC_CTYPE=en_US.UTF-8 - LANG=en_US.UTF-8 before_install: - - brew update || brew update - - brew outdated xctool || brew upgrade xctool - - gem install cocoapods + - gem install cocoapods --pre - xcrun simctl list install: echo "<3" env: diff --git a/FileBrowser.podspec b/FileBrowser.podspec index 6f84de4..2da9b4c 100644 --- a/FileBrowser.podspec +++ b/FileBrowser.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = "FileBrowser" - s.version = "0.1.4" + s.version = "0.2.0" s.summary = "Powerful iOS file browser in Swift." # This description is used to generate tags and improve search results. diff --git a/FileBrowser.xcodeproj/project.pbxproj b/FileBrowser.xcodeproj/project.pbxproj index bea4b78..d6fb649 100644 --- a/FileBrowser.xcodeproj/project.pbxproj +++ b/FileBrowser.xcodeproj/project.pbxproj @@ -371,7 +371,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 5; + CURRENT_PROJECT_VERSION = 6; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; @@ -421,7 +421,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 5; + CURRENT_PROJECT_VERSION = 6; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -451,7 +451,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 5; + DYLIB_CURRENT_VERSION = 6; DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = FileBrowser/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; @@ -472,7 +472,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 5; + DYLIB_CURRENT_VERSION = 6; DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = FileBrowser/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; diff --git a/FileBrowser/Info.plist b/FileBrowser/Info.plist index f06ec05..96c5e0b 100644 --- a/FileBrowser/Info.plist +++ b/FileBrowser/Info.plist @@ -15,11 +15,11 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 0.1.4 + 0.2.0 CFBundleSignature ???? CFBundleVersion - 5 + 6 NSPrincipalClass diff --git a/FileBrowserTests/Info.plist b/FileBrowserTests/Info.plist index 9417235..a7f3874 100644 --- a/FileBrowserTests/Info.plist +++ b/FileBrowserTests/Info.plist @@ -15,10 +15,10 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 0.1.4 + 0.2.0 CFBundleSignature ???? CFBundleVersion - 5 + 6 diff --git a/README.md b/README.md index 224bbd1..4aa7e7e 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ import FileBrowser To show the file browser, all you need to do is: ```swift let fileBrowser = FileBrowser() -self.presentViewController(fileBrowser, animated: true, completion: nil) +present(file, animated: true, completion: nil) ``` By default, the file browser will open in your app's documents directory. When users select a file, a preview will be displayed - offering an action sheet of options based on the file type. @@ -59,7 +59,7 @@ fileBrowser.excludesFilepaths = [secretFile] ### Setting up with [CocoaPods](http://cocoapods.org/?q=FileBrowser) ```ruby source 'https://github.com/CocoaPods/Specs.git' -pod 'FileBrowser', '~> 0.1' +pod 'FileBrowser', '~> 0.2' ``` ### Setting up with Carthage diff --git a/build.sh b/build.sh index 2bc9ef3..0a27da6 100755 --- a/build.sh +++ b/build.sh @@ -1,8 +1,8 @@ #!/bin/bash # **** Update me when new Xcode versions are released! **** -PLATFORM="platform=iOS Simulator,OS=9.2,name=iPhone 6" -SDK="iphonesimulator9.3" +PLATFORM="platform=iOS Simulator,OS=10.0,name=iPhone 7" +SDK="iphonesimulator10.0" # It is pitch black.