Skip to content

Commit 77b1f55

Browse files
committed
Fix crash on iOS <18
1 parent eafe395 commit 77b1f55

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

iTorrent/Base/BaseViewController.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ class BaseViewController<ViewModel: MvvmViewModelProtocol>: SAViewController<Vie
5353
#endif
5454
titleLabel.adjustsFontForContentSizeCategory = true
5555
titleLabel.textAlignment = .center
56-
titleLabel.enableMarquee()
56+
if #available(iOS 18.0, *) {
57+
titleLabel.enableMarquee()
58+
}
5759
return titleLabel
5860
}()
5961
}
@@ -109,7 +111,9 @@ class BaseHostingViewController<View: MvvmSwiftUIViewProtocol>: SAHostingViewCon
109111
#endif
110112
titleLabel.adjustsFontForContentSizeCategory = true
111113
titleLabel.textAlignment = .center
112-
titleLabel.enableMarquee()
114+
if #available(iOS 18.0, *) {
115+
titleLabel.enableMarquee()
116+
}
113117
return titleLabel
114118
}()
115119
}

iTorrent/Utils/Extensions/UIKit/UILabel+Marquee.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import UIKit
99

10+
@available(iOS 18.0, *)
1011
extension UILabel {
1112
var marqueeEnabled: Bool {
1213
get { value(forKey: "marqueeEnabled") as? Bool ?? false }

0 commit comments

Comments
 (0)