diff --git a/Nextcloud.xcodeproj/project.pbxproj b/Nextcloud.xcodeproj/project.pbxproj index 60fdfe7095..8ce38f7b0f 100644 --- a/Nextcloud.xcodeproj/project.pbxproj +++ b/Nextcloud.xcodeproj/project.pbxproj @@ -123,6 +123,19 @@ F34E1AD72ECB937D00FA10C3 /* NCStatusMessageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F34E1AD62ECB937D00FA10C3 /* NCStatusMessageView.swift */; }; F34E1AD92ECC839100FA10C3 /* EmojiTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = F34E1AD82ECC839100FA10C3 /* EmojiTextField.swift */; }; F34E1ADB2ECC842B00FA10C3 /* NCStatusMessageModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F34E1ADA2ECC842200FA10C3 /* NCStatusMessageModel.swift */; }; + F359A0E72FC75AAD00CB4029 /* NextcloudKit in Frameworks */ = {isa = PBXBuildFile; productRef = F359A0E62FC75AAD00CB4029 /* NextcloudKit */; }; + F359A0E92FC75AAD00CB4029 /* NextcloudKitUI in Frameworks */ = {isa = PBXBuildFile; productRef = F359A0E82FC75AAD00CB4029 /* NextcloudKitUI */; }; + F359A0EB2FC75B0B00CB4029 /* NextcloudKit in Frameworks */ = {isa = PBXBuildFile; productRef = F359A0EA2FC75B0B00CB4029 /* NextcloudKit */; }; + F359A0ED2FC75B1D00CB4029 /* NextcloudKit in Frameworks */ = {isa = PBXBuildFile; productRef = F359A0EC2FC75B1D00CB4029 /* NextcloudKit */; }; + F359A0EF2FC75B3200CB4029 /* NextcloudKit in Frameworks */ = {isa = PBXBuildFile; productRef = F359A0EE2FC75B3200CB4029 /* NextcloudKit */; }; + F359A0F12FC75B6300CB4029 /* NextcloudKit in Frameworks */ = {isa = PBXBuildFile; productRef = F359A0F02FC75B6300CB4029 /* NextcloudKit */; }; + F359A0F32FC75B6900CB4029 /* NextcloudKit in Frameworks */ = {isa = PBXBuildFile; productRef = F359A0F22FC75B6900CB4029 /* NextcloudKit */; }; + F359A0F52FC75B7000CB4029 /* NextcloudKit in Frameworks */ = {isa = PBXBuildFile; productRef = F359A0F42FC75B7000CB4029 /* NextcloudKit */; }; + F359A0F72FC75B7000CB4029 /* NextcloudKitUI in Frameworks */ = {isa = PBXBuildFile; productRef = F359A0F62FC75B7000CB4029 /* NextcloudKitUI */; }; + F359A0F92FC75B7300CB4029 /* NextcloudKit in Frameworks */ = {isa = PBXBuildFile; productRef = F359A0F82FC75B7300CB4029 /* NextcloudKit */; }; + F359A0FB2FC75B9400CB4029 /* NextcloudKit in Frameworks */ = {isa = PBXBuildFile; productRef = F359A0FA2FC75B9400CB4029 /* NextcloudKit */; }; + F359A0FD2FC75B9800CB4029 /* NextcloudKit in Frameworks */ = {isa = PBXBuildFile; productRef = F359A0FC2FC75B9800CB4029 /* NextcloudKit */; }; + F359A0FF2FC75BAE00CB4029 /* NextcloudKit in Frameworks */ = {isa = PBXBuildFile; productRef = F359A0FE2FC75BAE00CB4029 /* NextcloudKit */; }; F359D8672A7D03420023F405 /* NCUtility+Exif.swift in Sources */ = {isa = PBXBuildFile; fileRef = F359D8662A7D03420023F405 /* NCUtility+Exif.swift */; }; F36C514F2E89393C0097E5F7 /* UIView+BlurVibrancy.swift in Sources */ = {isa = PBXBuildFile; fileRef = F36C514D2E89393C0097E5F7 /* UIView+BlurVibrancy.swift */; }; F36E64F72B9245210085ABB5 /* NCCollectionViewCommon+SelectTabBarDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F36E64F62B9245210085ABB5 /* NCCollectionViewCommon+SelectTabBarDelegate.swift */; }; @@ -134,9 +147,7 @@ F37208A62BAB63EE006B5430 /* SwiftRichString in Frameworks */ = {isa = PBXBuildFile; productRef = F37208A52BAB63EE006B5430 /* SwiftRichString */; }; F37208AA2BAB63EE006B5430 /* MarkdownKit in Frameworks */ = {isa = PBXBuildFile; productRef = F37208A92BAB63EE006B5430 /* MarkdownKit */; }; F37208B22BAB63EF006B5430 /* DropDown in Frameworks */ = {isa = PBXBuildFile; productRef = F37208B12BAB63EF006B5430 /* DropDown */; }; - F37208B42BAB63EF006B5430 /* Parchment in Frameworks */ = {isa = PBXBuildFile; productRef = F37208B32BAB63EF006B5430 /* Parchment */; }; F37208B62BAB63EF006B5430 /* EasyTipView in Frameworks */ = {isa = PBXBuildFile; productRef = F37208B52BAB63EF006B5430 /* EasyTipView */; }; - F37208B82BAB63EF006B5430 /* NextcloudKit in Frameworks */ = {isa = PBXBuildFile; productRef = F37208B72BAB63EF006B5430 /* NextcloudKit */; }; F37208BA2BAB63EF006B5430 /* TLPhotoPicker in Frameworks */ = {isa = PBXBuildFile; productRef = F37208B92BAB63EF006B5430 /* TLPhotoPicker */; }; F37208BC2BAB63EF006B5430 /* OpenSSL in Frameworks */ = {isa = PBXBuildFile; productRef = F37208BB2BAB63EF006B5430 /* OpenSSL */; }; F37208BE2BAB63F0006B5430 /* Swifter in Frameworks */ = {isa = PBXBuildFile; productRef = F37208BD2BAB63F0006B5430 /* Swifter */; }; @@ -296,10 +307,6 @@ F72944F52A8424F800246839 /* NCEndToEndMetadataV1.swift in Sources */ = {isa = PBXBuildFile; fileRef = F72944F42A8424F800246839 /* NCEndToEndMetadataV1.swift */; }; F72944F62A8424F800246839 /* NCEndToEndMetadataV1.swift in Sources */ = {isa = PBXBuildFile; fileRef = F72944F42A8424F800246839 /* NCEndToEndMetadataV1.swift */; }; F72A17D828B221E300F3F159 /* DashboardWidgetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F72A17D728B221E300F3F159 /* DashboardWidgetView.swift */; }; - F72AD70D28C24B93006CB92D /* NextcloudKit in Frameworks */ = {isa = PBXBuildFile; productRef = F72AD70C28C24B93006CB92D /* NextcloudKit */; }; - F72AD70F28C24BA1006CB92D /* NextcloudKit in Frameworks */ = {isa = PBXBuildFile; productRef = F72AD70E28C24BA1006CB92D /* NextcloudKit */; }; - F72AD71128C24BBB006CB92D /* NextcloudKit in Frameworks */ = {isa = PBXBuildFile; productRef = F72AD71028C24BBB006CB92D /* NextcloudKit */; }; - F72AD71328C24BCC006CB92D /* NextcloudKit in Frameworks */ = {isa = PBXBuildFile; productRef = F72AD71228C24BCC006CB92D /* NextcloudKit */; }; F72CA0572F5048C3002E2F06 /* UIApplication+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F72CA0562F5048C3002E2F06 /* UIApplication+Extension.swift */; }; F72CA05C2F5051DB002E2F06 /* AlertActionBannerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F72CA05B2F5051DB002E2F06 /* AlertActionBannerView.swift */; }; F72CD63A25C19EBF00F46F9A /* NCAutoUpload.swift in Sources */ = {isa = PBXBuildFile; fileRef = F72CD63925C19EBF00F46F9A /* NCAutoUpload.swift */; }; @@ -380,7 +387,6 @@ F7490E6E29882B56009DCE94 /* NCBrand.swift in Sources */ = {isa = PBXBuildFile; fileRef = F76B3CCD1EAE01BD00921AC9 /* NCBrand.swift */; }; F7490E7229882BB4009DCE94 /* RealmSwift in Frameworks */ = {isa = PBXBuildFile; productRef = F7490E7129882BB4009DCE94 /* RealmSwift */; }; F7490E8729882CA8009DCE94 /* ThreadSafeDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7245923289BB50B00474787 /* ThreadSafeDictionary.swift */; }; - F7490E8B29882CE4009DCE94 /* NextcloudKit in Frameworks */ = {isa = PBXBuildFile; productRef = F7490E8A29882CE4009DCE94 /* NextcloudKit */; }; F7490E8D29882F5B009DCE94 /* Custom.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F700222B1EC479840080073F /* Custom.xcassets */; }; F7490E8E2988334A009DCE94 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = F7E70DE91A24DE4100E1B66A /* Localizable.strings */; }; F749B64A297B0CBB00087535 /* NCManageDatabase+Share.swift in Sources */ = {isa = PBXBuildFile; fileRef = F749B649297B0CBB00087535 /* NCManageDatabase+Share.swift */; }; @@ -633,7 +639,6 @@ F783030228B4C4B800B84583 /* NCUtility.swift in Sources */ = {isa = PBXBuildFile; fileRef = F70BFC7320E0FA7C00C67599 /* NCUtility.swift */; }; F783030328B4C4DD00B84583 /* ThreadSafeDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7245923289BB50B00474787 /* ThreadSafeDictionary.swift */; }; F783030728B4C52800B84583 /* UIColor+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F70CEF5523E9C7E50007035B /* UIColor+Extension.swift */; }; - F783034428B5142B00B84583 /* NextcloudKit in Frameworks */ = {isa = PBXBuildFile; productRef = F783034328B5142B00B84583 /* NextcloudKit */; }; F78448B52FB1BE9000F2909A /* NCVideoViewerContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F78448A82FB1BE9000F2909A /* NCVideoViewerContentView.swift */; }; F78448BA2FB1BE9000F2909A /* NCVideoPlaybackController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F78448A32FB1BE9000F2909A /* NCVideoPlaybackController.swift */; }; F78448BE2FB1C33B00F2909A /* NCVideoVLCViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F78448BD2FB1C33B00F2909A /* NCVideoVLCViewController.swift */; }; @@ -717,7 +722,6 @@ F7A76DC8256A71CD00119AB3 /* UIImage+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7B7504A2397D38E004E13EC /* UIImage+Extension.swift */; }; F7A7FDDD2C2DBD6200E9A93A /* NCDeepLinkHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7A7FDDB2C2DBD6200E9A93A /* NCDeepLinkHandler.swift */; }; F7A846DE2BB01ACB0024816F /* NCTrashCellProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7A846DD2BB01ACB0024816F /* NCTrashCellProtocol.swift */; }; - F7A8D72428F1771B008BBE1C /* NextcloudKit in Frameworks */ = {isa = PBXBuildFile; productRef = F7A8D72328F1771B008BBE1C /* NextcloudKit */; }; F7A8D72828F17728008BBE1C /* RealmSwift in Frameworks */ = {isa = PBXBuildFile; productRef = F7A8D72728F17728008BBE1C /* RealmSwift */; }; F7A8D73528F17E16008BBE1C /* NCManageDatabase.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7BAADB51ED5A87C00B7EAD4 /* NCManageDatabase.swift */; }; F7A8D73628F17E1A008BBE1C /* NCManageDatabase+Activity.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF4BF61D27562B3F0081CEEF /* NCManageDatabase+Activity.swift */; }; @@ -755,7 +759,6 @@ F7B934FE2BDCFE1E002B2FC9 /* NCDragDrop.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7B934FD2BDCFE1E002B2FC9 /* NCDragDrop.swift */; }; F7BAADCB1ED5A87C00B7EAD4 /* NCManageDatabase.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7BAADB51ED5A87C00B7EAD4 /* NCManageDatabase.swift */; }; F7BAADCC1ED5A87C00B7EAD4 /* NCManageDatabase.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7BAADB51ED5A87C00B7EAD4 /* NCManageDatabase.swift */; }; - F7BB7E4727A18C56009B9F29 /* Parchment in Frameworks */ = {isa = PBXBuildFile; productRef = F7BB7E4627A18C56009B9F29 /* Parchment */; }; F7BC287E26663F6C004D46C5 /* NCViewCertificateDetails.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F7BC287D26663F6C004D46C5 /* NCViewCertificateDetails.storyboard */; }; F7BC288026663F85004D46C5 /* NCViewCertificateDetails.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7BC287F26663F85004D46C5 /* NCViewCertificateDetails.swift */; }; F7BD0A002C468925003A4A6D /* NCMedia+CollectionViewDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7BD09FF2C468925003A4A6D /* NCMedia+CollectionViewDataSource.swift */; }; @@ -792,7 +795,6 @@ F7C55C8F2FB5B045004A974F /* NCBrand.swift in Sources */ = {isa = PBXBuildFile; fileRef = F76B3CCD1EAE01BD00921AC9 /* NCBrand.swift */; }; F7C55C9A2FB5B127004A974F /* ThreadSafeDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7245923289BB50B00474787 /* ThreadSafeDictionary.swift */; }; F7C55C9B2FB5B1A7004A974F /* UIColor+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F70CEF5523E9C7E50007035B /* UIColor+Extension.swift */; }; - F7C55C9F2FB5B83A004A974F /* NextcloudKit in Frameworks */ = {isa = PBXBuildFile; productRef = F7C55C9E2FB5B83A004A974F /* NextcloudKit */; }; F7C55CC92FB5CE74004A974F /* ActionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7C55CC32FB5CE74004A974F /* ActionViewController.swift */; }; F7C55CCA2FB5CE74004A974F /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F7C55CC42FB5CE74004A974F /* Images.xcassets */; }; F7C55CCC2FB5CE74004A974F /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F7C55CC72FB5CE74004A974F /* MainInterface.storyboard */; }; @@ -1370,6 +1372,7 @@ F3DDFE222F1FB4C300A784C8 /* NCAssistantChatModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCAssistantChatModel.swift; sourceTree = ""; }; F3E173AF2C9AF637006D177A /* ScreenAwakeManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScreenAwakeManager.swift; sourceTree = ""; }; F3E173BF2C9B1067006D177A /* AwakeMode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AwakeMode.swift; sourceTree = ""; }; + F3E3D7A32FA12B0C007FC9F0 /* NextcloudKit */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = NextcloudKit; path = ../NextcloudKit; sourceTree = SOURCE_ROOT; }; F3F442ED2DDE292600FD701F /* NCMetadataPermissions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMetadataPermissions.swift; sourceTree = ""; }; F700222B1EC479840080073F /* Custom.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Custom.xcassets; sourceTree = ""; }; F700510022DF63AC003A3356 /* NCShare.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = NCShare.storyboard; sourceTree = ""; }; @@ -1966,7 +1969,7 @@ buildActionMask = 2147483647; files = ( F33EE6ED2BF4C03800CA1A51 /* NIOSSL in Frameworks */, - F72AD71128C24BBB006CB92D /* NextcloudKit in Frameworks */, + F359A0F12FC75B6300CB4029 /* NextcloudKit in Frameworks */, F710FC88277B7D3F00AA9FBF /* RealmSwift in Frameworks */, F760DE0F2AE66EE60027D78A /* KeychainAccess in Frameworks */, ); @@ -1976,6 +1979,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F359A0F32FC75B6900CB4029 /* NextcloudKit in Frameworks */, F3F0419B2B9F7E6700D5155F /* RealmSwift in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1989,6 +1993,8 @@ F37208C82BAB63F1006B5430 /* KeychainAccess in Frameworks */, F37208A62BAB63EE006B5430 /* SwiftRichString in Frameworks */, F37208C22BAB63F0006B5430 /* TagListView in Frameworks */, + F359A0F52FC75B7000CB4029 /* NextcloudKit in Frameworks */, + F359A0F72FC75B7000CB4029 /* NextcloudKitUI in Frameworks */, F3391B162B4C52F6001C0C4B /* FirebaseDatabase in Frameworks */, F37208B62BAB63EF006B5430 /* EasyTipView in Frameworks */, F37208BA2BAB63EF006B5430 /* TLPhotoPicker in Frameworks */, @@ -1997,8 +2003,6 @@ F37208A42BAB63EE006B5430 /* QRCodeReader in Frameworks */, F37208B22BAB63EF006B5430 /* DropDown in Frameworks */, F37208BC2BAB63EF006B5430 /* OpenSSL in Frameworks */, - F37208B82BAB63EF006B5430 /* NextcloudKit in Frameworks */, - F37208B42BAB63EF006B5430 /* Parchment in Frameworks */, F37208BE2BAB63F0006B5430 /* Swifter in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -2007,6 +2011,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + F359A0F92FC75B7300CB4029 /* NextcloudKit in Frameworks */, F3F0419D2B9F7E6E00D5155F /* RealmSwift in Frameworks */, F3391B082B4C52C5001C0C4B /* FirebaseDatabase in Frameworks */, ); @@ -2016,9 +2021,9 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - F7490E8B29882CE4009DCE94 /* NextcloudKit in Frameworks */, F7490E7229882BB4009DCE94 /* RealmSwift in Frameworks */, F71221802F51AF9F00ACEB08 /* LucidBanner in Frameworks */, + F359A0FD2FC75B9800CB4029 /* NextcloudKit in Frameworks */, F760DE0D2AE66EDF0027D78A /* KeychainAccess in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -2029,8 +2034,8 @@ files = ( F710FC80277B7D2700AA9FBF /* RealmSwift in Frameworks */, F70557B92ED44E4700135623 /* LucidBanner in Frameworks */, - F72AD70F28C24BA1006CB92D /* NextcloudKit in Frameworks */, F33EE6E72BF4C02600CA1A51 /* NIOSSL in Frameworks */, + F359A0FF2FC75BAE00CB4029 /* NextcloudKit in Frameworks */, F77CB6A92AA08053000C3CA4 /* OpenSSL in Frameworks */, F760DE092AE66ED00027D78A /* KeychainAccess in Frameworks */, F70821D829E59E6D001CA2D7 /* TagListView in Frameworks */, @@ -2043,9 +2048,9 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - F783034428B5142B00B84583 /* NextcloudKit in Frameworks */, F33EE6E32BF4C00700CA1A51 /* NIOSSL in Frameworks */, F7160A7D2BE931DE0034DCB3 /* RealmSwift in Frameworks */, + F359A0EF2FC75B3200CB4029 /* NextcloudKit in Frameworks */, F760DE052AE66EBE0027D78A /* KeychainAccess in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -2056,8 +2061,8 @@ files = ( F760DE0B2AE66ED80027D78A /* KeychainAccess in Frameworks */, F710FC84277B7D3500AA9FBF /* RealmSwift in Frameworks */, + F359A0FB2FC75B9400CB4029 /* NextcloudKit in Frameworks */, F712217E2F51AF9500ACEB08 /* LucidBanner in Frameworks */, - F72AD71328C24BCC006CB92D /* NextcloudKit in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2071,7 +2076,8 @@ F788ECC7263AAAFA00ADC67F /* MarkdownKit in Frameworks */, F3374AF02D78B01B002A38F9 /* BitCollections in Frameworks */, F77BC3EB293E5268005F2B08 /* Swifter in Frameworks */, - F7BB7E4727A18C56009B9F29 /* Parchment in Frameworks */, + F359A0E72FC75AAD00CB4029 /* NextcloudKit in Frameworks */, + F359A0E92FC75AAD00CB4029 /* NextcloudKitUI in Frameworks */, F33EE6E12BF4BDA500CA1A51 /* NIOSSL in Frameworks */, F734B06628E75C0100E180D5 /* TLPhotoPicker in Frameworks */, F760DE032AE66EA80027D78A /* KeychainAccess in Frameworks */, @@ -2085,7 +2091,6 @@ F3374AF42D78B01B002A38F9 /* DequeModule in Frameworks */, F7160A822BE933390034DCB3 /* RealmSwift in Frameworks */, F3374AF22D78B01B002A38F9 /* Collections in Frameworks */, - F72AD70D28C24B93006CB92D /* NextcloudKit in Frameworks */, F70B86752642CE3B00ED5349 /* FirebaseCrashlytics in Frameworks */, F7A1050E29E587AF00FFD92B /* TagListView in Frameworks */, F76DA969277B77EA0082465B /* DropDown in Frameworks */, @@ -2098,7 +2103,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - F7C55C9F2FB5B83A004A974F /* NextcloudKit in Frameworks */, + F359A0EB2FC75B0B00CB4029 /* NextcloudKit in Frameworks */, F7C55C7C2FB5AEF7004A974F /* UniformTypeIdentifiers.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -2108,7 +2113,7 @@ buildActionMask = 2147483647; files = ( F7A8D72828F17728008BBE1C /* RealmSwift in Frameworks */, - F7A8D72428F1771B008BBE1C /* NextcloudKit in Frameworks */, + F359A0ED2FC75B1D00CB4029 /* NextcloudKit in Frameworks */, F33EE6E52BF4C02000CA1A51 /* NIOSSL in Frameworks */, F760DE072AE66EC70027D78A /* KeychainAccess in Frameworks */, ); @@ -3545,6 +3550,7 @@ F7F1FBA62E27D13700C79E20 /* Frameworks */, F31165012F9674A1009A1E37 /* AppIcon.icon */, F7C55C7A2FB5AEF7004A974F /* Action Assistant.appex */, + F3E3D7A32FA12B0C007FC9F0 /* NextcloudKit */, ); sourceTree = ""; }; @@ -3686,9 +3692,9 @@ name = "Notification Service Extension"; packageProductDependencies = ( F710FC87277B7D3F00AA9FBF /* RealmSwift */, - F72AD71028C24BBB006CB92D /* NextcloudKit */, F760DE0E2AE66EE60027D78A /* KeychainAccess */, F33EE6EC2BF4C03800CA1A51 /* NIOSSL */, + F359A0F02FC75B6300CB4029 /* NextcloudKit */, ); productName = "Notification Service Extension"; productReference = 2C33C47F23E2C475005F963B /* Notification Service Extension.appex */; @@ -3711,6 +3717,7 @@ name = NextcloudUnitTests; packageProductDependencies = ( F3F0419A2B9F7E6700D5155F /* RealmSwift */, + F359A0F22FC75B6900CB4029 /* NextcloudKit */, ); productName = NextcloudTests; productReference = AF8ED1F92757821000B8DBC4 /* NextcloudUnitTests.xctest */; @@ -3738,9 +3745,7 @@ F37208A52BAB63EE006B5430 /* SwiftRichString */, F37208A92BAB63EE006B5430 /* MarkdownKit */, F37208B12BAB63EF006B5430 /* DropDown */, - F37208B32BAB63EF006B5430 /* Parchment */, F37208B52BAB63EF006B5430 /* EasyTipView */, - F37208B72BAB63EF006B5430 /* NextcloudKit */, F37208B92BAB63EF006B5430 /* TLPhotoPicker */, F37208BB2BAB63EF006B5430 /* OpenSSL */, F37208BD2BAB63F0006B5430 /* Swifter */, @@ -3748,6 +3753,8 @@ F37208C12BAB63F0006B5430 /* TagListView */, F37208C32BAB63F0006B5430 /* Gzip */, F37208C72BAB63F1006B5430 /* KeychainAccess */, + F359A0F42FC75B7000CB4029 /* NextcloudKit */, + F359A0F62FC75B7000CB4029 /* NextcloudKitUI */, ); productName = NextcloudUITests; productReference = C0046CDA2A17B98400D87C9D /* NextcloudUITests.xctest */; @@ -3771,6 +3778,7 @@ packageProductDependencies = ( F3391B072B4C52C5001C0C4B /* FirebaseDatabase */, F3F0419C2B9F7E6E00D5155F /* RealmSwift */, + F359A0F82FC75B7300CB4029 /* NextcloudKit */, ); productName = NextcloudIntegrationTests; productReference = C04E2F202A17BB4D001BAD85 /* NextcloudIntegrationTests.xctest */; @@ -3792,9 +3800,9 @@ name = "File Provider Extension UI"; packageProductDependencies = ( F7490E7129882BB4009DCE94 /* RealmSwift */, - F7490E8A29882CE4009DCE94 /* NextcloudKit */, F760DE0C2AE66EDF0027D78A /* KeychainAccess */, F712217F2F51AF9F00ACEB08 /* LucidBanner */, + F359A0FC2FC75B9800CB4029 /* NextcloudKit */, ); productName = "File Provider Extension UI"; productReference = F70716E32987F81500E72C1D /* File Provider Extension UI.appex */; @@ -3817,13 +3825,13 @@ packageProductDependencies = ( F72D7EB6263B1207000B3DFC /* MarkdownKit */, F710FC7F277B7D2700AA9FBF /* RealmSwift */, - F72AD70E28C24BA1006CB92D /* NextcloudKit */, F70821D729E59E6D001CA2D7 /* TagListView */, F7F623B62A5EFA0C0022D3D4 /* Gzip */, F77CB6A82AA08053000C3CA4 /* OpenSSL */, F760DE082AE66ED00027D78A /* KeychainAccess */, F33EE6E62BF4C02600CA1A51 /* NIOSSL */, F70557B82ED44E4700135623 /* LucidBanner */, + F359A0FE2FC75BAE00CB4029 /* NextcloudKit */, ); productName = "Share Ext"; productReference = F7CE8AFB1DC1F8D8009CAE48 /* Share.appex */; @@ -3844,10 +3852,10 @@ ); name = Widget; packageProductDependencies = ( - F783034328B5142B00B84583 /* NextcloudKit */, F760DE042AE66EBE0027D78A /* KeychainAccess */, F7160A7C2BE931DE0034DCB3 /* RealmSwift */, F33EE6E22BF4C00700CA1A51 /* NIOSSL */, + F359A0EE2FC75B3200CB4029 /* NextcloudKit */, ); productName = DashboardWidgetExtension; productReference = F7346E1028B0EF5B006CE2D2 /* Widget.appex */; @@ -3869,9 +3877,9 @@ name = "File Provider Extension"; packageProductDependencies = ( F710FC83277B7D3500AA9FBF /* RealmSwift */, - F72AD71228C24BCC006CB92D /* NextcloudKit */, F760DE0A2AE66ED80027D78A /* KeychainAccess */, F712217D2F51AF9500ACEB08 /* LucidBanner */, + F359A0FA2FC75B9400CB4029 /* NextcloudKit */, ); productName = "File Provider Extension"; productReference = F771E3D020E2392D00AFB62D /* File Provider Extension.appex */; @@ -3907,9 +3915,7 @@ F788ECC6263AAAFA00ADC67F /* MarkdownKit */, F70B86742642CE3B00ED5349 /* FirebaseCrashlytics */, F76DA968277B77EA0082465B /* DropDown */, - F7BB7E4627A18C56009B9F29 /* Parchment */, F753BA92281FD8020015BFB6 /* EasyTipView */, - F72AD70C28C24B93006CB92D /* NextcloudKit */, F734B06528E75C0100E180D5 /* TLPhotoPicker */, F77333872927A72100466E35 /* OpenSSL */, F77BC3EA293E5268005F2B08 /* Swifter */, @@ -3928,6 +3934,8 @@ F3374AF52D78B01B002A38F9 /* HashTreeCollections */, F3374AF72D78B01B002A38F9 /* HeapModule */, F70557B62ED44E2700135623 /* LucidBanner */, + F359A0E62FC75AAD00CB4029 /* NextcloudKit */, + F359A0E82FC75AAD00CB4029 /* NextcloudKitUI */, ); productName = "Crypto Cloud"; productReference = F7CE8AFA1DC1F8D8009CAE48 /* Nextcloud.app */; @@ -3947,7 +3955,7 @@ ); name = "Action Assistant"; packageProductDependencies = ( - F7C55C9E2FB5B83A004A974F /* NextcloudKit */, + F359A0EA2FC75B0B00CB4029 /* NextcloudKit */, ); productName = "Action Assistant"; productReference = F7C55C7A2FB5AEF7004A974F /* Action Assistant.appex */; @@ -3968,10 +3976,10 @@ ); name = WidgetDashboardIntentHandler; packageProductDependencies = ( - F7A8D72328F1771B008BBE1C /* NextcloudKit */, F7A8D72728F17728008BBE1C /* RealmSwift */, F760DE062AE66EC70027D78A /* KeychainAccess */, F33EE6E42BF4C02000CA1A51 /* NIOSSL */, + F359A0EC2FC75B1D00CB4029 /* NextcloudKit */, ); productName = WidgetDashboardIntentHandler; productReference = F7C9739028F17131002C43E2 /* WidgetDashboardIntentHandler.appex */; @@ -4110,9 +4118,7 @@ F70B86732642CE3B00ED5349 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */, F76DA967277B77E90082465B /* XCRemoteSwiftPackageReference "DropDown" */, F710FC78277B7CFF00AA9FBF /* XCRemoteSwiftPackageReference "realm-swift" */, - F7BB7E4527A18C56009B9F29 /* XCRemoteSwiftPackageReference "Parchment" */, F753BA91281FD8010015BFB6 /* XCRemoteSwiftPackageReference "EasyTipView" */, - F783034028B511D200B84583 /* XCRemoteSwiftPackageReference "NextcloudKit" */, F734B06428E75C0100E180D5 /* XCRemoteSwiftPackageReference "TLPhotoPicker" */, F77333862927A72100466E35 /* XCRemoteSwiftPackageReference "OpenSSL" */, F77BC3E9293E5268005F2B08 /* XCRemoteSwiftPackageReference "swifter" */, @@ -4126,6 +4132,7 @@ F7D4BF4E2CA2ECCB00A5E746 /* XCRemoteSwiftPackageReference "vlckit-spm" */, F3374AEE2D78B01B002A38F9 /* XCRemoteSwiftPackageReference "swift-collections" */, F70557B52ED44E2700135623 /* XCRemoteSwiftPackageReference "LucidBanner" */, + F359A0E52FC75AAD00CB4029 /* XCRemoteSwiftPackageReference "NextcloudKit" */, ); productRefGroup = F7F67B9F1A24D27800EE80DA; projectDirPath = ""; @@ -6523,6 +6530,14 @@ minimumVersion = 2.65.0; }; }; + F359A0E52FC75AAD00CB4029 /* XCRemoteSwiftPackageReference "NextcloudKit" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/nextcloud/NextcloudKit"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 7.3.2; + }; + }; F3A0479C2BD268B500658E7B /* XCRemoteSwiftPackageReference "PopupView" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/exyte/PopupView.git"; @@ -6611,14 +6626,6 @@ kind = branch; }; }; - F783034028B511D200B84583 /* XCRemoteSwiftPackageReference "NextcloudKit" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/nextcloud/NextcloudKit"; - requirement = { - branch = main; - kind = branch; - }; - }; F788ECC5263AAAF900ADC67F /* XCRemoteSwiftPackageReference "MarkdownKit" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/bmoliveira/MarkdownKit"; @@ -6635,14 +6642,6 @@ minimumVersion = 1.0.0; }; }; - F7BB7E4527A18C56009B9F29 /* XCRemoteSwiftPackageReference "Parchment" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/rechsteiner/Parchment"; - requirement = { - kind = exactVersion; - version = 3.3.0; - }; - }; F7D4BF4E2CA2ECCB00A5E746 /* XCRemoteSwiftPackageReference "vlckit-spm" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/tylerjonesio/vlckit-spm"; @@ -6743,6 +6742,60 @@ package = F33EE6EE2BF4C0FF00CA1A51 /* XCRemoteSwiftPackageReference "swift-nio" */; productName = NIO; }; + F359A0E62FC75AAD00CB4029 /* NextcloudKit */ = { + isa = XCSwiftPackageProductDependency; + package = F359A0E52FC75AAD00CB4029 /* XCRemoteSwiftPackageReference "NextcloudKit" */; + productName = NextcloudKit; + }; + F359A0E82FC75AAD00CB4029 /* NextcloudKitUI */ = { + isa = XCSwiftPackageProductDependency; + package = F359A0E52FC75AAD00CB4029 /* XCRemoteSwiftPackageReference "NextcloudKit" */; + productName = NextcloudKitUI; + }; + F359A0EA2FC75B0B00CB4029 /* NextcloudKit */ = { + isa = XCSwiftPackageProductDependency; + productName = NextcloudKit; + }; + F359A0EC2FC75B1D00CB4029 /* NextcloudKit */ = { + isa = XCSwiftPackageProductDependency; + productName = NextcloudKit; + }; + F359A0EE2FC75B3200CB4029 /* NextcloudKit */ = { + isa = XCSwiftPackageProductDependency; + productName = NextcloudKit; + }; + F359A0F02FC75B6300CB4029 /* NextcloudKit */ = { + isa = XCSwiftPackageProductDependency; + productName = NextcloudKit; + }; + F359A0F22FC75B6900CB4029 /* NextcloudKit */ = { + isa = XCSwiftPackageProductDependency; + productName = NextcloudKit; + }; + F359A0F42FC75B7000CB4029 /* NextcloudKit */ = { + isa = XCSwiftPackageProductDependency; + productName = NextcloudKit; + }; + F359A0F62FC75B7000CB4029 /* NextcloudKitUI */ = { + isa = XCSwiftPackageProductDependency; + productName = NextcloudKitUI; + }; + F359A0F82FC75B7300CB4029 /* NextcloudKit */ = { + isa = XCSwiftPackageProductDependency; + productName = NextcloudKit; + }; + F359A0FA2FC75B9400CB4029 /* NextcloudKit */ = { + isa = XCSwiftPackageProductDependency; + productName = NextcloudKit; + }; + F359A0FC2FC75B9800CB4029 /* NextcloudKit */ = { + isa = XCSwiftPackageProductDependency; + productName = NextcloudKit; + }; + F359A0FE2FC75BAE00CB4029 /* NextcloudKit */ = { + isa = XCSwiftPackageProductDependency; + productName = NextcloudKit; + }; F37208A32BAB63EE006B5430 /* QRCodeReader */ = { isa = XCSwiftPackageProductDependency; package = F7ED547A25EEA65400956C55 /* XCRemoteSwiftPackageReference "QRCodeReader" */; @@ -6763,21 +6816,11 @@ package = F76DA967277B77E90082465B /* XCRemoteSwiftPackageReference "DropDown" */; productName = DropDown; }; - F37208B32BAB63EF006B5430 /* Parchment */ = { - isa = XCSwiftPackageProductDependency; - package = F7BB7E4527A18C56009B9F29 /* XCRemoteSwiftPackageReference "Parchment" */; - productName = Parchment; - }; F37208B52BAB63EF006B5430 /* EasyTipView */ = { isa = XCSwiftPackageProductDependency; package = F753BA91281FD8010015BFB6 /* XCRemoteSwiftPackageReference "EasyTipView" */; productName = EasyTipView; }; - F37208B72BAB63EF006B5430 /* NextcloudKit */ = { - isa = XCSwiftPackageProductDependency; - package = F783034028B511D200B84583 /* XCRemoteSwiftPackageReference "NextcloudKit" */; - productName = NextcloudKit; - }; F37208B92BAB63EF006B5430 /* TLPhotoPicker */ = { isa = XCSwiftPackageProductDependency; package = F734B06428E75C0100E180D5 /* XCRemoteSwiftPackageReference "TLPhotoPicker" */; @@ -6888,26 +6931,6 @@ package = F710FC78277B7CFF00AA9FBF /* XCRemoteSwiftPackageReference "realm-swift" */; productName = RealmSwift; }; - F72AD70C28C24B93006CB92D /* NextcloudKit */ = { - isa = XCSwiftPackageProductDependency; - package = F783034028B511D200B84583 /* XCRemoteSwiftPackageReference "NextcloudKit" */; - productName = NextcloudKit; - }; - F72AD70E28C24BA1006CB92D /* NextcloudKit */ = { - isa = XCSwiftPackageProductDependency; - package = F783034028B511D200B84583 /* XCRemoteSwiftPackageReference "NextcloudKit" */; - productName = NextcloudKit; - }; - F72AD71028C24BBB006CB92D /* NextcloudKit */ = { - isa = XCSwiftPackageProductDependency; - package = F783034028B511D200B84583 /* XCRemoteSwiftPackageReference "NextcloudKit" */; - productName = NextcloudKit; - }; - F72AD71228C24BCC006CB92D /* NextcloudKit */ = { - isa = XCSwiftPackageProductDependency; - package = F783034028B511D200B84583 /* XCRemoteSwiftPackageReference "NextcloudKit" */; - productName = NextcloudKit; - }; F72D7EB6263B1207000B3DFC /* MarkdownKit */ = { isa = XCSwiftPackageProductDependency; package = F788ECC5263AAAF900ADC67F /* XCRemoteSwiftPackageReference "MarkdownKit" */; @@ -6928,11 +6951,6 @@ package = F710FC78277B7CFF00AA9FBF /* XCRemoteSwiftPackageReference "realm-swift" */; productName = RealmSwift; }; - F7490E8A29882CE4009DCE94 /* NextcloudKit */ = { - isa = XCSwiftPackageProductDependency; - package = F783034028B511D200B84583 /* XCRemoteSwiftPackageReference "NextcloudKit" */; - productName = NextcloudKit; - }; F753BA92281FD8020015BFB6 /* EasyTipView */ = { isa = XCSwiftPackageProductDependency; package = F753BA91281FD8010015BFB6 /* XCRemoteSwiftPackageReference "EasyTipView" */; @@ -6993,11 +7011,6 @@ package = F77333862927A72100466E35 /* XCRemoteSwiftPackageReference "OpenSSL" */; productName = OpenSSL; }; - F783034328B5142B00B84583 /* NextcloudKit */ = { - isa = XCSwiftPackageProductDependency; - package = F783034028B511D200B84583 /* XCRemoteSwiftPackageReference "NextcloudKit" */; - productName = NextcloudKit; - }; F788ECC6263AAAFA00ADC67F /* MarkdownKit */ = { isa = XCSwiftPackageProductDependency; package = F788ECC5263AAAF900ADC67F /* XCRemoteSwiftPackageReference "MarkdownKit" */; @@ -7008,26 +7021,11 @@ package = F7A1050C29E587AF00FFD92B /* XCRemoteSwiftPackageReference "TagListView" */; productName = TagListView; }; - F7A8D72328F1771B008BBE1C /* NextcloudKit */ = { - isa = XCSwiftPackageProductDependency; - package = F783034028B511D200B84583 /* XCRemoteSwiftPackageReference "NextcloudKit" */; - productName = NextcloudKit; - }; F7A8D72728F17728008BBE1C /* RealmSwift */ = { isa = XCSwiftPackageProductDependency; package = F710FC78277B7CFF00AA9FBF /* XCRemoteSwiftPackageReference "realm-swift" */; productName = RealmSwift; }; - F7BB7E4627A18C56009B9F29 /* Parchment */ = { - isa = XCSwiftPackageProductDependency; - package = F7BB7E4527A18C56009B9F29 /* XCRemoteSwiftPackageReference "Parchment" */; - productName = Parchment; - }; - F7C55C9E2FB5B83A004A974F /* NextcloudKit */ = { - isa = XCSwiftPackageProductDependency; - package = F783034028B511D200B84583 /* XCRemoteSwiftPackageReference "NextcloudKit" */; - productName = NextcloudKit; - }; F7D4BF532CA2ED9D00A5E746 /* VLCKitSPM */ = { isa = XCSwiftPackageProductDependency; package = F7D4BF4E2CA2ECCB00A5E746 /* XCRemoteSwiftPackageReference "vlckit-spm" */; diff --git a/iOSClient/Share/NCShare.swift b/iOSClient/Share/NCShare.swift index 45824603c1..d87c83c1dc 100644 --- a/iOSClient/Share/NCShare.swift +++ b/iOSClient/Share/NCShare.swift @@ -24,7 +24,6 @@ // import UIKit -import Parchment import DropDown import NextcloudKit import ContactsUI diff --git a/iOSClient/Share/NCSharePaging.swift b/iOSClient/Share/NCSharePaging.swift index c6f9cc0c9c..6f07900bb3 100644 --- a/iOSClient/Share/NCSharePaging.swift +++ b/iOSClient/Share/NCSharePaging.swift @@ -23,8 +23,9 @@ // import UIKit -import Parchment +import SwiftUI import NextcloudKit +import NextcloudKitUI import TagListView protocol NCSharePagingContent { @@ -32,14 +33,39 @@ protocol NCSharePagingContent { } class NCSharePaging: UIViewController { - private let pagingViewController = NCShareHeaderViewController() private weak var appDelegate = UIApplication.shared.delegate as? AppDelegate - private var currentVC: NCSharePagingContent? + private let tabModel = NCSharePagingTabModel() + private weak var headerView: NCShareHeader? + private var pageVCs: [UIViewController] = [] + private var contentHost: UIHostingController? + + /// Minimum server version that serves the unified sharing UI (plus button + Sharing tab). + private static let unifiedSharingMinVersion: NextcloudVersion = .v34 var metadata = tableMetadata() var controller: NCMainTabBarController? var pages: [NCBrandOptions.NCInfoPagingTab] = [] - var page: NCBrandOptions.NCInfoPagingTab = .activity + + private var initialPage: NCBrandOptions.NCInfoPagingTab = .activity + var page: NCBrandOptions.NCInfoPagingTab { + get { + guard isViewLoaded else { return initialPage } + let index = tabModel.selection + return (index < pages.count) ? pages[index] : initialPage + } + set { + initialPage = newValue + if isViewLoaded, let index = pages.firstIndex(of: newValue) { + tabModel.selection = index + } + } + } + + private var currentVC: NCSharePagingContent? { + let index = tabModel.selection + guard index < pageVCs.count else { return nil } + return pageVCs[index] as? NCSharePagingContent + } // MARK: - View Life Cycle @@ -63,60 +89,116 @@ class NCSharePaging: UIViewController { let moreButton = UIBarButtonItem(image: UIImage(systemName: "ellipsis"), style: .plain, target: nil, action: nil) moreButton.menu = UIMenu(children: [manageTagsAction]) - navigationItem.rightBarButtonItem = moreButton + + var rightBarButtonItems = [moreButton] + + // The unified share (+) button only applies to servers with the new sharing API. + let capabilities = NCNetworking.shared.capabilities[metadata.account] ?? NKCapabilities.Capabilities() + + if NCBrandOptions.shared.isServerVersion(capabilities, greaterOrEqualTo: Self.unifiedSharingMinVersion) { + let addShareButton = UIBarButtonItem(image: UIImage(systemName: "plus"), style: .plain, target: self, action: #selector(addShareTapped(_:))) + addShareButton.accessibilityLabel = NSLocalizedString("_share_", comment: "") + rightBarButtonItems.insert(addShareButton, at: 0) + } + + navigationItem.rightBarButtonItems = rightBarButtonItems NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillShow(notification:)), name: UIResponder.keyboardWillShowNotification, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillHide(notification:)), name: UIResponder.keyboardWillHideNotification, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(applicationDidEnterBackground(notification:)), name: UIApplication.didEnterBackgroundNotification, object: nil) - // *** MUST BE THE FIRST ONE *** - pagingViewController.metadata = metadata - pagingViewController.backgroundColor = .systemBackground - pagingViewController.menuBackgroundColor = .systemBackground - pagingViewController.selectedBackgroundColor = .systemBackground - pagingViewController.indicatorColor = NCBrandColor.shared.getElement(account: metadata.account) - pagingViewController.textColor = NCBrandColor.shared.textColor - pagingViewController.selectedTextColor = NCBrandColor.shared.getElement(account: metadata.account) - - // Pagination - addChild(pagingViewController) - view.addSubview(pagingViewController.view) - pagingViewController.didMove(toParent: self) - - // Customization - pagingViewController.indicatorOptions = .visible( - height: 1, - zIndex: Int.max, - spacing: .zero, - insets: .zero + setupHeader() + + pageVCs = pages.map { makeViewController(for: $0) } + tabModel.selection = pages.firstIndex(of: initialPage) ?? 0 + + setupContent() + } + + private func setupHeader() { + guard let headerView = Bundle.main.loadNibNamed("NCShareHeader", owner: self, options: nil)?.first as? NCShareHeader else { return } + self.headerView = headerView + headerView.backgroundColor = .systemBackground + headerView.setupUI(with: metadata) + + view.addSubview(headerView) + headerView.translatesAutoresizingMaskIntoConstraints = false + NSLayoutConstraint.activate([ + headerView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor), + headerView.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor), + headerView.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor) + ]) + } + + private func setupContent() { + let content = NCSharePagingContentView( + model: tabModel, + tint: Color(NCBrandColor.shared.getElement(account: metadata.account)), + titles: pages.map(titleForTab(_:)), + pageVCs: pageVCs, + onSelectionChange: { [weak self] _ in + self?.view.endEditing(true) + } ) + let host = UIHostingController(rootView: content) + host.view.backgroundColor = .systemBackground - pagingViewController.borderOptions = .visible(height: 1, zIndex: Int.max, insets: .zero) + addChild(host) + view.addSubview(host.view) + host.didMove(toParent: self) + host.view.translatesAutoresizingMaskIntoConstraints = false - // Contrain the paging view to all edges. - pagingViewController.view.translatesAutoresizingMaskIntoConstraints = false + let topAnchor = headerView?.bottomAnchor ?? view.safeAreaLayoutGuide.topAnchor NSLayoutConstraint.activate([ - pagingViewController.view.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor), - pagingViewController.view.bottomAnchor.constraint(equalTo: view.bottomAnchor), - pagingViewController.view.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor), - pagingViewController.view.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor) + host.view.topAnchor.constraint(equalTo: topAnchor), + host.view.bottomAnchor.constraint(equalTo: view.bottomAnchor), + host.view.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor), + host.view.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor) ]) - pagingViewController.dataSource = self - pagingViewController.delegate = self + self.contentHost = host + } + + private func makeViewController(for tab: NCBrandOptions.NCInfoPagingTab) -> UIViewController { + // The old Parchment menu floated over the child view, so children inset by menuHeight (50). + // The new SwiftUI layout places the picker above the content, so no inset is needed. + let height: CGFloat = 0 - if page.rawValue < pages.count { - pagingViewController.select(index: page.rawValue) - } else { - pagingViewController.select(index: 0) - } + switch tab { + case .activity: + guard let viewController = UIStoryboard(name: "NCActivity", bundle: nil).instantiateInitialViewController() as? NCActivity else { + return UIViewController() + } + viewController.height = height + viewController.showComments = true + viewController.didSelectItemEnable = false + viewController.metadata = metadata + viewController.objectType = "files" + viewController.account = metadata.account + return viewController + case .sharing: + let capabilities = NCNetworking.shared.capabilities[metadata.account] ?? NKCapabilities.Capabilities() - pagingViewController.reloadMenu() + // The unified share tab fully replaces the legacy NCShare UI on newer servers. + if NCBrandOptions.shared.isServerVersion(capabilities, greaterOrEqualTo: Self.unifiedSharingMinVersion) { + return UIHostingController(rootView: UnifiedShareView(fileName: metadata.fileNameView, account: metadata.account)) + } + + guard let viewController = UIStoryboard(name: "NCShare", bundle: nil).instantiateViewController(withIdentifier: "sharing") as? NCShare else { + return UIViewController() + } + viewController.metadata = metadata + viewController.height = height + viewController.controller = controller + return viewController + } } - override func viewDidAppear(_ animated: Bool) { - super.viewDidAppear(animated) - currentVC = pagingViewController.pageViewController.selectedViewController as? NCSharePagingContent + private func titleForTab(_ tab: NCBrandOptions.NCInfoPagingTab) -> String { + switch tab { + case .activity: return NSLocalizedString("_activity_", comment: "") + case .sharing: return NSLocalizedString("_sharing_", comment: "") + } } override func viewWillAppear(_ animated: Bool) { @@ -176,17 +258,25 @@ class NCSharePaging: UIViewController { self.dismiss(animated: true, completion: nil) } - @objc func editTagsTapped(_ sender: Any?) { - guard let header = (pagingViewController.view as? NCSharePagingView)?.header else { - return + @objc private func addShareTapped(_ sender: UIBarButtonItem) { + let viewController = UIHostingController(rootView: UnifiedShareEditView(fileName: metadata.fileNameView, account: metadata.account)) + viewController.modalPresentationStyle = .pageSheet + + if let sheet = viewController.sheetPresentationController { + sheet.detents = [.large()] + sheet.prefersGrabberVisible = true } + present(viewController, animated: true) + } + + @objc func editTagsTapped(_ sender: Any?) { + guard let header = headerView else { return } + header.presentTagEditor(from: self) { [weak self] tags in guard let self else { return } self.metadata.tags.removeAll() self.metadata.tags.append(objectsIn: tags, account: self.metadata.account) - self.pagingViewController.metadata.tags.removeAll() - self.pagingViewController.metadata.tags.append(objectsIn: tags, account: self.pagingViewController.metadata.account) } } @@ -195,129 +285,49 @@ class NCSharePaging: UIViewController { } } -// MARK: - PagingViewController Delegate +// MARK: - SwiftUI tab content -extension NCSharePaging: PagingViewControllerDelegate { - func pagingViewController(_ pagingViewController: PagingViewController, willScrollToItem pagingItem: PagingItem, startingViewController: UIViewController, destinationViewController: UIViewController) { - - currentVC?.textField?.resignFirstResponder() - self.currentVC = destinationViewController as? NCSharePagingContent - } +@Observable +final class NCSharePagingTabModel { + var selection: Int = 0 } -// MARK: - PagingViewController DataSource - -extension NCSharePaging: PagingViewControllerDataSource { - func pagingViewController(_: PagingViewController, viewControllerAt index: Int) -> UIViewController { - let height: CGFloat = 50 - - if pages[index] == .activity { - guard let viewController = UIStoryboard(name: "NCActivity", bundle: nil).instantiateInitialViewController() as? NCActivity else { - return UIViewController() +struct NCSharePagingContentView: View { + @Bindable var model: NCSharePagingTabModel + let tint: Color + let titles: [String] + let pageVCs: [UIViewController] + var onSelectionChange: (Int) -> Void + + var body: some View { + VStack(spacing: 0) { + Picker("", selection: $model.selection) { + ForEach(Array(titles.enumerated()), id: \.offset) { index, title in + Text(title).tag(index) + } } - viewController.height = height - viewController.showComments = true - viewController.didSelectItemEnable = false - viewController.metadata = metadata - viewController.objectType = "files" - viewController.account = metadata.account - return viewController - } else if pages[index] == .sharing { - guard let viewController = UIStoryboard(name: "NCShare", bundle: nil).instantiateViewController(withIdentifier: "sharing") as? NCShare else { - return UIViewController() + .pickerStyle(.segmented) + .padding(.horizontal, 16) + .padding(.vertical, 8) + .tint(tint) + + TabView(selection: $model.selection) { + ForEach(Array(pageVCs.enumerated()), id: \.offset) { index, viewController in + NCViewControllerRepresentable(viewController: viewController) + .tag(index) + } } - viewController.metadata = metadata - viewController.height = height - viewController.controller = controller - return viewController - } else { - return UIViewController() + .tabViewStyle(.page(indexDisplayMode: .never)) } - } - - func pagingViewController(_: PagingViewController, pagingItemAt index: Int) -> PagingItem { - - if pages[index] == .activity { - return PagingIndexItem(index: index, title: NSLocalizedString("_activity_", comment: "")) - } else if pages[index] == .sharing { - return PagingIndexItem(index: index, title: NSLocalizedString("_sharing_", comment: "")) - } else { - return PagingIndexItem(index: index, title: "") + .onChange(of: model.selection) { _, newValue in + onSelectionChange(newValue) } } - - func numberOfViewControllers(in pagingViewController: PagingViewController) -> Int { - return self.pages.count - } -} - -// MARK: - Header - -class NCShareHeaderViewController: PagingViewController { - public var image: UIImage? - public var metadata = tableMetadata() - - override func loadView() { - view = NCSharePagingView( - options: options, - collectionView: collectionView, - pageView: pageViewController.view, - metadata: metadata - ) - } } -class NCSharePagingView: PagingView { - var metadata = tableMetadata() - let utilityFileSystem = NCUtilityFileSystem() - let utility = NCUtility() - public var headerHeightConstraint: NSLayoutConstraint? - var header: NCShareHeader? - - // MARK: - View Life Cycle - - public init(options: Parchment.PagingOptions, collectionView: UICollectionView, pageView: UIView, metadata: tableMetadata) { - super.init(options: options, collectionView: collectionView, pageView: pageView) +private struct NCViewControllerRepresentable: UIViewControllerRepresentable { + let viewController: UIViewController - self.metadata = metadata - } - - required init?(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - override func setupConstraints() { - guard let headerView = Bundle.main.loadNibNamed("NCShareHeader", owner: self, options: nil)?.first as? NCShareHeader else { return } - header = headerView - headerView.backgroundColor = .systemBackground - - let dateFormatter = DateFormatter() - dateFormatter.dateStyle = .short - dateFormatter.timeStyle = .short - dateFormatter.locale = Locale.current - - headerView.setupUI(with: metadata) - - addSubview(headerView) - - collectionView.translatesAutoresizingMaskIntoConstraints = false - headerView.translatesAutoresizingMaskIntoConstraints = false - pageView.translatesAutoresizingMaskIntoConstraints = false - - NSLayoutConstraint.activate([ - collectionView.leadingAnchor.constraint(equalTo: leadingAnchor), - collectionView.trailingAnchor.constraint(equalTo: trailingAnchor), - collectionView.heightAnchor.constraint(equalToConstant: options.menuHeight), - collectionView.topAnchor.constraint(equalTo: headerView.bottomAnchor), - - headerView.topAnchor.constraint(equalTo: safeAreaLayoutGuide.topAnchor), - headerView.leadingAnchor.constraint(equalTo: safeAreaLayoutGuide.leadingAnchor), - headerView.trailingAnchor.constraint(equalTo: safeAreaLayoutGuide.trailingAnchor), - - pageView.leadingAnchor.constraint(equalTo: leadingAnchor), - pageView.trailingAnchor.constraint(equalTo: trailingAnchor), - pageView.bottomAnchor.constraint(equalTo: bottomAnchor), - pageView.topAnchor.constraint(equalTo: headerView.bottomAnchor) - ]) - } + func makeUIViewController(context: Context) -> UIViewController { viewController } + func updateUIViewController(_ uiViewController: UIViewController, context: Context) {} }