Skip to content

Commit c773cc5

Browse files
committed
remove deprecated inits
1 parent 6d8e2e4 commit c773cc5

File tree

3 files changed

+21
-42
lines changed

3 files changed

+21
-42
lines changed

Package.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import PackageDescription
66
let package = Package(
77
name: "Drawer",
88
platforms: [
9-
.iOS(.v13),
10-
.macOS(.v10_15)
9+
.iOS(.v13)
1110
],
1211
products: [
1312
// Products define the executables and libraries produced by a package, and make them visible to other packages.

Sources/Drawer/Drawer.swift

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -85,46 +85,6 @@ public extension Drawer {
8585
self._restingHeight = .init(initialValue: startingHeight ?? heights.wrappedValue.first!)
8686
self.content = content()
8787
}
88-
89-
/// A bottom-up view that conforms to multiple heights
90-
/// - Parameters:
91-
/// - heights: The possible resting heights of the drawer
92-
/// - startingHeight: The starting height of the drawer. Defaults to the first height marker if not specified
93-
/// - content: The view that defines the drawer
94-
@available(*, deprecated)
95-
init(
96-
heights: [CGFloat],
97-
startingHeight: CGFloat? = nil,
98-
@ViewBuilder _ content: () -> Content
99-
) {
100-
self._heights = .constant(heights)
101-
self._height = .init(initialValue: startingHeight ?? heights.first!)
102-
self._restingHeight = .init(initialValue: startingHeight ?? heights.first!)
103-
self.content = content()
104-
}
105-
106-
// MARK: Deprecated Inits
107-
108-
/// A bottom-up view that conforms to multiple heights
109-
/// - Parameters:
110-
/// - heights: The possible resting heights of the drawer
111-
/// - startingHeight: The starting height of the drawer. Defaults to the first height marker if not specified
112-
/// - content: The view that defines the drawer
113-
@available(*, deprecated)
114-
init(
115-
heights: [CGFloat],
116-
startingHeight: CGFloat? = nil,
117-
impact: UIImpactFeedbackGenerator.FeedbackStyle?,
118-
@ViewBuilder _ content: () -> Content
119-
) {
120-
self._heights = .constant(heights)
121-
self._height = .init(initialValue: startingHeight ?? heights.first!)
122-
self._restingHeight = .init(initialValue: startingHeight ?? heights.first!)
123-
self.content = content()
124-
if let impact = impact {
125-
self.impactGenerator = UIImpactFeedbackGenerator(style: impact)
126-
}
127-
}
12888
}
12989

13090
// MARK: Internal Init

Sources/Drawer/SwiftUIView.swift

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//
2+
// SwiftUIView.swift
3+
//
4+
//
5+
// Created by Michael Verges on 7/20/20.
6+
//
7+
8+
import SwiftUI
9+
10+
#if DEBUG
11+
struct SwiftUIView_Previews: PreviewProvider {
12+
static var previews: some View {
13+
Drawer {
14+
Color.blue
15+
}
16+
.rest(at: .constant([100, 340]))
17+
.edgesIgnoringSafeArea(.vertical)
18+
}
19+
}
20+
#endif

0 commit comments

Comments
 (0)