NCShare.swift 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519
  1. //
  2. // NCShare.swift
  3. // Nextcloud
  4. //
  5. // Created by Marino Faggiana on 17/07/2019.
  6. // Copyright © 2019 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 Parchment
  25. import DropDown
  26. import NCCommunication
  27. class NCShare: UIViewController, UIGestureRecognizerDelegate, NCShareLinkCellDelegate, NCShareUserCellDelegate, NCShareNetworkingDelegate {
  28. @IBOutlet weak var viewContainerConstraint: NSLayoutConstraint!
  29. @IBOutlet weak var sharedWithYouByView: UIView!
  30. @IBOutlet weak var sharedWithYouByImage: UIImageView!
  31. @IBOutlet weak var sharedWithYouByLabel: UILabel!
  32. @IBOutlet weak var searchFieldTopConstraint: NSLayoutConstraint!
  33. @IBOutlet weak var searchField: UITextField!
  34. @IBOutlet weak var shareLinkImage: UIImageView!
  35. @IBOutlet weak var shareLinkLabel: UILabel!
  36. @IBOutlet weak var buttonCopy: UIButton!
  37. @IBOutlet weak var buttonMenu: UIButton!
  38. @IBOutlet weak var tableView: UITableView!
  39. private let appDelegate = UIApplication.shared.delegate as! AppDelegate
  40. var metadata: tableMetadata?
  41. public var height: CGFloat = 0
  42. private var shareLinkMenuView: NCShareLinkMenuView?
  43. private var shareUserMenuView: NCShareUserMenuView?
  44. private var shareMenuViewWindow: UIView?
  45. private var dropDown = DropDown()
  46. private var networking: NCShareNetworking?
  47. private let SHARE_TYPE_USER = 0
  48. private let SHARE_TYPE_GROUP = 1
  49. private let SHARE_TYPE_LINK = 3
  50. private let SHARE_TYPE_EMAIL = 4
  51. private let SHARE_TYPE_CONTACT = 5
  52. private let SHARE_TYPE_REMOTE = 6
  53. private let SHARE_TYPE_CIRCLE = 7
  54. private let SHARE_TYPE_GUEST = 8
  55. private let SHARE_TYPE_REMOTE_GROUP = 9
  56. private let SHARE_TYPE_ROOM = 10
  57. override func viewDidLoad() {
  58. super.viewDidLoad()
  59. viewContainerConstraint.constant = height
  60. searchFieldTopConstraint.constant = 10
  61. searchField.placeholder = NSLocalizedString("_shareLinksearch_placeholder_", comment: "")
  62. shareLinkLabel.text = NSLocalizedString("_share_link_", comment: "")
  63. shareLinkImage.image = NCShareCommon.sharedInstance.createLinkAvatar()
  64. buttonCopy.setImage(CCGraphics.changeThemingColorImage(UIImage.init(named: "shareCopy"), width: 100, height: 100, color: UIColor.gray), for: .normal)
  65. tableView.dataSource = self
  66. tableView.delegate = self
  67. tableView.allowsSelection = false
  68. tableView.register(UINib.init(nibName: "NCShareLinkCell", bundle: nil), forCellReuseIdentifier: "cellLink")
  69. tableView.register(UINib.init(nibName: "NCShareUserCell", bundle: nil), forCellReuseIdentifier: "cellUser")
  70. NotificationCenter.default.addObserver(self, selector: #selector(reloadData), name: NSNotification.Name(rawValue: k_notificationCenter_reloadDataNCShare), object: nil)
  71. // Shared with you by ...
  72. if metadata!.ownerId != self.appDelegate.activeUserID {
  73. searchFieldTopConstraint.constant = 65
  74. sharedWithYouByView.isHidden = false
  75. sharedWithYouByLabel.text = NSLocalizedString("_shared_with_you_by_", comment: "") + " " + metadata!.ownerDisplayName
  76. let fileNameLocalPath = CCUtility.getDirectoryUserData() + "/" + CCUtility.getStringUser(appDelegate.activeUser, activeUrl: appDelegate.activeUrl) + "-" + metadata!.ownerId + ".png"
  77. if FileManager.default.fileExists(atPath: fileNameLocalPath) {
  78. if let image = UIImage(contentsOfFile: fileNameLocalPath) { sharedWithYouByImage.image = image }
  79. } else {
  80. NCCommunication.shared.downloadAvatar(userID: metadata!.ownerId, fileNameLocalPath: fileNameLocalPath, size: Int(k_avatar_size)) { (account, data, errorCode, errorMessage) in
  81. if errorCode == 0 && account == self.appDelegate.activeAccount && UIImage(data: data!) != nil {
  82. if let image = UIImage(contentsOfFile: fileNameLocalPath) {
  83. self.sharedWithYouByImage.image = image
  84. }
  85. } else {
  86. self.sharedWithYouByImage.image = UIImage(named: "avatar")
  87. }
  88. }
  89. }
  90. }
  91. reloadData()
  92. networking = NCShareNetworking.init(metadata: metadata!, activeUrl: appDelegate.activeUrl, view: self.view, delegate: self)
  93. networking?.readShare()
  94. // changeTheming
  95. NotificationCenter.default.addObserver(self, selector: #selector(changeTheming), name: NSNotification.Name(rawValue: k_notificationCenter_changeTheming), object: nil)
  96. changeTheming()
  97. }
  98. @objc func changeTheming() {
  99. appDelegate.changeTheming(self, tableView: tableView, collectionView: nil, form: true)
  100. shareLinkLabel.textColor = NCBrandColor.sharedInstance.textView
  101. }
  102. @objc func reloadData() {
  103. let shares = NCManageDatabase.sharedInstance.getTableShares(metadata: metadata!)
  104. if shares.firstShareLink == nil {
  105. buttonMenu.setImage(CCGraphics.changeThemingColorImage(UIImage.init(named: "shareAdd"), width: 100, height: 100, color: UIColor.gray), for: .normal)
  106. buttonCopy.isHidden = true
  107. } else {
  108. buttonMenu.setImage(CCGraphics.changeThemingColorImage(UIImage.init(named: "shareMenu"), width: 100, height: 100, color: UIColor.gray), for: .normal)
  109. buttonCopy.isHidden = false
  110. }
  111. tableView.reloadData()
  112. }
  113. // MARK: - IBAction
  114. @IBAction func searchFieldDidEndOnExit(textField: UITextField) {
  115. guard let searchString = textField.text else { return }
  116. networking?.getSharees(searchString: searchString)
  117. }
  118. @IBAction func touchUpInsideButtonCopy(_ sender: Any) {
  119. guard let metadata = self.metadata else { return }
  120. let shares = NCManageDatabase.sharedInstance.getTableShares(metadata: metadata)
  121. tapCopy(with: shares.firstShareLink, sender: sender)
  122. }
  123. @IBAction func touchUpInsideButtonMenu(_ sender: Any) {
  124. guard let metadata = self.metadata else { return }
  125. let isFilesSharingPublicPasswordEnforced = NCManageDatabase.sharedInstance.getCapabilitiesServerBool(account: metadata.account, elements: NCElementsJSON.shared.capabilitiesFileSharingPubPasswdEnforced, exists: false)
  126. let shares = NCManageDatabase.sharedInstance.getTableShares(metadata: metadata)
  127. if isFilesSharingPublicPasswordEnforced && shares.firstShareLink == nil {
  128. let alertController = UIAlertController(title: NSLocalizedString("_enforce_password_protection_", comment: ""), message: "", preferredStyle: .alert)
  129. alertController.addTextField { (textField) in
  130. textField.isSecureTextEntry = true
  131. textField.addTarget(self, action: #selector(self.minCharTextFieldDidChange(sender:)), for: UIControl.Event.editingChanged)
  132. }
  133. alertController.addAction(UIAlertAction(title: NSLocalizedString("_cancel_", comment: ""), style: .default) { (action:UIAlertAction) in })
  134. let okAction = UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .default) { (action:UIAlertAction) in
  135. let password = alertController.textFields?.first?.text
  136. self.networking?.createShareLink(password: password ?? "")
  137. }
  138. okAction.isEnabled = false
  139. alertController.addAction(okAction)
  140. self.present(alertController, animated: true, completion:nil)
  141. } else if shares.firstShareLink == nil {
  142. networking?.createShareLink(password: "")
  143. } else {
  144. tapMenu(with: shares.firstShareLink!, sender: sender)
  145. }
  146. }
  147. @objc func minCharTextFieldDidChange(sender: UITextField) {
  148. guard let alertController = self.presentedViewController as? UIAlertController else { return }
  149. guard let password = alertController.textFields?.first else { return }
  150. guard let ok = alertController.actions.last else { return }
  151. ok.isEnabled = password.text?.count ?? 0 >= 8
  152. }
  153. @objc func tapLinkMenuViewWindow(gesture: UITapGestureRecognizer) {
  154. shareLinkMenuView?.unLoad()
  155. shareLinkMenuView = nil
  156. shareUserMenuView?.unLoad()
  157. shareUserMenuView = nil
  158. }
  159. func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool {
  160. return gestureRecognizer.view == touch.view
  161. }
  162. func tapCopy(with tableShare: tableShare?, sender: Any) {
  163. NCShareCommon.sharedInstance.copyLink(tableShare: tableShare, viewController: self, sender: sender)
  164. }
  165. func switchCanEdit(with tableShare: tableShare?, switch: Bool, sender: UISwitch) {
  166. guard let tableShare = tableShare else { return }
  167. guard let metadata = self.metadata else { return }
  168. let canShare = CCUtility.isPermission(toCanShare: tableShare.permissions)
  169. var permission: Int = 0
  170. if sender.isOn {
  171. permission = CCUtility.getPermissionsValue(byCanEdit: true, andCanCreate: true, andCanChange: true, andCanDelete: true, andCanShare: canShare, andIsFolder: metadata.directory)
  172. } else {
  173. permission = CCUtility.getPermissionsValue(byCanEdit: false, andCanCreate: false, andCanChange: false, andCanDelete: false, andCanShare: canShare, andIsFolder: metadata.directory)
  174. }
  175. networking?.updateShare(idShare: tableShare.idShare, password: nil, permission: permission, note: nil, expirationDate: nil, hideDownload: tableShare.hideDownload)
  176. }
  177. func tapMenu(with tableShare: tableShare?, sender: Any) {
  178. guard let tableShare = tableShare else { return }
  179. if tableShare.shareType == 3 {
  180. let views = NCShareCommon.sharedInstance.openViewMenuShareLink(shareViewController: self, tableShare: tableShare, metadata: metadata!)
  181. shareLinkMenuView = views.shareLinkMenuView
  182. shareMenuViewWindow = views.viewWindow
  183. let tap = UITapGestureRecognizer(target: self, action: #selector(tapLinkMenuViewWindow))
  184. tap.delegate = self
  185. shareMenuViewWindow?.addGestureRecognizer(tap)
  186. } else {
  187. let views = NCShareCommon.sharedInstance.openViewMenuUser(shareViewController: self, tableShare: tableShare, metadata: metadata!)
  188. shareUserMenuView = views.shareUserMenuView
  189. shareMenuViewWindow = views.viewWindow
  190. let tap = UITapGestureRecognizer(target: self, action: #selector(tapLinkMenuViewWindow))
  191. tap.delegate = self
  192. shareMenuViewWindow?.addGestureRecognizer(tap)
  193. }
  194. }
  195. /// MARK: - NCShareNetworkingDelegate
  196. func readShareCompleted() {
  197. NotificationCenter.default.postOnMainThread(name: k_notificationCenter_reloadDataNCShare)
  198. }
  199. func shareCompleted() {
  200. NotificationCenter.default.postOnMainThread(name: k_notificationCenter_reloadDataNCShare)
  201. }
  202. func unShareCompleted() { }
  203. func updateShareWithError(idShare: Int) { }
  204. func getSharees(sharees: [NCCommunicationSharee]?) {
  205. guard let sharees = sharees else { return }
  206. dropDown = DropDown()
  207. let appearance = DropDown.appearance()
  208. appearance.backgroundColor = .white
  209. appearance.cornerRadius = 10
  210. appearance.shadowColor = UIColor(white: 0.5, alpha: 1)
  211. appearance.shadowOpacity = 0.9
  212. appearance.shadowRadius = 25
  213. appearance.animationduration = 0.25
  214. appearance.textColor = .darkGray
  215. appearance.setupMaskedCorners([.layerMaxXMaxYCorner, .layerMinXMaxYCorner])
  216. for sharee in sharees {
  217. dropDown.dataSource.append(sharee.label)
  218. }
  219. dropDown.anchorView = searchField
  220. dropDown.bottomOffset = CGPoint(x: 0, y: searchField.bounds.height)
  221. dropDown.width = searchField.bounds.width
  222. dropDown.direction = .bottom
  223. dropDown.cellNib = UINib(nibName: "NCShareUserDropDownCell", bundle: nil)
  224. dropDown.customCellConfiguration = { (index: Index, item: String, cell: DropDownCell) -> Void in
  225. guard let cell = cell as? NCShareUserDropDownCell else { return }
  226. cell.imageItem.image = UIImage(named: "avatar")
  227. let sharee = sharees[index]
  228. let fileNameLocalPath = CCUtility.getDirectoryUserData() + "/" + CCUtility.getStringUser(self.appDelegate.activeUser, activeUrl: self.appDelegate.activeUrl) + "-" + sharee.label + ".png"
  229. if FileManager.default.fileExists(atPath: fileNameLocalPath) {
  230. if let image = UIImage(contentsOfFile: fileNameLocalPath) { cell.imageItem.image = image }
  231. } else {
  232. DispatchQueue.global().async {
  233. NCCommunication.shared.downloadAvatar(userID: sharee.shareWith, fileNameLocalPath: fileNameLocalPath, size: Int(k_avatar_size)) { (account, data, errorCode, errorMessage) in
  234. if errorCode == 0 && account == self.appDelegate.activeAccount && UIImage(data: data!) != nil {
  235. if let image = UIImage(contentsOfFile: fileNameLocalPath) {
  236. DispatchQueue.main.async {
  237. cell.imageItem.image = image
  238. }
  239. }
  240. } else {
  241. DispatchQueue.main.async {
  242. cell.imageItem.image = UIImage(named: "avatar")
  243. }
  244. }
  245. }
  246. }
  247. }
  248. switch sharee.shareType {
  249. case self.SHARE_TYPE_USER:
  250. cell.imageShareeType.image = UIImage(named: "shareTypeUser")
  251. case self.SHARE_TYPE_GROUP:
  252. cell.imageShareeType.image = UIImage(named: "shareTypeGroup")
  253. case self.SHARE_TYPE_LINK:
  254. cell.imageShareeType.image = UIImage(named: "shareTypeLink")
  255. case self.SHARE_TYPE_EMAIL:
  256. cell.imageShareeType.image = UIImage(named: "shareTypeEmail")
  257. case self.SHARE_TYPE_CONTACT:
  258. cell.imageShareeType.image = UIImage(named: "shareTypeUser")
  259. case self.SHARE_TYPE_REMOTE:
  260. cell.imageShareeType.image = UIImage(named: "shareTypeUser")
  261. case self.SHARE_TYPE_CIRCLE:
  262. cell.imageShareeType.image = UIImage(named: "shareTypeUser")
  263. case self.SHARE_TYPE_GUEST:
  264. cell.imageShareeType.image = UIImage(named: "shareTypeUser")
  265. case self.SHARE_TYPE_REMOTE_GROUP:
  266. cell.imageShareeType.image = UIImage(named: "shareTypeGroup")
  267. case self.SHARE_TYPE_ROOM:
  268. cell.imageShareeType.image = UIImage(named: "shareTypeRoom")
  269. default:
  270. cell.imageShareeType.image = UIImage(named: "shareTypeUser")
  271. }
  272. }
  273. dropDown.selectionAction = { [weak self] (index, item) in
  274. let sharee = sharees[index]
  275. self!.networking?.createShare(name: sharee.label, shareType: sharee.shareType, metadata: self!.metadata!)
  276. }
  277. dropDown.show()
  278. }
  279. }
  280. // MARK: - UITableViewDelegate
  281. extension NCShare: UITableViewDelegate {
  282. func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
  283. return 60
  284. }
  285. }
  286. // MARK: - UITableViewDataSource
  287. extension NCShare: UITableViewDataSource {
  288. func numberOfSections(in tableView: UITableView) -> Int {
  289. return 1
  290. }
  291. func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
  292. var numOfRows = 0
  293. let shares = NCManageDatabase.sharedInstance.getTableShares(metadata: metadata!)
  294. if shares.share != nil {
  295. numOfRows = shares.share!.count
  296. }
  297. return numOfRows
  298. }
  299. func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
  300. let shares = NCManageDatabase.sharedInstance.getTableShares(metadata: metadata!)
  301. let tableShare = shares.share![indexPath.row]
  302. // LINK
  303. if tableShare.shareType == 3 {
  304. if let cell = tableView.dequeueReusableCell(withIdentifier: "cellLink", for: indexPath) as? NCShareLinkCell {
  305. cell.tableShare = tableShare
  306. cell.delegate = self
  307. cell.labelTitle.text = NSLocalizedString("_share_link_", comment: "")
  308. cell.labelTitle.textColor = NCBrandColor.sharedInstance.textView
  309. return cell
  310. }
  311. } else {
  312. // USER
  313. if let cell = tableView.dequeueReusableCell(withIdentifier: "cellUser", for: indexPath) as? NCShareUserCell {
  314. cell.tableShare = tableShare
  315. cell.delegate = self
  316. cell.labelTitle.text = tableShare.shareWithDisplayname
  317. cell.labelTitle.textColor = NCBrandColor.sharedInstance.textView
  318. cell.labelCanEdit.text = NSLocalizedString("_share_permission_edit_", comment: "")
  319. cell.labelCanEdit.textColor = NCBrandColor.sharedInstance.textView
  320. cell.isUserInteractionEnabled = true
  321. cell.switchCanEdit.isHidden = false
  322. cell.labelCanEdit.isHidden = false
  323. cell.buttonMenu.isHidden = false
  324. let fileNameLocalPath = CCUtility.getDirectoryUserData() + "/" + CCUtility.getStringUser(appDelegate.activeUser, activeUrl: appDelegate.activeUrl) + "-" + tableShare.shareWith + ".png"
  325. if FileManager.default.fileExists(atPath: fileNameLocalPath) {
  326. if let image = UIImage(contentsOfFile: fileNameLocalPath) { cell.imageItem.image = image }
  327. } else {
  328. DispatchQueue.global().async {
  329. NCCommunication.shared.downloadAvatar(userID: tableShare.shareWith, fileNameLocalPath: fileNameLocalPath, size: Int(k_avatar_size)) { (account, data, errorCode, errorMessage) in
  330. if errorCode == 0 && account == self.appDelegate.activeAccount && UIImage(data: data!) != nil {
  331. if let image = UIImage(contentsOfFile: fileNameLocalPath) {
  332. cell.imageItem.image = image
  333. }
  334. } else {
  335. cell.imageItem.image = UIImage(named: "avatar")
  336. }
  337. }
  338. }
  339. }
  340. if CCUtility.isAnyPermission(toEdit: tableShare.permissions) {
  341. cell.switchCanEdit.setOn(true, animated: false)
  342. } else {
  343. cell.switchCanEdit.setOn(false, animated: false)
  344. }
  345. // If the initiator or the recipient is not the current user, show the list of sharees without any options to edit it.
  346. if tableShare.uidOwner != self.appDelegate.activeUserID && tableShare.uidFileOwner != self.appDelegate.activeUserID {
  347. cell.isUserInteractionEnabled = false
  348. cell.switchCanEdit.isHidden = true
  349. cell.labelCanEdit.isHidden = true
  350. cell.buttonMenu.isHidden = true
  351. }
  352. return cell
  353. }
  354. }
  355. return UITableViewCell()
  356. }
  357. }
  358. // MARK: - NCShareLinkCell
  359. class NCShareLinkCell: UITableViewCell {
  360. @IBOutlet weak var imageItem: UIImageView!
  361. @IBOutlet weak var labelTitle: UILabel!
  362. @IBOutlet weak var buttonCopy: UIButton!
  363. @IBOutlet weak var buttonMenu: UIButton!
  364. private let iconShare: CGFloat = 200
  365. var tableShare: tableShare?
  366. var delegate: NCShareLinkCellDelegate?
  367. override func awakeFromNib() {
  368. super.awakeFromNib()
  369. imageItem.image = NCShareCommon.sharedInstance.createLinkAvatar()
  370. buttonCopy.setImage(CCGraphics.changeThemingColorImage(UIImage.init(named: "shareCopy"), width:100, height: 100, color: UIColor.gray), for: .normal)
  371. buttonMenu.setImage(CCGraphics.changeThemingColorImage(UIImage.init(named: "shareMenu"), width:100, height: 100, color: UIColor.gray), for: .normal)
  372. }
  373. @IBAction func touchUpInsideCopy(_ sender: Any) {
  374. delegate?.tapCopy(with: tableShare, sender: sender)
  375. }
  376. @IBAction func touchUpInsideMenu(_ sender: Any) {
  377. delegate?.tapMenu(with: tableShare, sender: sender)
  378. }
  379. }
  380. protocol NCShareLinkCellDelegate {
  381. func tapCopy(with tableShare: tableShare?, sender: Any)
  382. func tapMenu(with tableShare: tableShare?, sender: Any)
  383. }
  384. // MARK: - NCShareUserCell
  385. class NCShareUserCell: UITableViewCell {
  386. @IBOutlet weak var imageItem: UIImageView!
  387. @IBOutlet weak var labelTitle: UILabel!
  388. @IBOutlet weak var labelCanEdit: UILabel!
  389. @IBOutlet weak var switchCanEdit: UISwitch!
  390. @IBOutlet weak var buttonMenu: UIButton!
  391. var tableShare: tableShare?
  392. var delegate: NCShareUserCellDelegate?
  393. override func awakeFromNib() {
  394. super.awakeFromNib()
  395. switchCanEdit.transform = CGAffineTransform(scaleX: 0.75, y: 0.75)
  396. switchCanEdit.onTintColor = NCBrandColor.sharedInstance.brandElement
  397. buttonMenu.setImage(CCGraphics.changeThemingColorImage(UIImage.init(named: "shareMenu"), width:100, height: 100, color: UIColor.gray), for: .normal)
  398. }
  399. @IBAction func switchCanEditChanged(sender: UISwitch) {
  400. delegate?.switchCanEdit(with: tableShare, switch: sender.isOn, sender: sender)
  401. }
  402. @IBAction func touchUpInsideMenu(_ sender: Any) {
  403. delegate?.tapMenu(with: tableShare, sender: sender)
  404. }
  405. }
  406. protocol NCShareUserCellDelegate {
  407. func switchCanEdit(with tableShare: tableShare?, switch: Bool, sender: UISwitch)
  408. func tapMenu(with tableShare: tableShare?, sender: Any)
  409. }
  410. // MARK: - NCShareUserDropDownCell
  411. class NCShareUserDropDownCell: DropDownCell {
  412. @IBOutlet weak var imageItem: UIImageView!
  413. @IBOutlet weak var imageShareeType: UIImageView!
  414. }