-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feat] #122 - bottom sheet 구현 및 데이터 전달
- Loading branch information
Showing
6 changed files
with
117 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// CustomCorner.swift | ||
// Halmap | ||
// | ||
// Created by JeonJimin on 2023/06/20. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct CustomCorner: Shape { | ||
var corners: UIRectCorner | ||
func path(in rect: CGRect) -> Path { | ||
let path = UIBezierPath(roundedRect: rect, byRoundingCorners: corners, cornerRadii: CGSize(width: 35, height: 35)) | ||
|
||
return Path(path.cgPath) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// | ||
// HalfModalPresentationController.swift | ||
// Halmap | ||
// | ||
// Created by JeonJimin on 2023/06/19. | ||
// | ||
|
||
import SwiftUI | ||
|
||
class HalfSheetController<Content>: UIHostingController<Content> where Content : View { | ||
override func viewWillAppear(_ animated: Bool) { | ||
super.viewWillAppear(animated) | ||
|
||
if let presentation = sheetPresentationController { | ||
presentation.detents = [.medium()] | ||
presentation.prefersGrabberVisible = true | ||
presentation.largestUndimmedDetentIdentifier = .none | ||
} | ||
} | ||
} | ||
|
||
struct HalfSheet<Content>: UIViewControllerRepresentable where Content : View { | ||
|
||
private let content: Content | ||
|
||
@inlinable init(@ViewBuilder content: () -> Content) { | ||
self.content = content() | ||
} | ||
|
||
func makeUIViewController(context: Context) -> HalfSheetController<Content> { | ||
return HalfSheetController(rootView: content) | ||
} | ||
|
||
func updateUIViewController(_: HalfSheetController<Content>, context: Context) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters