NCMedia.swift 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478
  1. //
  2. // NCMedia.swift
  3. // Nextcloud
  4. //
  5. // Created by Marino Faggiana on 12/02/2019.
  6. // Copyright © 2018 Marino Faggiana. All rights reserved.
  7. //
  8. // Author Marino Faggiana <marino.faggiana@nextcloud.com>
  9. //
  10. // This program is free software: you can redistribute it and/or modify
  11. // it under the terms of the GNU General Public License as published by
  12. // the Free Software Foundation, either version 3 of the License, or
  13. // (at your option) any later version.
  14. //
  15. // This program is distributed in the hope that it will be useful,
  16. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. // GNU General Public License for more details.
  19. //
  20. // You should have received a copy of the GNU General Public License
  21. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  22. //
  23. import Foundation
  24. import Sheeeeeeeeet
  25. class NCMedia: UIViewController ,UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout, UIGestureRecognizerDelegate, NCListCellDelegate, NCSectionHeaderMenuDelegate, DropdownMenuDelegate, DZNEmptyDataSetSource, DZNEmptyDataSetDelegate {
  26. @IBOutlet fileprivate weak var collectionView: UICollectionView!
  27. private let appDelegate = UIApplication.shared.delegate as! AppDelegate
  28. private var metadataPush: tableMetadata?
  29. private var isEditMode = false
  30. private var selectFileID = [String]()
  31. private var filterTypeFileImage = false;
  32. private var filterTypeFileVideo = false;
  33. private var sectionDatasource = CCSectionDataSourceMetadata()
  34. private var autoUploadFileName = ""
  35. private var autoUploadDirectory = ""
  36. private var gridLayout: NCGridLayout!
  37. private var actionSheet: ActionSheet?
  38. private let headerMenuHeight: CGFloat = 50
  39. private let sectionHeaderHeight: CGFloat = 20
  40. private let footerHeight: CGFloat = 50
  41. private let refreshControl = UIRefreshControl()
  42. override func viewDidLoad() {
  43. super.viewDidLoad()
  44. // Cell
  45. collectionView.register(UINib.init(nibName: "NCGridMediaCell", bundle: nil), forCellWithReuseIdentifier: "gridCell")
  46. // Header
  47. collectionView.register(UINib.init(nibName: "NCSectionHeaderMenu", bundle: nil), forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: "sectionHeaderMenu")
  48. collectionView.register(UINib.init(nibName: "NCSectionHeader", bundle: nil), forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: "sectionHeader")
  49. // Footer
  50. collectionView.register(UINib.init(nibName: "NCSectionFooter", bundle: nil), forSupplementaryViewOfKind: UICollectionView.elementKindSectionFooter, withReuseIdentifier: "sectionFooter")
  51. collectionView.alwaysBounceVertical = true
  52. gridLayout = NCGridLayout()
  53. gridLayout.heightLabelPlusButton = 0
  54. gridLayout.preferenceWidth = 80
  55. gridLayout.sectionInset = UIEdgeInsets(top: 10, left: 1, bottom: 10, right: 1)
  56. collectionView.collectionViewLayout = gridLayout
  57. // Add Refresh Control
  58. collectionView.refreshControl = refreshControl
  59. // Configure Refresh Control
  60. refreshControl.tintColor = NCBrandColor.sharedInstance.brandText
  61. refreshControl.backgroundColor = NCBrandColor.sharedInstance.brand
  62. refreshControl.addTarget(self, action: #selector(loadDatasource), for: .valueChanged)
  63. // empty Data Source
  64. self.collectionView.emptyDataSetDelegate = self;
  65. self.collectionView.emptyDataSetSource = self;
  66. }
  67. override func viewWillAppear(_ animated: Bool) {
  68. super.viewWillAppear(animated)
  69. // Color
  70. appDelegate.aspectNavigationControllerBar(self.navigationController?.navigationBar, online: appDelegate.reachability.isReachable(), hidden: false)
  71. appDelegate.aspectTabBar(self.tabBarController?.tabBar, hidden: false)
  72. self.navigationItem.title = NSLocalizedString("_media_", comment: "")
  73. // get auto upload folder
  74. autoUploadFileName = NCManageDatabase.sharedInstance.getAccountAutoUploadFileName()
  75. autoUploadDirectory = NCManageDatabase.sharedInstance.getAccountAutoUploadDirectory(appDelegate.activeUrl)
  76. loadDatasource()
  77. }
  78. override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
  79. super.viewWillTransition(to: size, with: coordinator)
  80. coordinator.animate(alongsideTransition: nil) { _ in
  81. self.collectionView.collectionViewLayout.invalidateLayout()
  82. self.actionSheet?.viewDidLayoutSubviews()
  83. }
  84. }
  85. // MARK: DZNEmpty
  86. func backgroundColor(forEmptyDataSet scrollView: UIScrollView) -> UIColor? {
  87. return NCBrandColor.sharedInstance.backgroundView
  88. }
  89. func image(forEmptyDataSet scrollView: UIScrollView) -> UIImage? {
  90. return CCGraphics.changeThemingColorImage(UIImage.init(named: "filesNoFiles"), multiplier: 2, color: NCBrandColor.sharedInstance.brandElement)
  91. }
  92. func title(forEmptyDataSet scrollView: UIScrollView) -> NSAttributedString? {
  93. let text = "\n"+NSLocalizedString("_files_no_files_", comment: "")
  94. let attributes = [NSAttributedString.Key.font: UIFont.boldSystemFont(ofSize: 20), NSAttributedString.Key.foregroundColor: UIColor.lightGray]
  95. return NSAttributedString.init(string: text, attributes: attributes)
  96. }
  97. func emptyDataSetShouldAllowScroll(_ scrollView: UIScrollView) -> Bool {
  98. return true
  99. }
  100. // MARK: TAP EVENT
  101. func tapSwitchHeader(sender: Any) {
  102. UIView.animate(withDuration: 0.0, animations: {
  103. self.gridLayout.preferenceWidth = self.gridLayout.preferenceWidth + 10
  104. self.collectionView.collectionViewLayout.invalidateLayout()
  105. })
  106. }
  107. func tapOrderHeader(sender: Any) {
  108. }
  109. func tapMoreHeader(sender: Any) {
  110. var menuView: DropdownMenu?
  111. if isEditMode {
  112. //let item0 = DropdownItem(image: CCGraphics.changeThemingColorImage(UIImage.init(named: "checkedNo"), multiplier: 2, color: NCBrandColor.sharedInstance.icon), title: NSLocalizedString("_cancel_", comment: ""))
  113. //let item1 = DropdownItem(image: CCGraphics.changeThemingColorImage(UIImage.init(named: "restore"), multiplier: 1, color: NCBrandColor.sharedInstance.icon), title: NSLocalizedString("_trash_restore_selected_", comment: ""))
  114. let item2 = DropdownItem(image: CCGraphics.changeThemingColorImage(UIImage.init(named: "trash"), multiplier: 2, color: NCBrandColor.sharedInstance.icon), title: NSLocalizedString("_trash_delete_selected_", comment: ""))
  115. menuView = DropdownMenu(navigationController: self.navigationController!, items: [item2], selectedRow: -1)
  116. menuView?.token = "tapMoreHeaderMenuSelect"
  117. } else {
  118. let item0 = DropdownItem(image: CCGraphics.changeThemingColorImage(UIImage.init(named: "select"), multiplier: 2, color: NCBrandColor.sharedInstance.icon), title: NSLocalizedString("_select_", comment: ""))
  119. let item1 = DropdownItem(image: CCGraphics.changeThemingColorImage(UIImage.init(named: "folderMedia"), multiplier: 2, color: NCBrandColor.sharedInstance.icon), title: NSLocalizedString("_select_media_folder_", comment: ""))
  120. var item2: DropdownItem
  121. if filterTypeFileImage {
  122. item2 = DropdownItem(image: CCGraphics.changeThemingColorImage(UIImage.init(named: "imageno"), multiplier: 2, color: NCBrandColor.sharedInstance.icon), title: NSLocalizedString("_media_viewimage_show_", comment: ""))
  123. } else {
  124. item2 = DropdownItem(image: CCGraphics.changeThemingColorImage(UIImage.init(named: "imageyes"), multiplier: 2, color: NCBrandColor.sharedInstance.icon), title: NSLocalizedString("_media_viewimage_hide_", comment: ""))
  125. }
  126. var item3: DropdownItem
  127. if filterTypeFileVideo {
  128. item3 = DropdownItem(image: CCGraphics.changeThemingColorImage(UIImage.init(named: "videono"), multiplier: 2, color: NCBrandColor.sharedInstance.icon), title: NSLocalizedString("_media_viewvideo_show_", comment: ""))
  129. } else {
  130. item3 = DropdownItem(image: CCGraphics.changeThemingColorImage(UIImage.init(named: "videoyes"), multiplier: 2, color: NCBrandColor.sharedInstance.icon), title: NSLocalizedString("_media_viewvideo_hide_", comment: ""))
  131. }
  132. menuView = DropdownMenu(navigationController: self.navigationController!, items: [item0,item1,item2,item3], selectedRow: -1)
  133. menuView?.token = "tapMoreHeaderMenu"
  134. }
  135. menuView?.delegate = self
  136. menuView?.rowHeight = 45
  137. menuView?.highlightColor = NCBrandColor.sharedInstance.brand
  138. menuView?.tableView.alwaysBounceVertical = false
  139. menuView?.tableViewBackgroundColor = UIColor.white
  140. let header = (sender as? UIButton)?.superview
  141. let headerRect = self.collectionView.convert(header!.bounds, from: self.view)
  142. let menuOffsetY = headerRect.height - headerRect.origin.y - 2
  143. menuView?.topOffsetY = CGFloat(menuOffsetY)
  144. menuView?.showMenu()
  145. }
  146. func tapMoreListItem(with fileID: String, sender: Any) {
  147. tapMoreGridItem(with: fileID, sender: sender)
  148. }
  149. func tapMoreGridItem(with fileID: String, sender: Any) {
  150. guard let metadata = NCManageDatabase.sharedInstance.getMetadata(predicate: NSPredicate(format: "fileID == %@", fileID)) else {
  151. return
  152. }
  153. if !isEditMode {
  154. var items = [ActionSheetItem]()
  155. let appearanceDelete = ActionSheetItemAppearance.init()
  156. appearanceDelete.textColor = UIColor.red
  157. // 0 == CCMore, 1 = first NCOffline ....
  158. if (self == self.navigationController?.viewControllers[1]) {
  159. items.append(ActionSheetItem(title: NSLocalizedString("_remove_available_offline_", comment: ""), value: 0, image: CCGraphics.changeThemingColorImage(UIImage.init(named: "offline"), multiplier: 2, color: NCBrandColor.sharedInstance.icon)))
  160. }
  161. items.append(ActionSheetItem(title: NSLocalizedString("_share_", comment: ""), value: 1, image: CCGraphics.changeThemingColorImage(UIImage.init(named: "share"), multiplier: 2, color: NCBrandColor.sharedInstance.icon)))
  162. let itemDelete = ActionSheetItem(title: NSLocalizedString("_delete_", comment: ""), value: 2, image: CCGraphics.changeThemingColorImage(UIImage.init(named: "trash"), multiplier: 2, color: UIColor.red))
  163. itemDelete.customAppearance = appearanceDelete
  164. items.append(itemDelete)
  165. items.append(ActionSheetCancelButton(title: NSLocalizedString("_cancel_", comment: "")))
  166. actionSheet = ActionSheet(items: items) { sheet, item in
  167. if item.value as? Int == 0 {
  168. if metadata.directory {
  169. NCManageDatabase.sharedInstance.setDirectory(serverUrl: CCUtility.stringAppendServerUrl(metadata.serverUrl, addFileName: metadata.fileName)!, offline: false, account: self.appDelegate.activeAccount)
  170. } else {
  171. NCManageDatabase.sharedInstance.setLocalFile(fileID: metadata.fileID, offline: false)
  172. }
  173. self.loadDatasource()
  174. }
  175. if item.value as? Int == 1 { self.appDelegate.activeMain.readShare(withAccount: self.appDelegate.activeAccount, openWindow: true, metadata: metadata) }
  176. if item.value as? Int == 2 { self.deleteItem(with: metadata, sender: sender) }
  177. if item is ActionSheetCancelButton { print("Cancel buttons has the value `true`") }
  178. }
  179. let headerView = NCActionSheetHeader.sharedInstance.actionSheetHeader(isDirectory: metadata.directory, iconName: metadata.iconName, fileID: metadata.fileID, fileNameView: metadata.fileNameView, text: metadata.fileNameView)
  180. actionSheet?.headerView = headerView
  181. actionSheet?.headerView?.frame.size.height = 50
  182. actionSheet?.present(in: self, from: sender as! UIButton)
  183. } else {
  184. let buttonPosition:CGPoint = (sender as! UIButton).convert(CGPoint.zero, to:collectionView)
  185. let indexPath = collectionView.indexPathForItem(at: buttonPosition)
  186. collectionView(self.collectionView, didSelectItemAt: indexPath!)
  187. }
  188. }
  189. // MARK: DROP-DOWN-MENU
  190. func dropdownMenu(_ dropdownMenu: DropdownMenu, didSelectRowAt indexPath: IndexPath) {
  191. if dropdownMenu.token == "tapMoreHeaderMenu" {
  192. }
  193. if dropdownMenu.token == "tapMoreHeaderMenuSelect" {
  194. }
  195. }
  196. // MARK: NC API
  197. func deleteItem(with metadata: tableMetadata, sender: Any) {
  198. var items = [ActionSheetItem]()
  199. guard let tableDirectory = NCManageDatabase.sharedInstance.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == serverUrl", appDelegate.activeAccount, metadata.serverUrl)) else {
  200. return
  201. }
  202. items.append(ActionSheetDangerButton(title: NSLocalizedString("_delete_", comment: "")))
  203. items.append(ActionSheetCancelButton(title: NSLocalizedString("_cancel_", comment: "")))
  204. actionSheet = ActionSheet(items: items) { sheet, item in
  205. if item is ActionSheetDangerButton {
  206. NCMainCommon.sharedInstance.deleteFile(metadatas: [metadata], e2ee: tableDirectory.e2eEncrypted, serverUrl: tableDirectory.serverUrl, folderFileID: tableDirectory.fileID) { (errorCode, message) in
  207. self.loadDatasource()
  208. }
  209. }
  210. if item is ActionSheetCancelButton { print("Cancel buttons has the value `true`") }
  211. }
  212. let headerView = NCActionSheetHeader.sharedInstance.actionSheetHeader(isDirectory: metadata.directory, iconName: metadata.iconName, fileID: metadata.fileID, fileNameView: metadata.fileNameView, text: metadata.fileNameView)
  213. actionSheet?.headerView = headerView
  214. actionSheet?.headerView?.frame.size.height = 50
  215. actionSheet?.present(in: self, from: sender as! UIButton)
  216. }
  217. // MARK: DATASOURCE
  218. @objc func loadDatasource() {
  219. if appDelegate.activeAccount.count == 0 {
  220. return
  221. }
  222. let startDirectory = NCManageDatabase.sharedInstance.getAccountStartDirectoryMediaTabView(CCUtility.getHomeServerUrlActiveUrl(appDelegate.activeUrl))
  223. //let date = Calendar.current.date(byAdding: .day, value: -30, to: Date())!
  224. let formatter = DateFormatter()
  225. formatter.dateFormat = "yyyy/MM/dd HH:mm"
  226. let date2 = formatter.date(from: "2019/01/29 00:00")!
  227. OCNetworking.sharedManager()?.search(withAccount: appDelegate.activeAccount, fileName: "", serverUrl: startDirectory, contentType: ["image/%", "video/%"], lteDateLastModified: Date(), gteDateLastModified: date2, depth: "infinity", completion: { (account, metadatas, message, errorCode) in
  228. if errorCode == 0 && account == self.appDelegate.activeAccount {
  229. NCManageDatabase.sharedInstance.createTablePhotos(metadatas as! [tableMetadata], account: account!)
  230. self.sectionDatasource = CCSectionMetadata.creataDataSourseSectionMetadata(metadatas, listProgressMetadata: nil, groupByField: "date", filterFileID: nil, filterTypeFileImage: self.filterTypeFileImage, filterTypeFileVideo: self.filterTypeFileVideo, activeAccount: account!)
  231. self.collectionView.reloadData()
  232. }
  233. })
  234. self.refreshControl.endRefreshing()
  235. }
  236. // MARK: COLLECTIONVIEW METHODS
  237. public func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
  238. //caused by user
  239. print("SCROLL scrollViewDidEndDecelerating")
  240. }
  241. public func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) {
  242. if (!decelerate) {
  243. //cause by user
  244. print("SCROLL scrollViewDidEndDragging")
  245. }
  246. }
  247. func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView {
  248. if (indexPath.section == 0) {
  249. if kind == UICollectionView.elementKindSectionHeader {
  250. let header = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "sectionHeaderMenu", for: indexPath) as! NCSectionHeaderMenu
  251. if collectionView.collectionViewLayout == gridLayout {
  252. header.buttonSwitch.setImage(CCGraphics.changeThemingColorImage(UIImage.init(named: "switchList"), multiplier: 2, color: NCBrandColor.sharedInstance.icon), for: .normal)
  253. } else {
  254. header.buttonSwitch.setImage(CCGraphics.changeThemingColorImage(UIImage.init(named: "switchGrid"), multiplier: 2, color: NCBrandColor.sharedInstance.icon), for: .normal)
  255. }
  256. header.delegate = self
  257. header.setStatusButton(count: sectionDatasource.allFileID.count)
  258. header.buttonOrder.isHidden = true
  259. header.labelSection.isHidden = false
  260. header.buttonMore.isHidden = false
  261. header.setTitleLabel(sectionDatasource: sectionDatasource, section: indexPath.section)
  262. header.labelSectionHeightConstraint.constant = sectionHeaderHeight
  263. return header
  264. } else {
  265. let footer = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "sectionFooter", for: indexPath) as! NCSectionFooter
  266. footer.setTitleLabel(sectionDatasource: sectionDatasource)
  267. return footer
  268. }
  269. } else {
  270. if kind == UICollectionView.elementKindSectionHeader {
  271. let header = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "sectionHeader", for: indexPath) as! NCSectionHeader
  272. header.setTitleLabel(sectionDatasource: sectionDatasource, section: indexPath.section)
  273. return header
  274. } else {
  275. let footer = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "sectionFooter", for: indexPath) as! NCSectionFooter
  276. footer.setTitleLabel(sectionDatasource: sectionDatasource)
  277. return footer
  278. }
  279. }
  280. }
  281. func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize {
  282. if section == 0 {
  283. return CGSize(width: collectionView.frame.width, height: headerMenuHeight + sectionHeaderHeight)
  284. } else {
  285. return CGSize(width: collectionView.frame.width, height: sectionHeaderHeight)
  286. }
  287. }
  288. func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForFooterInSection section: Int) -> CGSize {
  289. let sections = sectionDatasource.sectionArrayRow.allKeys.count
  290. if (section == sections - 1) {
  291. return CGSize(width: collectionView.frame.width, height: footerHeight)
  292. } else {
  293. return CGSize(width: collectionView.frame.width, height: 0)
  294. }
  295. }
  296. func numberOfSections(in collectionView: UICollectionView) -> Int {
  297. let sections = sectionDatasource.sectionArrayRow.allKeys.count
  298. return sections
  299. }
  300. func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
  301. let key = sectionDatasource.sections.object(at: section)
  302. let datasource = sectionDatasource.sectionArrayRow.object(forKey: key) as! [tableMetadata]
  303. return datasource.count
  304. }
  305. func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
  306. let cell: UICollectionViewCell
  307. guard let metadata = NCMainCommon.sharedInstance.getMetadataFromSectionDataSourceIndexPath(indexPath, sectionDataSource: sectionDatasource) else {
  308. return collectionView.dequeueReusableCell(withReuseIdentifier: "gridCell", for: indexPath) as! NCGridMediaCell
  309. }
  310. cell = collectionView.dequeueReusableCell(withReuseIdentifier: "gridCell", for: indexPath) as! NCGridMediaCell
  311. NCMainCommon.sharedInstance.collectionViewCellForItemAt(indexPath, collectionView: collectionView, cell: cell, metadata: metadata, metadataFolder: nil, serverUrl: metadata.serverUrl, isEditMode: isEditMode, selectFileID: selectFileID, autoUploadFileName: autoUploadFileName, autoUploadDirectory: autoUploadDirectory, hideButtonMore: true, source: self)
  312. return cell
  313. }
  314. func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
  315. guard let metadata = NCMainCommon.sharedInstance.getMetadataFromSectionDataSourceIndexPath(indexPath, sectionDataSource: sectionDatasource) else {
  316. return
  317. }
  318. metadataPush = metadata
  319. if isEditMode {
  320. if let index = selectFileID.index(of: metadata.fileID) {
  321. selectFileID.remove(at: index)
  322. } else {
  323. selectFileID.append(metadata.fileID)
  324. }
  325. collectionView.reloadItems(at: [indexPath])
  326. return
  327. }
  328. performSegue(withIdentifier: "segueDetail", sender: self)
  329. }
  330. // MARK: SEGUE
  331. override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
  332. let photoDataSource: NSMutableArray = []
  333. for fileID: String in sectionDatasource.allFileID as! [String] {
  334. let metadata = sectionDatasource.allRecordsDataSource.object(forKey: fileID) as! tableMetadata
  335. if metadata.typeFile == k_metadataTypeFile_image {
  336. photoDataSource.add(metadata)
  337. }
  338. }
  339. if let segueNavigationController = segue.destination as? UINavigationController {
  340. if let segueViewController = segueNavigationController.topViewController as? CCDetail {
  341. segueViewController.metadataDetail = metadataPush
  342. segueViewController.dateFilterQuery = nil
  343. segueViewController.photoDataSource = photoDataSource
  344. segueViewController.title = metadataPush!.fileNameView
  345. }
  346. }
  347. }
  348. }