Skip to content

Commit 08d7f76

Browse files
Marino Faggianampivchev
andauthored
Stable 5.2.7 (#2879)
* Hotfix Signed-off-by: Milen Pivchev <[email protected]> * Version 5.2.7 Signed-off-by: Marino Faggiana <[email protected]> --------- Signed-off-by: Milen Pivchev <[email protected]> Signed-off-by: Marino Faggiana <[email protected]> Co-authored-by: Milen Pivchev <[email protected]>
1 parent 366ed03 commit 08d7f76

File tree

3 files changed

+15
-44
lines changed

3 files changed

+15
-44
lines changed

Nextcloud.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5073,7 +5073,7 @@
50735073
"@executable_path/Frameworks",
50745074
"@executable_path/../../Frameworks",
50755075
);
5076-
MARKETING_VERSION = 5.2.6;
5076+
MARKETING_VERSION = 5.2.7;
50775077
ONLY_ACTIVE_ARCH = YES;
50785078
OTHER_LDFLAGS = "";
50795079
SDKROOT = iphoneos;
@@ -5135,7 +5135,7 @@
51355135
"@executable_path/Frameworks",
51365136
"@executable_path/../../Frameworks",
51375137
);
5138-
MARKETING_VERSION = 5.2.6;
5138+
MARKETING_VERSION = 5.2.7;
51395139
ONLY_ACTIVE_ARCH = YES;
51405140
OTHER_LDFLAGS = "";
51415141
SDKROOT = iphoneos;

iOSClient/Viewer/NCViewerMedia/NCViewerMedia+VisionKit.swift

Lines changed: 12 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -25,43 +25,24 @@ import Foundation
2525
import VisionKit
2626

2727
extension NCViewerMedia {
28-
@available(iOS 16.0, *)
28+
@available(iOS 17.0, *)
2929
func analyzeCurrentImage() {
3030
if let image = image {
31+
let interaction = ImageAnalysisInteraction()
32+
let analyzer = ImageAnalyzer()
33+
interaction.preferredInteractionTypes = []
34+
interaction.analysis = nil
35+
36+
self.imageVideoContainer.addInteraction(interaction)
37+
let configuration = ImageAnalyzer.Configuration([.text, .machineReadableCode, .visualLookUp])
38+
3139
Task {
32-
let configuration = ImageAnalyzer.Configuration([.text, .machineReadableCode, .visualLookUp])
33-
let analysis = try? await analyzer.imageAnalyzer?.analyze(image, configuration: configuration)
40+
let analysis = try? await analyzer.analyze(image, configuration: configuration)
3441
if image == self.image {
35-
analyzer.imageInteraction?.analysis = analysis
36-
analyzer.imageInteraction?.preferredInteractionTypes = .automatic
42+
interaction.analysis = analysis
43+
interaction.preferredInteractionTypes = .automatic
3744
}
3845
}
3946
}
4047
}
4148
}
42-
43-
// TODO: Remove when min SDK is 16
44-
@MainActor
45-
struct Analyzer {
46-
private var _imageAnalyzer: Any?
47-
private var _imageInteraction: Any?
48-
49-
@available(iOS 16, *)
50-
var imageAnalyzer: ImageAnalyzer? {
51-
get { return _imageAnalyzer as? ImageAnalyzer }
52-
set { _imageAnalyzer = newValue }
53-
}
54-
55-
@available(iOS 16, *)
56-
var imageInteraction: ImageAnalysisInteraction? {
57-
get { return _imageInteraction as? ImageAnalysisInteraction }
58-
set { _imageInteraction = newValue }
59-
}
60-
61-
init() {
62-
if #available(iOS 16, *) {
63-
imageAnalyzer = ImageAnalyzer()
64-
imageInteraction = ImageAnalysisInteraction()
65-
}
66-
}
67-
}

iOSClient/Viewer/NCViewerMedia/NCViewerMedia.swift

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import SwiftUI
2929
import MobileVLCKit
3030
import JGProgressHUD
3131
import Alamofire
32-
import VisionKit
3332

3433
public protocol NCViewerMediaViewDelegate: AnyObject {
3534
func didOpenDetail()
@@ -49,17 +48,14 @@ class NCViewerMedia: UIViewController {
4948
private var tipView: EasyTipView?
5049
private let player = VLCMediaPlayer()
5150
private let appDelegate = (UIApplication.shared.delegate as? AppDelegate)!
52-
let analyzer = Analyzer()
5351
let utilityFileSystem = NCUtilityFileSystem()
5452
let utility = NCUtility()
5553
weak var viewerMediaPage: NCViewerMediaPage?
5654
var playerToolBar: NCPlayerToolBar?
5755
var ncplayer: NCPlayer?
5856
var image: UIImage? {
5957
didSet {
60-
if #available(iOS 16, *), metadata.isImage {
61-
analyzer.imageInteraction?.preferredInteractionTypes = []
62-
analyzer.imageInteraction?.analysis = nil
58+
if #available(iOS 17.0, *), metadata.isImage {
6359
analyzeCurrentImage()
6460
}
6561
}
@@ -144,12 +140,6 @@ class NCViewerMedia: UIViewController {
144140
self.imageVideoContainer.image = nil
145141

146142
loadImage()
147-
148-
if #available(iOS 16, *) {
149-
if let interaction = analyzer.imageInteraction {
150-
self.imageVideoContainer.addInteraction(interaction)
151-
}
152-
}
153143
}
154144

155145
override func viewWillAppear(_ animated: Bool) {

0 commit comments

Comments
 (0)