36 Commits

Author SHA1 Message Date
Roy Marmelstein b03284f584 Fix build script 2017-09-20 15:50:11 +02:00
Roy Marmelstein 5789117eb8 Release 1.0.0 2017-09-20 15:26:05 +02:00
Roy Marmelstein 288eef2edd Sweift 4 update settings 2017-09-20 15:23:52 +02:00
Roy Marmelstein 8eff0a225a Swift 4: fix issues 2017-09-20 15:09:54 +02:00
Roy Marmelstein d7360bef22 Merge pull request #34 from brendan09/swift4
Swift4 syntax & fix compilation issue
2017-09-20 15:06:39 +02:00
Brendan Lee 23d56ec66a Convert to swift4 (auto-convert option: minimize objc tags). Fix a compile error that arose from using an 'internal' class to retrieve a default value for a public function 2017-09-05 17:29:29 -04:00
Roy Marmelstein 7e439ee9d8 Release 0.3.0 2017-07-23 13:02:18 +02:00
Roy Marmelstein d7d7d106eb README update 2017-07-23 13:01:24 +02:00
Roy Marmelstein ea1d7e4f89 Consolidate initialisers 2017-07-23 12:48:11 +02:00
Roy Marmelstein e410390531 Merge pull request #25 from SrikanthKabadi/master
Fixed a crash on showing activity view controller when running on an iPad
2017-07-22 18:36:33 +02:00
Roy Marmelstein 5c6939aa3d Merge pull request #28 from orff/master
Add default tableViewController editing / delete support
2017-07-22 18:36:07 +02:00
Roy Marmelstein 399e1c093e Merge pull request #31 from chaoliu/master
Fix a typo in README.md
2017-07-22 18:32:54 +02:00
Mike Hill cbf1ce7874 bumper minor version 2017-07-21 10:23:36 -04:00
Michael Hill 659763f259 added support for optional dismiss button 2017-07-21 10:20:01 -04:00
Chao Liu 453c64808b fix typo 2017-06-18 08:40:35 +08:00
Michael Hill c8978ed444 custom init method to set up allowing editing 2017-04-30 15:52:15 -04:00
Michael Hill 40c72ba991 add first version of editing / delete. Might eventually need a spinner / better animations 2017-04-30 15:51:41 -04:00
Michael Hill f99535d27f added boolean to allowEditing which can be checked with tableView editing. Move prepareData lines to a seperate func for re-use 2017-04-30 15:50:38 -04:00
Michael Hill bd1f30a645 add function to delete an FBfile 2017-04-30 15:49:11 -04:00
Srikanth KV 5ef3ca958a Fixed a crash on showing activity view controller when running on an iPad. 2017-01-09 16:28:46 +05:30
Roy Marmelstein dbf7644559 README - fix typo 2016-10-07 08:36:30 +01:00
Roy Marmelstein c3360740ee Change codesigning 2016-09-19 21:55:37 +02:00
Roy Marmelstein ccd3d4fc77 Fix travis schemes 2016-09-19 15:06:25 +02:00
Roy Marmelstein 75fdcfcc46 Travis fixes 2016-09-19 14:42:51 +02:00
Roy Marmelstein d47a2c9a70 Delete gemfile 2016-09-19 14:26:07 +02:00
Roy Marmelstein 7fae9fa2df Merge branch 'swift3.0' 2016-09-19 14:24:43 +02:00
Roy Marmelstein 8798ba3a29 Release 0.2.0 2016-09-19 14:24:33 +02:00
Roy Marmelstein cfe4dafe14 Fix sample 2016-09-19 14:21:30 +02:00
Roy Marmelstein 057ac3aaed Fixing test 2016-09-19 14:16:12 +02:00
Roy Marmelstein 2d505e2401 Merge branch 'mihailsalari-master' into swift3.0 2016-09-19 14:14:24 +02:00
Roy Marmelstein ca26cfc5c1 Merge branch 'master' of https://github.com/mihailsalari/FileBrowser into mihailsalari-master
# Conflicts:
#	FileBrowser.xcodeproj/project.pbxproj
#	FileBrowser/PreviewManager.swift
#	examples/Sample/Podfile
#	examples/Sample/Sample.xcodeproj/project.pbxproj
#	examples/Sample/Sample/AppDelegate.swift
2016-09-19 14:14:17 +02:00
Roy Marmelstein aca8f7a50e Merge pull request #17 from humblehacker/swift2.3
Update to Swift 2.3 / Xcode 8 GM / CocoaPods 1.1.0.rc.1
2016-09-19 14:07:47 +02:00
Mihail Șalari ac3c3daefb Updated to Swift 3 2016-09-16 19:50:46 +03:00
Developer f379913f1d Updated to Swift 3, fixed bugs. 2016-09-16 17:13:25 +03:00
David Whetstone f95bac9ee5 Update Travis image to Xcode 8 2016-09-15 09:55:17 -07:00
David Whetstone ed5a54b19f Update to Swift 2.3 / Xcode 8 GM / CocoaPods 1.1.0.rc.1 2016-09-12 10:57:06 -07:00
42 changed files with 697 additions and 631 deletions
+3
View File
@@ -61,3 +61,6 @@ Carthage/Build
fastlane/report.xml
fastlane/screenshots
.DS_Store
examples/.DS_Store
examples/Sample/.DS_Store
+1
View File
@@ -0,0 +1 @@
4.0
+2 -4
View File
@@ -1,13 +1,11 @@
osx_image: xcode7.3
osx_image: xcode9
language: objective-c
env:
global:
- 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:
+2 -1
View File
@@ -8,7 +8,7 @@
Pod::Spec.new do |s|
s.name = "FileBrowser"
s.version = "0.1.4"
s.version = "1.0.0"
s.summary = "Powerful iOS file browser in Swift."
# This description is used to generate tags and improve search results.
@@ -32,6 +32,7 @@ Pod::Spec.new do |s|
s.source_files = "FileBrowser"
s.resources = "FileBrowser/Resources/*.*"
s.pod_target_xcconfig = { 'SWIFT_VERSION' => '4.0' }
# s.public_header_files = 'Pod/Classes/**/*.h'
s.frameworks = 'QuickLook', 'WebKit'
+35 -9
View File
@@ -254,14 +254,17 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 0720;
LastUpgradeCheck = 0900;
ORGANIZATIONNAME = "Roy Marmelstein";
TargetAttributes = {
344169531C67812400B93D28 = {
CreatedOnToolsVersion = 7.2.1;
LastSwiftMigration = 0900;
};
3441695D1C67812400B93D28 = {
CreatedOnToolsVersion = 7.2.1;
LastSwiftMigration = 0900;
ProvisioningStyle = Manual;
};
};
};
@@ -356,18 +359,27 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
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_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_IDENTITY = "-";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "-";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 5;
CURRENT_PROJECT_VERSION = 8;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
@@ -385,11 +397,12 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.2;
IPHONEOS_DEPLOYMENT_TARGET = 8.1;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
@@ -404,18 +417,27 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
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_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_IDENTITY = "-";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "-";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 5;
CURRENT_PROJECT_VERSION = 8;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
@@ -427,9 +449,11 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.2;
IPHONEOS_DEPLOYMENT_TARGET = 8.1;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
@@ -443,7 +467,7 @@
CLANG_ENABLE_MODULES = YES;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 5;
DYLIB_CURRENT_VERSION = 8;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = FileBrowser/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
@@ -462,7 +486,7 @@
CLANG_ENABLE_MODULES = YES;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 5;
DYLIB_CURRENT_VERSION = 8;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = FileBrowser/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
@@ -477,6 +501,7 @@
3441696C1C67812400B93D28 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = FileBrowserTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.roymarmelstein.FileBrowserTests;
@@ -487,6 +512,7 @@
3441696D1C67812400B93D28 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = FileBrowserTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.roymarmelstein.FileBrowserTests;
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0720"
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -26,6 +26,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
@@ -55,6 +56,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3441695D1C67812400B93D28"
BuildableName = "FileBrowserTests.xctest"
BlueprintName = "FileBrowserTests"
ReferencedContainer = "container:FileBrowser.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
+33 -23
View File
@@ -9,19 +9,31 @@
import Foundation
/// FBFile is a class representing a file in FileBrowser
public class FBFile: NSObject {
@objc open class FBFile: NSObject {
/// Display name. String.
public let displayName: String
@objc open let displayName: String
// is Directory. Bool.
public let isDirectory: Bool
open let isDirectory: Bool
/// File extension.
public let fileExtension: String?
open let fileExtension: String?
/// File attributes (including size, creation date etc).
public let fileAttributes: NSDictionary?
open let fileAttributes: NSDictionary?
/// NSURL file path.
public let filePath: NSURL
open let filePath: URL
// FBFileType
public let type: FBFileType
open let type: FBFileType
open func delete()
{
do
{
try FileManager.default.removeItem(at: self.filePath)
}
catch
{
print("An error occured when trying to delete file:\(self.filePath) Error:\(error)")
}
}
/**
Initialize an FBFile object with a filePath
@@ -30,7 +42,7 @@ public class FBFile: NSObject {
- returns: FBFile object.
*/
init(filePath: NSURL) {
init(filePath: URL) {
self.filePath = filePath
let isDirectory = checkDirectory(filePath)
self.isDirectory = isDirectory
@@ -49,7 +61,7 @@ public class FBFile: NSObject {
self.type = .Default
}
}
self.displayName = filePath.lastPathComponent ?? String()
self.displayName = filePath.lastPathComponent
}
}
@@ -82,16 +94,16 @@ public enum FBFileType: String {
- returns: UIImage for file type
*/
public func image() -> 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 +115,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 +128,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
+21 -24
View File
@@ -9,56 +9,53 @@
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
}
}
/**
Init to documents folder.
- returns: File browser view controller.
*/
public convenience init() {
let parser = FileParser.sharedInstance
let path = parser.documentsURL()
self.init(initialPath: path)
self.init(initialPath: path, allowEditing: true)
}
/**
Init to a custom directory path.
- parameter initialPath: NSURL filepath to containing directory.
- returns: File browser view controller.
*/
public convenience init(initialPath: NSURL) {
let fileListViewController = FileListViewController(initialPath: initialPath)
/// Initialise file browser.
///
/// - Parameters:
/// - initialPath: NSURL filepath to containing directory.
/// - allowEditing: Whether to allow editing.
/// - showCancelButton: Whether to show the cancel button.
public convenience init(initialPath: URL? = nil, allowEditing: Bool = false, showCancelButton: Bool = true) {
let validInitialPath = initialPath ?? FileParser.sharedInstance.documentsURL()
let fileListViewController = FileListViewController(initialPath: validInitialPath, showCancelButton: showCancelButton)
fileListViewController.allowEditing = allowEditing
self.init(rootViewController: fileListViewController)
self.view.backgroundColor = UIColor.whiteColor()
self.view.backgroundColor = UIColor.white
self.fileList = fileListViewController
}
}
}
+6 -6
View File
@@ -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)
}
+4 -4
View File
@@ -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!)
}
}
+33 -19
View File
@@ -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,33 @@ 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)
}
func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) {
if (editingStyle == UITableViewCellEditingStyle.delete) {
let selectedFile = fileForIndexPath(indexPath)
selectedFile.delete()
prepareData()
tableView.reloadSections([indexPath.section], with: UITableViewRowAnimation.automatic)
}
}
func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
return allowEditing
}
}
}
+39 -30
View File
@@ -12,32 +12,36 @@ 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]] = []
var allowEditing: Bool = false
// Search controller
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
}()
//MARK: Lifecycle
convenience init (initialPath: URL) {
self.init(initialPath: initialPath, showCancelButton: true)
}
convenience init (initialPath: NSURL) {
self.init(nibName: "FileBrowser", bundle: NSBundle(forClass: FileListViewController.self))
self.edgesForExtendedLayout = .None
convenience init (initialPath: URL, showCancelButton: Bool) {
self.init(nibName: "FileBrowser", bundle: Bundle(for: FileListViewController.self))
self.edgesForExtendedLayout = UIRectEdge()
// Set initial path
self.initialPath = initialPath
@@ -48,10 +52,11 @@ class FileListViewController: UIViewController {
searchController.searchBar.delegate = self
searchController.delegate = self
// Add dismiss button
let dismissButton = UIBarButtonItem(barButtonSystemItem: .Cancel, target: self, action: #selector(FileListViewController.dismiss))
self.navigationItem.rightBarButtonItem = dismissButton
if showCancelButton {
// Add dismiss button
let dismissButton = UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: #selector(FileListViewController.dismiss(button:)))
self.navigationItem.rightBarButtonItem = dismissButton
}
}
deinit{
@@ -62,15 +67,19 @@ class FileListViewController: UIViewController {
}
}
//MARK: UIViewController
override func viewDidLoad() {
func prepareData() {
// Prepare data
if let initialPath = initialPath {
files = parser.filesForDirectory(initialPath)
indexFiles()
}
}
//MARK: UIViewController
override func viewDidLoad() {
prepareData()
// Set search bar
tableView.tableHeaderView = searchController.searchBar
@@ -79,47 +88,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: FBFile.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()
}
+11 -11
View File
@@ -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
}
+2 -2
View File
@@ -15,11 +15,11 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.1.4</string>
<string>1.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>5</string>
<string>8</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
+14 -10
View File
@@ -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
}
}
@@ -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)
}
}
+19 -14
View File
@@ -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
}
@@ -39,19 +39,24 @@ class WebviewPreviewViewContoller: UIViewController {
//MARK: Share
func shareFile() {
@objc func shareFile(_ sender: UIBarButtonItem) {
guard let file = file else {
return
}
let activityViewController = UIActivityViewController(activityItems: [file.filePath], applicationActivities: nil)
self.presentViewController(activityViewController, animated: true, completion: nil)
if UIDevice.current.userInterfaceIdiom == .pad &&
activityViewController.responds(to: #selector(getter: popoverPresentationController)) {
activityViewController.popoverPresentationController?.barButtonItem = sender
}
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 +64,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 +73,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 +86,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 +100,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 +113,7 @@ class WebviewPreviewViewContoller: UIViewController {
"&apos;": "'"
];
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
}
+5 -5
View File
@@ -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 {
+2 -2
View File
@@ -15,10 +15,10 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>0.1.4</string>
<string>1.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>5</string>
<string>8</string>
</dict>
</plist>
+11 -6
View File
@@ -4,22 +4,22 @@
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
# FileBrowser
iOS Finder-style file browser in Swift with search, file previews and 3D touch. Simple and quick to use.
iOS Finder-style file browser in Swift 4.0 with search, file previews and 3D touch. Simple and quick to use.
<p align="center"><img src="http://i.giphy.com/3o6gaY6yLQkhjiok5W.gif" width="242" height="425"/></p>
## Features
| Features
--------------------------|------------------------------------------------------------
:sparkles: | Features
--------------------------|----------------------------
:iphone: | Browse and select files and folders with a familiar UI on iOS.
:mag: | Pull down to search.
:eyeglasses: | Preview most file types. Including plist and json.
:pencil: | Edit/delete files.
:point_up_2: | 3D touch support for faster previews with Peek & Pop.
:white_flower: | Fully customizable.
## Usage
Import FileBrowser at the top of the Swift file.
@@ -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(fileBrowser, 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.
@@ -43,6 +43,11 @@ You can open FileBrowser in a different root folder by initialising with an NSUR
let fileBrowser = FileBrowser(initialPath: customPath)
```
You can also allow editing/deleting files.
```swift
let fileBrowser = FileBrowser(initialPath: customPath, allowEditing: true)
```
Use the didSelectFile closure to change FileBrowser's behaviour when a file is selected.
```swift
fileBrowser.didSelectFile = { (file: FBFile) -> Void in
@@ -59,7 +64,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', '~> 1.0'
```
### Setting up with Carthage
+3 -3
View File
@@ -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=11.0,name=iPhone 8"
SDK="iphonesimulator"
# It is pitch black.
@@ -40,7 +40,7 @@ if [ "$MODE" = "examples" ]; then
-scheme Sample \
-sdk "$SDK" \
-destination "$PLATFORM" \
build test
build
done
trap - EXIT
exit 0
+3 -1
View File
@@ -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
+157 -193
View File
@@ -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 = "<group>"; };
3430F6751C45C930007473A6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
3430F6771C45C930007473A6 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
3430F67A1C45C930007473A6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
3430F67C1C45C930007473A6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
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 = "<group>"; };
3430F6871C45C930007473A6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
3437406B1C6E7ECB0090FD6A /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
3467DAEF1C4BF17900BA3DB8 /* Baymax.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = Baymax.jpg; sourceTree = "<group>"; };
3467DAF01C4BF17900BA3DB8 /* BB8.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = BB8.jpg; sourceTree = "<group>"; };
3467DAF11C4BF17900BA3DB8 /* Stitch.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = Stitch.jpg; sourceTree = "<group>"; };
3467DAF21C4BF17900BA3DB8 /* Images.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = Images.zip; sourceTree = "<group>"; };
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 = "<group>"; };
48A199B71D8C53AC00C443D3 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
48A199BA1D8C53AC00C443D3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
48A199C31D8C53DB00C443D3 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = "Supporting Files/AppDelegate.swift"; sourceTree = "<group>"; };
48A199C41D8C53DB00C443D3 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = "Supporting Files/Info.plist"; sourceTree = "<group>"; };
48A199C71D8C53E200C443D3 /* MainViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MainViewController.swift; path = "View Controller/MainViewController.swift"; sourceTree = "<group>"; };
48A199C91D8C546000C443D3 /* Baymax.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = Baymax.jpg; sourceTree = "<group>"; };
48A199CA1D8C546000C443D3 /* BB8.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = BB8.jpg; sourceTree = "<group>"; };
48A199CB1D8C546000C443D3 /* Images.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = Images.zip; sourceTree = "<group>"; };
48A199CC1D8C546000C443D3 /* Stitch.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = Stitch.jpg; sourceTree = "<group>"; };
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 = "<group>"; };
/* 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 = "<group>";
};
3430F66E1C45C930007473A6 /* Products */ = {
48A199AE1D8C53AC00C443D3 /* Products */ = {
isa = PBXGroup;
children = (
3430F66D1C45C930007473A6 /* Sample.app */,
3430F6811C45C930007473A6 /* SampleTests.xctest */,
48A199AD1D8C53AC00C443D3 /* Sample.app */,
);
name = Products;
sourceTree = "<group>";
};
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 = "<group>";
};
3430F6841C45C930007473A6 /* SampleTests */ = {
48A199C21D8C53B700C443D3 /* Supporting Files */ = {
isa = PBXGroup;
children = (
3430F6851C45C930007473A6 /* SampleTests.swift */,
3430F6871C45C930007473A6 /* Info.plist */,
48A199D11D8C546500C443D3 /* Resources */,
48A199C31D8C53DB00C443D3 /* AppDelegate.swift */,
48A199C41D8C53DB00C443D3 /* Info.plist */,
48A199B41D8C53AC00C443D3 /* Main.storyboard */,
48A199B71D8C53AC00C443D3 /* Assets.xcassets */,
48A199B91D8C53AC00C443D3 /* LaunchScreen.storyboard */,
);
path = SampleTests;
name = "Supporting Files";
sourceTree = "<group>";
};
48A199D11D8C546500C443D3 /* Resources */ = {
isa = PBXGroup;
children = (
48A199C91D8C546000C443D3 /* Baymax.jpg */,
48A199CA1D8C546000C443D3 /* BB8.jpg */,
48A199CB1D8C546000C443D3 /* Images.zip */,
48A199CC1D8C546000C443D3 /* Stitch.jpg */,
);
name = Resources;
sourceTree = "<group>";
};
48A199D21D8C546F00C443D3 /* View Controller */ = {
isa = PBXGroup;
children = (
48A199C71D8C53E200C443D3 /* MainViewController.swift */,
);
name = "View Controller";
sourceTree = "<group>";
};
48A24C2F1D8C57390044C697 /* Frameworks */ = {
isa = PBXGroup;
children = (
48A24C321D8C59250044C697 /* FileBrowser.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
/* 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,27 @@
);
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 = 0900;
ORGANIZATIONNAME = "Mihail Șalari";
TargetAttributes = {
3430F66C1C45C930007473A6 = {
CreatedOnToolsVersion = 7.2;
};
3430F6801C45C930007473A6 = {
CreatedOnToolsVersion = 7.2;
TestTargetID = 3430F66C1C45C930007473A6;
48A199AC1D8C53AC00C443D3 = {
CreatedOnToolsVersion = 8.0;
LastSwiftMigration = 0800;
ProvisioningStyle = Manual;
};
};
};
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 +171,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 = "<group>";
};
3430F6791C45C930007473A6 /* LaunchScreen.storyboard */ = {
48A199B91D8C53AC00C443D3 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
3430F67A1C45C930007473A6 /* Base */,
48A199BA1D8C53AC00C443D3 /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
@@ -270,21 +230,32 @@
/* 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;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = 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_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_SUSPICIOUS_MOVES = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -306,29 +277,43 @@
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";
SWIFT_VERSION = 4.0;
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;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = 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_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
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 +329,71 @@
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";
SWIFT_VERSION = 4.0;
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 = "";
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)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
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 = "";
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)";
};
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";
PROVISIONING_PROFILE_SPECIFIER = "";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
3430F6681C45C930007473A6 /* Build configuration list for PBXProject "Sample" */ = {
48A199A81D8C53AC00C443D3 /* Build configuration list for PBXProject "Sample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
3430F6881C45C930007473A6 /* Debug */,
3430F6891C45C930007473A6 /* Release */,
48A199BD1D8C53AC00C443D3 /* Debug */,
48A199BE1D8C53AC00C443D3 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
3430F68A1C45C930007473A6 /* Build configuration list for PBXNativeTarget "Sample" */ = {
48A199BF1D8C53AC00C443D3 /* Build configuration list for PBXNativeTarget "Sample" */ = {
isa = XCConfigurationList;
buildConfigurations = (
3430F68B1C45C930007473A6 /* Debug */,
3430F68C1C45C930007473A6 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
3430F68D1C45C930007473A6 /* Build configuration list for PBXNativeTarget "SampleTests" */ = {
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 */;
}
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0720"
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -14,7 +14,7 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3430F66C1C45C930007473A6"
BlueprintIdentifier = "48A199AC1D8C53AC00C443D3"
BuildableName = "Sample.app"
BlueprintName = "Sample"
ReferencedContainer = "container:Sample.xcodeproj">
@@ -26,23 +26,14 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3430F6801C45C930007473A6"
BuildableName = "SampleTests.xctest"
BlueprintName = "SampleTests"
ReferencedContainer = "container:Sample.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3430F66C1C45C930007473A6"
BlueprintIdentifier = "48A199AC1D8C53AC00C443D3"
BuildableName = "Sample.app"
BlueprintName = "Sample"
ReferencedContainer = "container:Sample.xcodeproj">
@@ -55,6 +46,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
@@ -65,7 +57,7 @@
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3430F66C1C45C930007473A6"
BlueprintIdentifier = "48A199AC1D8C53AC00C443D3"
BuildableName = "Sample.app"
BlueprintName = "Sample"
ReferencedContainer = "container:Sample.xcodeproj">
@@ -84,7 +76,7 @@
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "3430F66C1C45C930007473A6"
BlueprintIdentifier = "48A199AC1D8C53AC00C443D3"
BuildableName = "Sample.app"
BlueprintName = "Sample"
ReferencedContainer = "container:Sample.xcodeproj">
-75
View File
@@ -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:.
}
}
@@ -1,5 +1,15 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "29x29",
@@ -29,6 +39,51 @@
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "2x"
},
{
"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"
},
{
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
}
],
"info" : {
@@ -1,6 +0,0 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 382 B

@@ -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"
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 300 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 577 B

@@ -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"
}
}
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9531" systemVersion="15C50" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11134" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11106"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
@@ -14,9 +14,9 @@
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
@@ -1,57 +1,57 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9532" systemVersion="15C50" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="Azc-ni-1lY">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11201" systemVersion="15G1004" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="C30-pI-Zah">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11161"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Navigation Controller-->
<scene sceneID="qOO-wm-hTa">
<!--Main-->
<scene sceneID="tne-QT-ifu">
<objects>
<navigationController id="Azc-ni-1lY" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" id="He1-CR-cOP">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
<segue destination="dpw-R4-j8a" kind="relationship" relationship="rootViewController" id="X2C-fJ-xJK"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="vih-dz-uz2" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="234" y="152"/>
</scene>
<!--View Controller-->
<scene sceneID="mz0-lp-3R4">
<objects>
<viewController id="dpw-R4-j8a" customClass="ViewController" customModule="Sample" customModuleProvider="target" sceneMemberID="viewController">
<viewController id="BYZ-38-t0r" customClass="MainViewController" customModule="Sample" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="edF-bh-llm"/>
<viewControllerLayoutGuide type="bottom" id="Gww-Pp-M3Q"/>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="oeM-RL-OAb">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="iNg-oP-MXE">
<rect key="frame" x="239" y="285" width="122" height="30"/>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="kRA-yN-jkN">
<frame key="frameInset" minX="33.60%" minY="47.68%" width="32.53%" height="4.50%"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
<state key="normal" title="Show file browser"/>
<connections>
<action selector="showFileBrowser:" destination="dpw-R4-j8a" eventType="touchUpInside" id="G1A-x2-ExJ"/>
<action selector="showFileBrowserWithSender:" destination="BYZ-38-t0r" eventType="touchUpInside" id="aiu-9x-Mg2"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="iNg-oP-MXE" firstAttribute="centerX" secondItem="oeM-RL-OAb" secondAttribute="centerX" id="GYA-6v-k0x"/>
<constraint firstItem="iNg-oP-MXE" firstAttribute="centerY" secondItem="oeM-RL-OAb" secondAttribute="centerY" id="ryh-da-dpd"/>
</constraints>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
<navigationItem key="navigationItem" id="GLl-37-stv"/>
<navigationItem key="navigationItem" title="Main" id="loI-Tb-z6H"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="pqG-S7-8Xl" userLabel="First Responder" sceneMemberID="firstResponder"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="894" y="159"/>
<point key="canvasLocation" x="967" y="-645"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="bMP-Dn-Jmg">
<objects>
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="C30-pI-Zah" sceneMemberID="viewController">
<toolbarItems/>
<navigationBar key="navigationBar" contentMode="scaleToFill" id="cXh-Hi-2rA">
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<nil name="viewControllers"/>
<connections>
<segue destination="BYZ-38-t0r" kind="relationship" relationship="rootViewController" id="OnE-8Z-dJt"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="ESw-wj-Lv3" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="136.80000000000001" y="-644.52773613193403"/>
</scene>
</scenes>
</document>
@@ -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 {}
}
}
}
@@ -16,8 +16,6 @@
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
@@ -36,5 +34,12 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
@@ -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)
}
}
@@ -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)
}
}
-24
View File
@@ -1,24 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
@@ -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.
}
}
}