Skip to content

Commit 5c39106

Browse files
authored
Remove iOS 16 and 17 availablity check (#24874)
* Change the iOS platform version in the Modules package * Remove iOS 17 availablity checks * Remove iOS 16 availablity checks * Remove `ColorGallery` * Remove some oneline funtions
1 parent e82e53b commit 5c39106

47 files changed

Lines changed: 87 additions & 542 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Modules/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import PackageDescription
55
let package = Package(
66
name: "Modules",
77
platforms: [
8-
.iOS(.v16),
8+
.iOS(.v17),
99
],
1010
products: XcodeSupport.products + [
1111
.library(name: "AsyncImageKit", targets: ["AsyncImageKit"]),

Modules/Sources/DesignSystem/Components/FAB.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ private struct FABContentView: View {
5858
}
5959
}
6060

61-
@available(iOS 17, *)
6261
#Preview(traits: .fixedLayout(width: 200, height: 200)) {
6362
FAB(action: {})
6463
}

Modules/Sources/DesignSystem/Gallery/ColorGallery.swift

Lines changed: 0 additions & 177 deletions
This file was deleted.

Modules/Sources/DesignSystem/Gallery/DesignSystemGallery.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ public struct DesignSystemGallery: View {
1313

1414
private var foundationList: some View {
1515
List {
16-
NavigationLink("Colors", destination: ColorGallery())
1716
NavigationLink("Fonts", destination: FontGallery())
1817
NavigationLink("Lengths", destination: LengthGallery())
1918
}

Modules/Sources/JetpackStats/Charts/BarChartView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ struct BarChartView: View {
142142

143143
@ChartContentBuilder
144144
private var selectionIndicatorMarks: some ChartContent {
145-
if #available(iOS 17.0, *), let selectedDataPoints {
145+
if let selectedDataPoints {
146146
if let currentPoint = selectedDataPoints.current {
147147
RuleMark(x: .value("Selected", currentPoint.date))
148148
.foregroundStyle(Color.clear)

Modules/Sources/JetpackStats/Charts/LineChartView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct LineChartView: View {
3232
.chartYScale(domain: yAxisDomain)
3333
.chartLegend(.hidden)
3434
.environment(\.timeZone, context.timeZone)
35-
.modifier(ChartSelectionModifier(selection: $selectedDate))
35+
.chartXSelection(value: $selectedDate)
3636
.animation(.spring, value: ObjectIdentifier(data))
3737
.onChange(of: selectedDate) {
3838
selectedDataPoints = SelectedDataPoints.compute(for: $0, data: data)
@@ -139,7 +139,7 @@ struct LineChartView: View {
139139

140140
@ChartContentBuilder
141141
private var selectionIndicatorMarks: some ChartContent {
142-
if #available(iOS 17.0, *), let selectedDataPoints {
142+
if let selectedDataPoints {
143143
if let currentPoint = selectedDataPoints.current {
144144
RuleMark(x: .value("Selected", currentPoint.date))
145145
.foregroundStyle(Color.secondary.opacity(0.33))

Modules/Sources/JetpackStats/Screens/TrafficTabView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ struct TrafficTabView: View {
151151
viewModel.addCard(type: cardType)
152152
}
153153
.dynamicTypeSize(...DynamicTypeSize.xLarge)
154-
.modifier(PopoverPresentationModifier())
154+
.presentationCompactAdaptation(.popover)
155155
}
156156
}
157157

Modules/Sources/JetpackStats/Services/CSVExporter.swift

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,7 @@ struct CSVDataRepresentation: Transferable {
7777
let dataRepresentation = DataRepresentation(exportedContentType: .commaSeparatedText) { (representation: CSVDataRepresentation) in
7878
try representation.generateCSVData()
7979
}
80-
if #available(iOS 17.0, *) {
81-
return dataRepresentation.suggestedFileName { $0.fileName }
82-
} else {
83-
return dataRepresentation
84-
}
80+
return dataRepresentation.suggestedFileName { $0.fileName }
8581
}
8682

8783
private func generateCSVData() throws -> Data {
@@ -103,15 +99,11 @@ struct ChartDataCSVRepresentation: Transferable {
10399
let dataRepresentation = DataRepresentation(exportedContentType: .commaSeparatedText) { (representation: ChartDataCSVRepresentation) in
104100
try representation.generateCSVData()
105101
}
106-
if #available(iOS 17.0, *) {
107-
return dataRepresentation.suggestedFileName { representation in
108-
let dateString = representation.context.formatters.dateRange.string(from: representation.dateRange.dateInterval)
109-
.replacingOccurrences(of: "/", with: "-")
110-
.replacingOccurrences(of: ",", with: "")
111-
return "\(representation.data.metric.localizedTitle)-\(dateString).csv"
112-
}
113-
} else {
114-
return dataRepresentation
102+
return dataRepresentation.suggestedFileName { representation in
103+
let dateString = representation.context.formatters.dateRange.string(from: representation.dateRange.dateInterval)
104+
.replacingOccurrences(of: "/", with: "-")
105+
.replacingOccurrences(of: ",", with: "")
106+
return "\(representation.data.metric.localizedTitle)-\(dateString).csv"
115107
}
116108
}
117109

Modules/Sources/JetpackStats/Utilities/Modifiers/ChartSelectionModifier.swift

Lines changed: 0 additions & 13 deletions
This file was deleted.

Modules/Sources/JetpackStats/Utilities/Modifiers/PopoverPresentationModifier.swift

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)