Skip to content

Commit 8e5ca00

Browse files
authored
Merge pull request #5669 from wikimedia/update-deployment-target
Update deployment target to iOS 17+
2 parents cc2561c + 9817fef commit 8e5ca00

File tree

16 files changed

+236
-478
lines changed

16 files changed

+236
-478
lines changed

WMFComponents/Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
// swift-tools-version: 5.8
1+
// swift-tools-version: 5.9
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription
55

66
let package = Package(
77
name: "WMFComponents",
8-
platforms: [.iOS(.v16)],
8+
platforms: [.iOS(.v17)],
99
products: [
1010
// Products define the executables and libraries a package produces, and make them visible to other packages.
1111
.library(

WMFComponents/Sources/WMFComponents/Components/Article Tabs/WMFArticleTabsView.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import SwiftUI
22
import WMFData
33
import UIKit
44

5-
@available(iOS 16.4, *) // Note: the app is currently 16.6+, but the package config doesn't allow minor version configs
65
public struct WMFArticleTabsView: View {
76
@ObservedObject var appEnvironment = WMFAppEnvironment.current
87
@Environment(\.colorScheme) var colorScheme

WMFComponents/Sources/WMFComponents/Components/Editors/Source Editor/WMFSourceEditorTextFrameworkMediator.swift

Lines changed: 88 additions & 238 deletions
Large diffs are not rendered by default.

WMFComponents/Sources/WMFComponents/Components/History/WMFHistoryView.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import SwiftUI
22
import WMFData
33

4-
@available(iOS 16.4, *) // Note: the app is currently 16.6+, but the package config doesn't allow minor version configs
54
public struct WMFHistoryView: View {
65

76
// MARK: - Properties

WMFComponents/Sources/WMFComponents/Components/Shared/Onboarding/WMFOnboardingView.swift

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,10 @@ public struct WMFOnboardingView: View {
7979

8080
public var body: some View {
8181
VStack(spacing: 0) {
82-
83-
if #available(iOS 17.0, *) {
84-
ScrollView(showsIndicators: true) {
85-
scrollViewContent
86-
}
87-
.scrollIndicatorsFlash(trigger: flashScrollIndicators)
88-
} else {
89-
ScrollView(showsIndicators: true) {
90-
scrollViewContent
91-
}
82+
ScrollView(showsIndicators: true) {
83+
scrollViewContent
9284
}
93-
85+
.scrollIndicatorsFlash(trigger: flashScrollIndicators)
9486
buttonArea
9587
}
9688
.background(Color(appEnvironment.theme.paperBackground).ignoresSafeArea())

WMFComponents/Sources/WMFComponents/Components/Year in Review/Views/WMFYearInReviewScrollView.swift

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,16 @@ struct WMFYearInReviewScrollView: View {
2626
scrollViewContents
2727
}
2828
}
29-
30-
@available(iOS 17.0, *)
29+
3130
private var flashingScrollView: some View {
3231
scrollView
3332
.scrollIndicatorsFlash(trigger: flashScrollIndicators)
3433
.scrollBounceBehavior(.basedOnSize, axes: .vertical)
3534
}
36-
37-
private var nonFlashingScrollView: some View {
38-
scrollView
39-
}
40-
35+
4136
private var content: some View {
4237
Group {
43-
if #available(iOS 17.0, *) {
44-
flashingScrollView
45-
} else {
46-
nonFlashingScrollView
47-
}
38+
flashingScrollView
4839
}
4940
}
5041

WMFComponents/Sources/WMFComponents/Extensions/Navigation Bar/WMFNavigationBarConfiguring.swift

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -254,24 +254,12 @@ public extension WMFNavigationBarConfiguring where Self: UIViewController {
254254

255255
if searchBarConfig.showsScopeBar {
256256
searchController.searchBar.showsScopeBar = searchBarConfig.showsScopeBar
257-
258-
if #available(iOS 16.0, *) {
259-
searchController.scopeBarActivation = .manual
260-
} else {
261-
// Fallback on earlier versions
262-
}
263-
257+
searchController.scopeBarActivation = .manual
264258
searchController.searchBar.scopeButtonTitles = searchBarConfig.scopeButtonTitles
265259
}
266-
260+
267261
navigationItem.hidesSearchBarWhenScrolling = false
268-
269-
if #available(iOS 16.0, *) {
270-
navigationItem.preferredSearchBarPlacement = .stacked
271-
} else {
272-
// Fallback on earlier versions
273-
}
274-
262+
navigationItem.preferredSearchBarPlacement = .stacked
275263
navigationItem.searchController = searchController
276264
}
277265
}

WMFComponents/Sources/WMFComponents/Style/Extensions/View+Extensions.swift

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,15 @@ public extension View {
88
/// - Returns: a modified `View` with the desired background `Color` applied
99
@ViewBuilder
1010
func listBackgroundColor(_ color: Color) -> some View {
11-
if #available(iOS 16, *) {
12-
self
13-
.scrollContentBackground(.hidden)
14-
.background(color)
15-
} else {
16-
self.background(color)
17-
}
11+
self.scrollContentBackground(.hidden)
12+
.background(color)
1813
}
1914

2015
/// Adds custom section spacing if available on current iOS version
2116
/// - Parameter spacing: the amount of spacing to use
2217
/// - Returns: a modified `View` with the `List` `Section` spacing applied if possible
2318
@ViewBuilder
2419
func listCustomSectionSpacing(_ spacing: CGFloat) -> some View {
25-
if #available(iOS 17, *) {
26-
self.listSectionSpacing(.custom(spacing))
27-
} else {
28-
self
29-
}
20+
self.listSectionSpacing(.custom(spacing))
3021
}
3122
}

WMFComponents/Sources/WMFComponentsObjC/WMFSourceEditorTextStorage.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ NS_ASSUME_NONNULL_BEGIN
55
@class WMFSourceEditorColors, WMFSourceEditorFonts, WMFSourceEditorFormatter;
66
@protocol WMFSourceEditorStorageDelegate;
77

8-
@interface WMFSourceEditorTextStorage : NSTextStorage
8+
@interface WMFSourceEditorTextStorage : NSTextStorage // delete
99

1010
@property (nonatomic, weak) id<WMFSourceEditorStorageDelegate> storageDelegate;
1111
@property (nonatomic, assign) BOOL syntaxHighlightProcessingEnabled;

WMFData/Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
// swift-tools-version: 5.8
1+
// swift-tools-version: 5.9
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription
55

66
let package = Package(
77
name: "WMFData",
8-
platforms: [.iOS(.v16)],
8+
platforms: [.iOS(.v17)],
99
products: [
1010
// Products define the executables and libraries a package produces, and make them visible to other packages.
1111
.library(

0 commit comments

Comments
 (0)