-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
최근 찾아본 학과 저장 #323
Merged
chaemin2001
merged 16 commits into
master
from
chaemin2001/pin-recent-searched-departments
Feb 9, 2025
Merged
최근 찾아본 학과 저장 #323
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
86ded70
Add Pinned Department
chaemin2001 af41ada
Merge branch 'master' into chaemin2001/pin-recent-searched-departments
chaemin2001 8a6f9a8
Apply SwiftFormat changes
chaemin2001 13b903a
Resolve Font Problems
chaemin2001 9fd870b
UI Adjustments
chaemin2001 9b9215b
Resolve Non-Scrolling Behavior for ios18
chaemin2001 6363d67
Apply SwiftFormat changes
chaemin2001 5920db6
Update View+Gesture.swift
chaemin2001 41ddcbc
Xcode `15.1` -> `16.0`
peng-u-0807 c6903fd
Apply SwiftFormat changes
peng-u-0807 26224ef
Xcode `16.0` -> `16.2`
peng-u-0807 ce47ace
Delete files to merge conflicts
chaemin2001 baa7299
Fix Sheet Dismiss Bug
chaemin2001 5cc48f7
Merge branch 'master' into chaemin2001/pin-recent-searched-departments
chaemin2001 08e521c
Update SNUTT-2022/SNUTT/Services/SearchService.swift
chaemin2001 343ffd8
Update SearchService.swift
chaemin2001 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
22 changes: 22 additions & 0 deletions
22
SNUTT-2022/SNUTT/Assets/Assets.xcassets/Icons/department.xmark.imageset/Contents.json
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,22 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"filename" : "[email protected]", | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"filename" : "[email protected]", | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+357 Bytes
...T-2022/SNUTT/Assets/Assets.xcassets/Icons/department.xmark.imageset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+461 Bytes
...T-2022/SNUTT/Assets/Assets.xcassets/Icons/department.xmark.imageset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,71 @@ | ||
// | ||
// View+Gesture.swift | ||
// SNUTT | ||
// | ||
// Created by 이채민 on 1/7/25. | ||
// | ||
|
||
import SwiftUI | ||
|
||
extension View { | ||
@ViewBuilder | ||
func sheetGesture(_ translation: Binding<CGFloat>, dismiss: @escaping @MainActor () -> Void) -> some View { | ||
if #available(iOS 18.0, *) { | ||
gesture(SheetGestureRecognizer(translation: translation, dismiss: dismiss)) | ||
} else { | ||
highPriorityGesture(DragGesture().onChanged { value in | ||
translation.wrappedValue = value.translation.height | ||
}.onEnded { value in | ||
translation.wrappedValue = 0 | ||
if value.velocity.height > 300 || value.translation.height > 100 { | ||
dismiss() | ||
} | ||
}) | ||
} | ||
} | ||
} | ||
|
||
@available(iOS 18.0, *) | ||
private struct SheetGestureRecognizer: UIGestureRecognizerRepresentable { | ||
func makeCoordinator(converter: CoordinateSpaceConverter) -> Coordinator { | ||
Coordinator(translation: $translation, dismiss: dismiss) | ||
} | ||
|
||
@Binding var translation: CGFloat | ||
let dismiss: () -> Void | ||
|
||
func makeUIGestureRecognizer(context: Context) -> UIPanGestureRecognizer { | ||
let recognizer = UIPanGestureRecognizer(target: context.coordinator, action: #selector(Coordinator.handlePan)) | ||
return recognizer | ||
} | ||
|
||
final class Coordinator: NSObject { | ||
@Binding var translation: CGFloat | ||
let dismiss: () -> Void | ||
|
||
init(translation: Binding<CGFloat>, dismiss: @escaping () -> Void) { | ||
_translation = translation | ||
self.dismiss = dismiss | ||
} | ||
|
||
@objc func handlePan(_ recognizer: UIPanGestureRecognizer) { | ||
switch recognizer.state { | ||
case .changed: | ||
translation = recognizer.translation(in: recognizer.view).y | ||
case .ended: | ||
if shouldDismiss(recognizer) { | ||
dismiss() | ||
} | ||
translation = 0 | ||
default: | ||
break | ||
} | ||
} | ||
|
||
private func shouldDismiss(_ recognizer: UIPanGestureRecognizer) -> Bool { | ||
let velocity = recognizer.velocity(in: recognizer.view).y | ||
let translation = recognizer.translation(in: recognizer.view).y | ||
return velocity > 300 || translation > 100 | ||
} | ||
} | ||
} |
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
변경사항이 없어서 line에 직접 못적는데 좌측 태그 카테고리쪽 UI 변경사항도 같이 반영해주세용
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
그리고 필터 내부 스크롤이 안되는데(실기기&시뮬레이터 둘다 iOS 18.0+) 혹시 재현돼?
시뮬레이터 iOS 17.2에서는 문제 없는거같긴해
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
xcode 16 + ios 18 에서 highPriorityGesture 문제 있는듯..
snutt 2024에서는 고쳐놨는데 ㅋㅋ..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ㅇㅋ 색상이랑 폰트 크기 이런거 말하는거 맞지?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
엉 그거랑 내부 스크롤 안되는 문제도..!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
스크롤 문제는
snutt-ios/SNUTT/Modules/Shared/SharedUIComponents/Sources/Sheet/Sheet+Gesture.swift
Lines 12 to 23 in 7273019
여기 참고하면 될듯!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
참고해서 고쳤는데 이게 위로 스크롤 시에 sheet가 dismiss되는 문제가 있는데 .. 실기기에서도 똑같겠지 ..?ㅜㅜ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아하. 이거는 bottom sheet구나. 그러면 저 코드에서 value.velocity.width 랑 translation.width 를 height로 바꿔야할듯! x는 y로 바꾸고.