Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
a4ee593
Add menu
mpivchev Aug 8, 2025
5205bea
Merge branch 'master' of https://github.com/nextcloud/ios into declar…
mpivchev Sep 18, 2025
fd87337
WIP
mpivchev Sep 22, 2025
ed8a527
WIP
mpivchev Sep 22, 2025
70e7521
Merge branch 'master' of https://github.com/nextcloud/ios into declar…
mpivchev Sep 22, 2025
965977e
Replace sheet with native context menu
mpivchev Sep 23, 2025
3bd98c6
Merge branch 'master' of https://github.com/nextcloud/ios into declar…
mpivchev Sep 23, 2025
c1adab5
WIP
mpivchev Sep 23, 2025
0a793b1
WIP
mpivchev Sep 25, 2025
3fc8c0f
Merge branch 'master' of https://github.com/nextcloud/ios into declar…
mpivchev Oct 1, 2025
783822b
WIP
mpivchev Oct 1, 2025
b98c61c
Merge branch 'master' of https://github.com/nextcloud/ios into declar…
mpivchev Dec 2, 2025
1eba37b
Refactor
mpivchev Dec 2, 2025
9c26f98
Use relative file path
mpivchev Dec 2, 2025
4d9c211
Refactor
mpivchev Dec 3, 2025
75b014f
API
mpivchev Dec 3, 2025
ea1ed18
Error handling
mpivchev Dec 3, 2025
ab9d2d4
WIP
mpivchev Dec 3, 2025
3568ee9
WIP
mpivchev Dec 8, 2025
f25edde
Merge branch 'master' of https://github.com/nextcloud/ios into declar…
mpivchev Dec 9, 2025
4e65ec0
WIP
mpivchev Dec 9, 2025
c3dee5a
WIP
mpivchev Dec 9, 2025
22eae10
WIP
mpivchev Dec 9, 2025
476a9bb
WIP
mpivchev Dec 10, 2025
ff7b7a0
Sendable fix
mpivchev Dec 10, 2025
2a05902
Refactor
mpivchev Dec 10, 2025
6b234df
Refactor
mpivchev Dec 10, 2025
1a1a903
Refactor
mpivchev Dec 10, 2025
471f8ad
WIP
mpivchev Dec 11, 2025
668ad4d
Merge branch 'master' of https://github.com/nextcloud/ios into declar…
mpivchev Jan 6, 2026
4821a42
Bring back more button in list
mpivchev Jan 6, 2026
93852f6
Revert more button in grid
mpivchev Jan 6, 2026
54013b7
WIP
mpivchev Jan 6, 2026
aed33b1
WIP
mpivchev Jan 7, 2026
2c033d1
WIP
mpivchev Jan 8, 2026
55161d4
WIP
mpivchev Jan 8, 2026
b8d710c
Refactor
mpivchev Jan 8, 2026
c4297f0
Recommendations menu
mpivchev Jan 8, 2026
c11f075
Photo cell fix
mpivchev Jan 8, 2026
8b3e673
Resize icons
mpivchev Jan 9, 2026
51e208a
Refactor
mpivchev Jan 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ extension FileProviderExtension {
}

if (favorite == true && !metadata.favorite) || (!favorite && metadata.favorite) {
let fileNamePath = NCUtilityFileSystem().getFileNamePath(metadata.fileName, serverUrl: metadata.serverUrl, urlBase: metadata.urlBase, userId: metadata.userId)
let fileNamePath = NCUtilityFileSystem().getRelativeFilePath(metadata.fileName, serverUrl: metadata.serverUrl, urlBase: metadata.urlBase, userId: metadata.userId)
let resultsFavorite = await NextcloudKit.shared.setFavoriteAsync(fileName: fileNamePath, favorite: favorite, account: metadata.account)

if resultsFavorite.error == .success {
Expand Down
20 changes: 15 additions & 5 deletions Nextcloud.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
AFCE353927E5DE0500FEA6C2 /* Shareable.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFCE353827E5DE0400FEA6C2 /* Shareable.swift */; };
D5B6AA7827200C7200D49C24 /* NCActivityTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5B6AA7727200C7200D49C24 /* NCActivityTableViewCell.swift */; };
F310B1EF2BA862F1001C42F5 /* NCViewerMedia+VisionKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = F310B1EE2BA862F1001C42F5 /* NCViewerMedia+VisionKit.swift */; };
F317C82E2E844C5300761AEA /* ClientIntegrationUIViewer.swift in Sources */ = {isa = PBXBuildFile; fileRef = F317C82D2E844C5300761AEA /* ClientIntegrationUIViewer.swift */; };
F321DA8A2B71205A00DDA0E6 /* NCTrashSelectTabBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = F321DA892B71205A00DDA0E6 /* NCTrashSelectTabBar.swift */; };
F32FADA92D1176E3007035E2 /* UIButton+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F32FADA82D1176DE007035E2 /* UIButton+Extension.swift */; };
F3374A812D64AB9F002A38F9 /* StatusInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3374A802D64AB9E002A38F9 /* StatusInfo.swift */; };
Expand Down Expand Up @@ -544,7 +545,6 @@
F77444F622281649000D5EB0 /* NCMediaCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F77444F422281649000D5EB0 /* NCMediaCell.xib */; };
F77444F8222816D5000D5EB0 /* NCPickerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F77444F7222816D5000D5EB0 /* NCPickerViewController.swift */; };
F778231E2C42C07C001BB94F /* NCCollectionViewCommon+MediaLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = F778231D2C42C07C001BB94F /* NCCollectionViewCommon+MediaLayout.swift */; };
F77A697D250A0FBC00FF1708 /* NCCollectionViewCommon+Menu.swift in Sources */ = {isa = PBXBuildFile; fileRef = F77A697C250A0FBC00FF1708 /* NCCollectionViewCommon+Menu.swift */; };
F77B0F631D118A16002130FE /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = F7E70DE91A24DE4100E1B66A /* Localizable.strings */; };
F77B0F7D1D118A16002130FE /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F7F67BB81A24D27800EE80DA /* Images.xcassets */; };
F77BB746289984CA0090FC19 /* UIViewController+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F77BB745289984CA0090FC19 /* UIViewController+Extension.swift */; };
Expand Down Expand Up @@ -1225,6 +1225,8 @@
C04E2F202A17BB4D001BAD85 /* NextcloudIntegrationTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NextcloudIntegrationTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
D5B6AA7727200C7200D49C24 /* NCActivityTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCActivityTableViewCell.swift; sourceTree = "<group>"; };
F310B1EE2BA862F1001C42F5 /* NCViewerMedia+VisionKit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NCViewerMedia+VisionKit.swift"; sourceTree = "<group>"; };
F317C82B2E82E5C200761AEA /* NextcloudKit */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = NextcloudKit; path = ../NextcloudKit; sourceTree = SOURCE_ROOT; };
F317C82D2E844C5300761AEA /* ClientIntegrationUIViewer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClientIntegrationUIViewer.swift; sourceTree = "<group>"; };
F321DA892B71205A00DDA0E6 /* NCTrashSelectTabBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCTrashSelectTabBar.swift; sourceTree = "<group>"; };
F32FADA82D1176DE007035E2 /* UIButton+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIButton+Extension.swift"; sourceTree = "<group>"; };
F3374A802D64AB9E002A38F9 /* StatusInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatusInfo.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1498,7 +1500,6 @@
F77444F422281649000D5EB0 /* NCMediaCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = NCMediaCell.xib; sourceTree = "<group>"; };
F77444F7222816D5000D5EB0 /* NCPickerViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCPickerViewController.swift; sourceTree = "<group>"; };
F778231D2C42C07C001BB94F /* NCCollectionViewCommon+MediaLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NCCollectionViewCommon+MediaLayout.swift"; sourceTree = "<group>"; };
F77A697C250A0FBC00FF1708 /* NCCollectionViewCommon+Menu.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NCCollectionViewCommon+Menu.swift"; sourceTree = "<group>"; };
F77BB745289984CA0090FC19 /* UIViewController+Extension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIViewController+Extension.swift"; sourceTree = "<group>"; };
F77BB747289985270090FC19 /* UITabBarController+Extension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UITabBarController+Extension.swift"; sourceTree = "<group>"; };
F77BB7492899857B0090FC19 /* UINavigationController+Extension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UINavigationController+Extension.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1984,7 +1985,6 @@
isa = PBXGroup;
children = (
F376A3732E5CC5FF0067EE25 /* ContextMenuActions.swift */,
F77A697C250A0FBC00FF1708 /* NCCollectionViewCommon+Menu.swift */,
F78C6FDD296D677300C952C3 /* NCContextMenu.swift */,
3704EB2923D5A58400455C5B /* NCMenu.storyboard */,
371B5A2D23D0B04500FAFAE9 /* NCMenu.swift */,
Expand Down Expand Up @@ -2096,6 +2096,14 @@
path = Tests;
sourceTree = "<group>";
};
F317C82C2E844C3C00761AEA /* Client Integration */ = {
isa = PBXGroup;
children = (
F317C82D2E844C5300761AEA /* ClientIntegrationUIViewer.swift */,
);
path = "Client Integration";
sourceTree = "<group>";
};
F3374A7F2D64AB40002A38F9 /* Components */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -3219,6 +3227,7 @@
C04E2F202A17BB4D001BAD85 /* NextcloudIntegrationTests.xctest */,
C0046CDA2A17B98400D87C9D /* NextcloudUITests.xctest */,
F7F1FBA62E27D13700C79E20 /* Frameworks */,
F317C82B2E82E5C200761AEA /* NextcloudKit */,
);
sourceTree = "<group>";
};
Expand All @@ -3238,6 +3247,7 @@
F70F96AF2874394B006C8379 /* Nextcloud-Bridging-Header.h */,
F7F67BB81A24D27800EE80DA /* Images.xcassets */,
F769CA1B2966EF4F00039397 /* GUI */,
F317C82C2E844C3C00761AEA /* Client Integration */,
F70211F31BAC56E9003FC03E /* Main */,
F7FDFF5A2E437E55000D7688 /* Account */,
F7A321621E9E37960069AD1B /* Activity */,
Expand Down Expand Up @@ -4471,7 +4481,6 @@
F710D2022405826100A6033D /* NCViewerContextMenu.swift in Sources */,
F765E9CD295C585800A09ED8 /* NCUploadScanDocument.swift in Sources */,
F741C2242B6B9FD600E849BB /* NCMediaSelectTabBar.swift in Sources */,
F77A697D250A0FBC00FF1708 /* NCCollectionViewCommon+Menu.swift in Sources */,
F7BF9D822934CA21009EE9A6 /* NCManageDatabase+LayoutForView.swift in Sources */,
AA8D31662D411FA100FE2775 /* NCShareDateCell.swift in Sources */,
F3F442EE2DDE292D00FD701F /* NCMetadataPermissions.swift in Sources */,
Expand All @@ -4493,6 +4502,7 @@
F76882362C0DD1E7001CF441 /* NCAcknowledgementsView.swift in Sources */,
F785EE9D246196DF00B3F945 /* NCNetworkingE2EE.swift in Sources */,
F724377B2C10B83E00C7C68D /* NCSharePermissions.swift in Sources */,
F317C82E2E844C5300761AEA /* ClientIntegrationUIViewer.swift in Sources */,
F794E13D2BBBFF2E003693D7 /* NCMainTabBarController.swift in Sources */,
F7CBC1252BAC8B0000EC1D55 /* NCSectionFirstHeaderEmptyData.swift in Sources */,
F7D4BF3D2CA2E8D800A5E746 /* TOPasscodeKeypadView.m in Sources */,
Expand Down Expand Up @@ -6099,7 +6109,7 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/nextcloud/NextcloudKit";
requirement = {
branch = main;
branch = declarative_ui;
kind = branch;
};
};
Expand Down
83 changes: 83 additions & 0 deletions iOSClient/Client Integration/ClientIntegrationUIViewer.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2025 Milen Pivchev
// SPDX-License-Identifier: GPL-3.0-or-later

import SwiftUI

struct ClientIntegrationUIViewer: View {
@Environment(\.openURL) private var openURL

struct Row: Identifiable {
let id = UUID()
let element: String
let title: String?
let urlString: String
}

// Configurable inputs
let rows: [Row]
let baseURL: String

var body: some View {
ScrollView {
LazyVStack(alignment: .leading, spacing: 12) {
ForEach(rows) { row in
VStack(alignment: .leading, spacing: 8) {
HStack {
Text(row.element)
.font(.subheadline)
.fontWeight(.semibold)
.foregroundStyle(.secondary)
Spacer()
}

if let title = row.title {
Text(title).font(.headline)
}

let finalUrl = baseURL + row.urlString

Text(finalUrl)
.font(.footnote)
.foregroundStyle(.secondary)
.textSelection(.enabled)

HStack(spacing: 12) {
Button {
openURL(URL(string: finalUrl)!)
} label: {
Label("Open", systemImage: "safari")
}

Button {
UIPasteboard.general.string = row.urlString
} label: {
Label("Copy", systemImage: "doc.on.doc")
}
}
.buttonStyle(.borderedProminent)
}
.padding()
.background(.thinMaterial, in: RoundedRectangle(cornerRadius: 12))
}
}
.padding()
}
}

// private func resolvedURL(for row: Row) -> URL? {
// // If the string is already an absolute URL with a scheme, use it.
// if let absolute = URL(string: row.urlString), absolute.scheme != nil {
// return absolute
// }
// // Otherwise, resolve relative to the provided base URL if available.
// if let baseURL {
// return URL(string: row.urlString, relativeTo: baseURL)?.absoluteURL
// }
// return nil
// }
}

#Preview {
ClientIntegrationUIViewer(rows: [.init(element: "URL", title: "Test", urlString: "/test")], baseURL: "test.com")
}
2 changes: 1 addition & 1 deletion iOSClient/DeepLink/NCDeepLinkHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class NCDeepLinkHandler {
DispatchQueue.main.asyncAfter(deadline: .now() + 4) {
let serverUrl = controller.currentServerUrl()
let session = NCSession.shared.getSession(controller: controller)
let fileFolderPath = NCUtilityFileSystem().getFileNamePath("", serverUrl: serverUrl, session: session)
let fileFolderPath = NCUtilityFileSystem().getRelativeFilePath("", serverUrl: serverUrl, session: session)
let fileFolderName = (serverUrl as NSString).lastPathComponent
let capabilities = NCNetworking.shared.capabilities[controller.account] ?? NKCapabilities.Capabilities()

Expand Down
24 changes: 7 additions & 17 deletions iOSClient/Main/Collection Common/Cell/NCGridCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class NCGridCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCCellProto
@IBOutlet weak var imageVisualEffect: UIVisualEffectView!
@IBOutlet weak var iconsStackView: UIStackView!

var ocId = ""
var ocId = "" { didSet { gridCellDelegate?.tapMoreGridItem(with: ocId, button: buttonMore, sender: self) /* preconfigure UIMenu with each ocId */ } }
var ocIdTransfer = ""
var account = ""
var user = ""
Expand Down Expand Up @@ -124,32 +124,23 @@ class NCGridCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCCellProto
longPressedGesture.delegate = self
longPressedGesture.delaysTouchesBegan = true
self.addGestureRecognizer(longPressedGesture)

contentView.bringSubviewToFront(buttonMore)

buttonMore.menu = nil
buttonMore.showsMenuAsPrimaryAction = true
}

override func snapshotView(afterScreenUpdates afterUpdates: Bool) -> UIView? {
return nil
}

@IBAction func touchUpInsideMore(_ sender: Any) {
gridCellDelegate?.tapMoreGridItem(with: ocId, ocIdTransfer: ocIdTransfer, image: imageItem.image, sender: sender)
}

@objc func longPress(gestureRecognizer: UILongPressGestureRecognizer) {
gridCellDelegate?.longPressGridItem(with: ocId, ocIdTransfer: ocIdTransfer, gestureRecognizer: gestureRecognizer)
}

fileprivate func setA11yActions() {
self.accessibilityCustomActions = [
UIAccessibilityCustomAction(
name: NSLocalizedString("_more_", comment: ""),
target: self,
selector: #selector(touchUpInsideMore(_:)))
]
}

func setButtonMore(image: UIImage) {
buttonMore.setImage(image, for: .normal)
setA11yActions()
}

func hideImageItem(_ status: Bool) {
Expand Down Expand Up @@ -190,7 +181,6 @@ class NCGridCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCCellProto
accessibilityCustomActions = nil
} else {
buttonMore.isHidden = false
setA11yActions()
}
if status {
imageSelect.isHidden = false
Expand Down Expand Up @@ -221,7 +211,7 @@ class NCGridCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCCellProto
}

protocol NCGridCellDelegate: AnyObject {
func tapMoreGridItem(with ocId: String, ocIdTransfer: String, image: UIImage?, sender: Any)
func tapMoreGridItem(with ocId: String, button: UIButton, sender: Any)
func longPressGridItem(with ocId: String, ocIdTransfer: String, gestureRecognizer: UILongPressGestureRecognizer)
}

Expand Down
31 changes: 16 additions & 15 deletions iOSClient/Main/Collection Common/Cell/NCListCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
@IBOutlet weak var separatorHeightConstraint: NSLayoutConstraint!
@IBOutlet weak var titleTrailingConstraint: NSLayoutConstraint!

var ocId = ""
var ocId = "" { didSet { listCellDelegate?.tapMoreListItem(with: ocId, button: buttonMore, sender: self) /* preconfigure UIMenu with each ocId */ } }
var ocIdTransfer = ""
var user = ""

Expand Down Expand Up @@ -152,11 +152,10 @@
tag1.text = ""
titleInfoTrailingDefault()

let longPressedGesture = UILongPressGestureRecognizer(target: self, action: #selector(longPress(gestureRecognizer:)))
longPressedGesture.minimumPressDuration = 0.5
longPressedGesture.delegate = self
longPressedGesture.delaysTouchesBegan = true
self.addGestureRecognizer(longPressedGesture)
contentView.bringSubviewToFront(buttonMore)

buttonMore.menu = nil
buttonMore.showsMenuAsPrimaryAction = true
}

override func snapshotView(afterScreenUpdates afterUpdates: Bool) -> UIView? {
Expand All @@ -167,24 +166,25 @@
listCellDelegate?.tapShareListItem(with: ocId, ocIdTransfer: ocIdTransfer, sender: sender)
}

@IBAction func touchUpInsideMore(_ sender: Any) {
listCellDelegate?.tapMoreListItem(with: ocId, ocIdTransfer: ocIdTransfer, image: imageItem.image, sender: sender)
}

@objc func longPress(gestureRecognizer: UILongPressGestureRecognizer) {
listCellDelegate?.longPressListItem(with: ocId, ocIdTransfer: ocIdTransfer, gestureRecognizer: gestureRecognizer)
}

Check warning on line 172 in iOSClient/Main/Collection Common/Cell/NCListCell.swift

View workflow job for this annotation

GitHub Actions / Lint

Trailing Whitespace Violation: Lines should not have trailing whitespace (trailing_whitespace)
// Allow the button to receive taps even with the long press gesture
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool {
// Don't handle touches on buttons
if touch.view is UIButton {
return false
}
return true
}

fileprivate func setA11yActions() {
self.accessibilityCustomActions = [
UIAccessibilityCustomAction(
name: NSLocalizedString("_share_", comment: ""),
target: self,
selector: #selector(touchUpInsideShare(_:))),

Check warning on line 187 in iOSClient/Main/Collection Common/Cell/NCListCell.swift

View workflow job for this annotation

GitHub Actions / Lint

Trailing Comma Violation: Collection literals should not have trailing commas (trailing_comma)
UIAccessibilityCustomAction(
name: NSLocalizedString("_more_", comment: ""),
target: self,
selector: #selector(touchUpInsideMore(_:)))
]
}

Expand Down Expand Up @@ -322,8 +322,8 @@
}

protocol NCListCellDelegate: AnyObject {
func tapMoreListItem(with ocId: String, button: UIButton, sender: Any)
func tapShareListItem(with ocId: String, ocIdTransfer: String, sender: Any)
func tapMoreListItem(with ocId: String, ocIdTransfer: String, image: UIImage?, sender: Any)
func longPressListItem(with ocId: String, ocIdTransfer: String, gestureRecognizer: UILongPressGestureRecognizer)
}

Expand Down Expand Up @@ -438,3 +438,4 @@
return result
}
}

Check warning on line 441 in iOSClient/Main/Collection Common/Cell/NCListCell.swift

View workflow job for this annotation

GitHub Actions / Lint

Trailing Newline Violation: Files should have a single trailing newline (trailing_newline)
11 changes: 8 additions & 3 deletions iOSClient/Main/Collection Common/Cell/NCPhotoCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class NCPhotoCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCCellProt
@IBOutlet weak var buttonMore: UIButton!
@IBOutlet weak var imageVisualEffect: UIVisualEffectView!

var ocId = ""
var ocId = "" { didSet { photoCellDelegate?.tapMorePhotoItem(with: ocId, button: buttonMore, sender: self) /* preconfigure UIMenu with each ocId */ } }
var ocIdTransfer = ""
var user = ""

Expand Down Expand Up @@ -85,14 +85,19 @@ class NCPhotoCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCCellProt
longPressedGesture.delegate = self
longPressedGesture.delaysTouchesBegan = true
self.addGestureRecognizer(longPressedGesture)

contentView.bringSubviewToFront(buttonMore)

buttonMore.menu = nil
buttonMore.showsMenuAsPrimaryAction = true
}

override func snapshotView(afterScreenUpdates afterUpdates: Bool) -> UIView? {
return nil
}

@IBAction func touchUpInsideMore(_ sender: Any) {
photoCellDelegate?.tapMorePhotoItem(with: ocId, ocIdTransfer: ocIdTransfer, image: imageItem.image, sender: sender)
photoCellDelegate?.tapMorePhotoItem(with: ocId, button: buttonMore, sender: sender)
}

@objc func longPress(gestureRecognizer: UILongPressGestureRecognizer) {
Expand Down Expand Up @@ -139,6 +144,6 @@ class NCPhotoCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCCellProt
}

protocol NCPhotoCellDelegate: AnyObject {
func tapMorePhotoItem(with ocId: String, ocIdTransfer: String, image: UIImage?, sender: Any)
func tapMorePhotoItem(with ocId: String, button: UIButton, sender: Any)
func longPressPhotoItem(with objectId: String, ocIdTransfer: String, gestureRecognizer: UILongPressGestureRecognizer)
}
Loading
Loading