Skip to content

Commit

Permalink
- SDK Updated to file management branch to be able to use progress.
Browse files Browse the repository at this point in the history
- Coded the rename feature using the more view.
  • Loading branch information
Pablo Carrascal committed Aug 21, 2018
1 parent e0d53bb commit 286f1d7
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 12 deletions.
2 changes: 1 addition & 1 deletion ios-sdk
Submodule ios-sdk updated 71 files
+0 −11 Example/Ocean/ViewController.m
+84 −4 ownCloudSDK.xcodeproj/project.pbxproj
+1 −1 ownCloudSDK/Authentication/OCAuthenticationMethod.h
+14 −6 ownCloudSDK/Connection/OCConnection.h
+313 −17 ownCloudSDK/Connection/OCConnection.m
+10 −0 ownCloudSDK/Connection/OCConnectionDAVRequest.h
+22 −2 ownCloudSDK/Connection/OCConnectionDAVRequest.m
+2 −0 ownCloudSDK/Connection/OCConnectionQueue.h
+52 −3 ownCloudSDK/Connection/OCConnectionQueue.m
+19 −0 ownCloudSDK/Connection/OCConnectionRequest.h
+10 −0 ownCloudSDK/Connection/OCConnectionRequest.m
+1 −1 ownCloudSDK/Core/Commands/OCCore+CommandCopyMove.m
+1 −1 ownCloudSDK/Core/Commands/OCCore+CommandCreateFolder.m
+38 −2 ownCloudSDK/Core/Commands/OCCore+CommandDelete.m
+204 −0 ownCloudSDK/Core/Commands/OCCore+CommandDownload.m
+36 −0 ownCloudSDK/Core/Commands/OCCore+CommandLocalCreation.m
+35 −0 ownCloudSDK/Core/Commands/OCCore+CommandLocalModification.m
+38 −0 ownCloudSDK/Core/Files/OCCore+Download.m
+33 −0 ownCloudSDK/Core/ItemList/OCCore+ItemList.h
+701 −0 ownCloudSDK/Core/ItemList/OCCore+ItemList.m
+4 −16 ownCloudSDK/Core/ItemList/OCCoreItemListTask.m
+7 −0 ownCloudSDK/Core/OCCore+FileProvider.h
+181 −0 ownCloudSDK/Core/OCCore+FileProvider.m
+3 −7 ownCloudSDK/Core/OCCore+Internal.h
+2 −0 ownCloudSDK/Core/OCCore+SyncEngine.h
+368 −245 ownCloudSDK/Core/OCCore+SyncEngine.m
+26 −12 ownCloudSDK/Core/OCCore.h
+31 −540 ownCloudSDK/Core/OCCore.m
+8 −2 ownCloudSDK/Core/Sync/OCCoreSyncContext.h
+28 −10 ownCloudSDK/Core/Sync/OCCoreSyncContext.m
+3 −0 ownCloudSDK/Core/Sync/OCCoreSyncRoute.h
+8 −1 ownCloudSDK/Core/Sync/OCCoreSyncRoute.m
+5 −0 ownCloudSDK/Core/Sync/OCSyncRecord.h
+38 −0 ownCloudSDK/Core/Sync/OCSyncRecord.m
+8 −0 ownCloudSDK/Events/OCEvent.h
+3 −0 ownCloudSDK/Events/OCEvent.m
+39 −0 ownCloudSDK/Extensions/OCExtension.h
+33 −0 ownCloudSDK/Extensions/OCExtension.m
+28 −0 ownCloudSDK/Extensions/OCExtensionContext.h
+23 −0 ownCloudSDK/Extensions/OCExtensionContext.m
+28 −0 ownCloudSDK/Extensions/OCExtensionLocation.h
+23 −0 ownCloudSDK/Extensions/OCExtensionLocation.m
+35 −0 ownCloudSDK/Extensions/OCExtensionManager.h
+47 −0 ownCloudSDK/Extensions/OCExtensionManager.m
+30 −0 ownCloudSDK/Extensions/OCExtensionTypes.h
+29 −0 ownCloudSDK/Item/Images/OCItem+OCThumbnail.h
+37 −0 ownCloudSDK/Item/Images/OCItem+OCThumbnail.m
+4 −0 ownCloudSDK/Item/Images/OCItemThumbnail.h
+2 −0 ownCloudSDK/Item/Images/OCItemThumbnail.m
+19 −4 ownCloudSDK/Item/OCItem.h
+64 −0 ownCloudSDK/Item/OCItem.m
+4 −0 ownCloudSDK/Resource Management/OCCoreManager.h
+7 −0 ownCloudSDK/Resource Management/OCCoreManager.m
+17 −0 ownCloudSDK/Resources/en.lproj/Localizable.strings
+ ownCloudSDK/Resources/eu.lproj/Localizable.strings
+24 −5 ownCloudSDK/Toolkit/OCReachabilityMonitor.m
+37 −28 ownCloudSDK/Vaults/Database/OCDatabase+Schemas.m
+4 −2 ownCloudSDK/Vaults/Database/OCDatabase.h
+44 −4 ownCloudSDK/Vaults/Database/OCDatabase.m
+6 −0 ownCloudSDK/Vaults/OCVault.h
+33 −1 ownCloudSDK/Vaults/OCVault.m
+1 −0 ownCloudSDK/ownCloudSDK.h
+9 −7 ownCloudSDKTests/AuthenticationTests.m
+261 −6 ownCloudSDKTests/ConnectionTests.m
+16 −15 ownCloudSDKTests/CoreSyncTests.m
+13 −11 ownCloudSDKTests/CoreTests.m
+4 −3 ownCloudSDKTests/HostSimulatorTests.m
+22 −0 ownCloudSDKTests/OCTestTarget.h
+43 −0 ownCloudSDKTests/OCTestTarget.m
+ ownCloudSDKTests/rainbow.png
+ ownCloudUI/Resources/ru.lproj/Localizable.strings
1 change: 0 additions & 1 deletion ownCloud.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1224,7 +1224,6 @@
593BAB97209F8A0500023634 /* AppLockManager.swift in Sources */,
DCFED972208095E200A2D984 /* ClientItemCell.swift in Sources */,
23E22BB720C6A5C40024D11E /* UIDevice+UIUserInterfaceIdiom.swift in Sources */,
6E216A642112F58700ED21BD /* NamingViewController.swift in Sources */,
23F6238120B587EF004FDE8B /* SortMethod.swift in Sources */,
239F1319205A693A0029F186 /* UIColor+Extension.swift in Sources */,
DC3BE0E12077CD4B002A0AC0 /* Synchronized.swift in Sources */,
Expand Down
4 changes: 2 additions & 2 deletions ownCloud/Bookmarks/BookmarkViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ class BookmarkViewController: StaticTableViewController {
removeRows.append(tokenInfoRow!)
}

if !authenticationMethodClass.usesUserName() {
if !authenticationMethodClass.usesUserName {
removeRows.append(usernameRow!)
}

Expand Down Expand Up @@ -530,7 +530,7 @@ class BookmarkViewController: StaticTableViewController {
credentialsSection?.insert(row: passwordRow!, at: 0, animated: animated)
}

if authenticationMethodClass.usesUserName() {
if authenticationMethodClass.usesUserName {
if usernameRow?.attached == false {
credentialsSection?.insert(row: usernameRow!, at: 0, animated: animated)
}
Expand Down
41 changes: 34 additions & 7 deletions ownCloud/Client/ClientQueryViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -560,12 +560,15 @@ extension ClientQueryViewController : SortBarDelegate {
print("LOG ---> right button pressed")
}


func sortBar(_ sortBar: SortBar, didUpdateSortMethod: SortMethod) {
sortMethod = didUpdateSortMethod
query?.sortComparator = sortMethod.comparator()

}

func sortBar(_ sortBar: SortBar, presentViewController: UIViewController, animated: Bool, completionHandler: (() -> Void)?) {
self.present(presentViewController, animated: animated, completion: completionHandler)
}
}

// MARK: - UISearchResultsUpdating Delegate
Expand Down Expand Up @@ -595,11 +598,6 @@ extension ClientQueryViewController: UISearchResultsUpdating {
}
}
}

func sortBar(_ sortBar: SortBar, presentViewController: UIViewController, animated: Bool, completionHandler: (() -> Void)?) {

self.present(presentViewController, animated: animated, completion: completionHandler)
}
}

// MARK: - ClientItemCell Delegate
Expand Down Expand Up @@ -644,7 +642,36 @@ extension ClientQueryViewController: ClientItemCellDelegate {

}, attributedTitle: delete, alignment: .center)

let renameRow: StaticTableViewRow = StaticTableViewRow(rowWithAction: nil, attributedTitle: rename, alignment: .center)
let renameRow: StaticTableViewRow = StaticTableViewRow(rowWithAction: { [weak self] (_, _) in

moreVC.dismiss(animated: true, completion: {
let renamevc = NamingViewController(with: item, core: self?.core, stringValidator: { name in
if name.contains("/") || name.contains("\\") {
return (false, "File name cannot contain / or \\")
} else {
return (true, nil)
}
}, completion: { newName, _ in

guard newName != nil else {
return
}

if let progress = self?.core?.renameItem(item, to: newName, options: nil, resultHandler: { (error, _, _, _) in
if error != nil {
Log.log("Error \(String(describing: error)) renaming \(String(describing: item.path))")
}
}) {
self?.progressSummarizer?.startTracking(progress: progress)
}
})

let renameNavigationVC = ThemeNavigationController(rootViewController: renamevc)
renameNavigationVC.modalPresentationStyle = .overFullScreen
self?.navigationController?.present(renameNavigationVC, animated: true)
})
}, attributedTitle: rename, alignment: .center)

tableViewController.addSection(StaticTableViewSection(headerAttributedTitle: title, identifier: "actions-section", rows: [
renameRow,
deleteRow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ final class CardPresentationController: UIPresentationController {
let presentedFrame = CGRect(origin: presentedOrigin, size: presentedSize)
return presentedFrame
}

// MARK: - Presentation
override func presentationTransitionWillBegin() {
if let containerView = containerView {
Expand Down

0 comments on commit 286f1d7

Please sign in to comment.