123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- //
- // DocumentPickerViewController.swift
- // Picker
- //
- // Created by Marino Faggiana on 27/12/16.
- // Copyright © 2016 TWS. All rights reserved.
- //
- import UIKit
- class DocumentPickerViewController: UIDocumentPickerExtensionViewController {
- // MARK: - Properties
- var metadata : CCMetadata!
- var sectionDataSource = [CCSectionDataSource]()
-
- // MARK: - IBOutlets
- @IBOutlet weak var tableView: UITableView!
-
- // MARK: - View Life Cycle
- override func viewWillAppear(_ animated: Bool) {
-
- super.viewWillAppear(animated)
-
- /*
- NSPredicate(format: "(account == %@) AND (directoryID == %@)", , "33")
-
- let recordsTableMetadata = CCCoreData.getTableMetadata(with: "(account == %@) AND (directoryID == %@)", fieldOrder: <#T##String!#>, ascending: <#T##Bool#>)
- */
-
- /*
-
- NSArray *recordsTableMetadata = [CCCoreData getTableMetadataWithPredicate:[NSPredicate predicateWithFormat:@"(account == %@) AND (directoryID == %@)", app.activeAccount, directoryID] fieldOrder:[CCUtility getOrderSettings] ascending:[CCUtility getAscendingSettings]];
-
- _sectionDataSource = [CCSection creataDataSourseSectionTableMetadata:recordsTableMetadata listProgressMetadata:nil groupByField:_directoryGroupBy replaceDateToExifDate:NO activeAccount:app.activeAccount];
-
- */
-
- tableView.reloadData()
- }
- /*
- @IBAction func openDocument(_ sender: AnyObject?) {
- let documentURL = self.documentStorageURL!.appendingPathComponent("Untitled.txt")
-
- // TODO: if you do not have a corresponding file provider, you must ensure that the URL returned here is backed by a file
- self.dismissGrantingAccess(to: documentURL)
- }
-
- override func prepareForPresentation(in mode: UIDocumentPickerMode) {
- // TODO: present a view controller appropriate for picker mode here
- }
- */
-
- static func appGroupContainerURL() -> URL? {
-
- let fileManager = FileManager.default
- guard let groupURL = fileManager
- .containerURL(forSecurityApplicationGroupIdentifier: capabilitiesGroups) else {
- return nil
- }
-
- let storagePathUrl = groupURL.appendingPathComponent("File Provider Storage")
- let storagePath = storagePathUrl.path
-
- if !fileManager.fileExists(atPath: storagePath) {
- do {
- try fileManager.createDirectory(atPath: storagePath,
- withIntermediateDirectories: false,
- attributes: nil)
- } catch let error {
- print("error creating filepath: \(error)")
- return nil
- }
- }
-
- return storagePathUrl
- }
- }
|