Skip to content

[Fix] #534 - 3.0.0 배포 버전에서의 사소한 버그들 수정 #535

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

Merged
merged 10 commits into from
Apr 3, 2025
Merged
16 changes: 14 additions & 2 deletions SOPT-iOS/Projects/Core/Sources/Extension/UIKit+/UILabel+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,20 @@ public extension UILabel {

/// 행간 조정 메서드
func setLineSpacing(lineSpacing: CGFloat) {
if let text = self.text {
// 기존에 attributedText가 존재할 경우, 덮어쓰지 않고 그대로 유지
if let attributedText = self.attributedText {
let mutableAttributedString = NSMutableAttributedString(attributedString: attributedText)

mutableAttributedString.enumerateAttribute(.paragraphStyle,
in: NSRange(location: 0, length: mutableAttributedString.length),
options: []) { value, range, _ in
let paragraphStyle = (value as? NSMutableParagraphStyle) ?? NSMutableParagraphStyle()
paragraphStyle.lineSpacing = lineSpacing
mutableAttributedString.addAttribute(.paragraphStyle, value: paragraphStyle, range: range)
}

self.attributedText = mutableAttributedString
} else if let text = self.text {
let attributedStr = NSMutableAttributedString(string: text)
let style = NSMutableParagraphStyle()
style.lineSpacing = lineSpacing
Expand Down Expand Up @@ -118,7 +131,6 @@ public extension UILabel {
attributedString.addAttributes([NSAttributedString.Key.foregroundColor: defaultColor],
range: range)
self.attributedText = attributedString

} catch let error {
print("htmlToString 변환 에러: ", error.localizedDescription)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ extension AppMyPageVC {
self.bindViews()
self.bindViewModels()
}

public override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.setGestureDelegate()
}
}

extension AppMyPageVC {
Expand Down Expand Up @@ -338,3 +343,15 @@ extension AppMyPageVC {
SFSafariViewController.DataStore.default.clearWebsiteData()
}
}

// MARK: - UIGestureRecognizerDelegate

extension AppMyPageVC: UIGestureRecognizerDelegate {
private func setGestureDelegate() {
self.navigationController?.interactivePopGestureRecognizer?.delegate = self
}

public func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
return true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public final class AttendanceVC: UIViewController, AttendanceViewControllable {
static let bottomButtonHeight = 48.f

static let customSpacing = 32.f
static let keyboardBottomOffset = 34.f // 피그마에 40인데 수정했음
static let keyboardBottomOffset = 34.f
}

// MARK: - Properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ final class HomeCalendarDetailVC: UIViewController, HomeCalendarDetailViewContro
}
}

override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.setGestureDelegate()
}

deinit {
collectionView.dataSource = nil
collectionView.delegate = nil
Expand Down Expand Up @@ -196,3 +201,15 @@ extension HomeCalendarDetailVC: UICollectionViewDelegateFlowLayout, UICollection
return 0
}
}

// MARK: - UIGestureRecognizerDelegate

extension HomeCalendarDetailVC: UIGestureRecognizerDelegate {
private func setGestureDelegate() {
self.navigationController?.interactivePopGestureRecognizer?.delegate = self
}

public func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
return true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ extension ServiceType {
case .review:
return DSKitAsset.Assets.imgReviewLogo.image
case .project:
return DSKitAsset.Assets.imgProjectLogo.image
let userType = UserDefaultKeyList.Auth.getUserType()
return userType == .visitor ? DSKitAsset.Assets.imgProjectLogo.image : DSKitAsset.Assets.imgActiveProjectLogo.image
case .member:
return DSKitAsset.Assets.imgUserLogo.image
case .group:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ public final class NotificationDetailVC: UIViewController, NotificationDetailVie
self.setUI()
self.setLayout()
}

public override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.setGestureDelegate()
}
}

// MARK: - UI & Layout
Expand Down Expand Up @@ -196,3 +201,15 @@ extension NotificationDetailVC {
self.shortCutButton.isHidden = !notification.hasLink
}
}

// MARK: - UIGestureRecognizerDelegate

extension NotificationDetailVC: UIGestureRecognizerDelegate {
private func setGestureDelegate() {
self.navigationController?.interactivePopGestureRecognizer?.delegate = self
}

public func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
return true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ public final class NotificationListVC: UIViewController, NotificationListViewCon
public override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.notificationListCollectionView.reloadData()
self.setGestureDelegate()
}
}

Expand Down Expand Up @@ -249,3 +250,15 @@ extension NotificationListVC: UICollectionViewDelegate {
}
}
}

// MARK: - UIGestureRecognizerDelegate

extension NotificationListVC: UIGestureRecognizerDelegate {
private func setGestureDelegate() {
self.navigationController?.interactivePopGestureRecognizer?.delegate = self
}

public func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
return true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ public final class NotificationHandler: NSObject, UNUserNotificationCenterDelega
print("APNs 푸시 알림 페이로드: \(userInfo)")
if let payload = NotificationPayload(dictionary: userInfo) {
AmplitudeInstance.shared.track(eventType: .receivedPush, eventProperties: ["notificationId": payload.id,
"send_timeStamp": payload.sendAt,
"title": payload.title,
"contents": payload.content,
"admin_category": payload.category ?? "없음"])
}

Expand All @@ -41,11 +38,11 @@ public final class NotificationHandler: NSObject, UNUserNotificationCenterDelega
@MainActor
public func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse) async {
let userInfo = response.notification.request.content.userInfo
print(userInfo)
print("APNs 푸시 알림 페이로드: \(userInfo)")
guard let payload = NotificationPayload(dictionary: userInfo) else { return }

AmplitudeInstance.shared.track(eventType: .clickPush, eventProperties: ["notificationId": payload.id,
"send_timeStamp": payload.sendAt,
"leadtime": "",
"contain_deeplink": payload.hasDeepLink,
"deeplink_url": payload.deepLink ?? "없음"])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ import Sentry
public struct NotificationPayload: Codable {
public let aps: APS
public let id: String
public let title: String
public let content: String
public let sendAt: String
Comment on lines -15 to -17
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

깜짝이슈ㅎㅎ,,👀

public let category: String?
public let deepLink: String?
public let webLink: String?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import Core
public protocol SoptlogToolTipViewControllable: ViewControllable { }
public protocol SoptlogToolTipCoordinatable {
var onDismissButtonTap: (() -> Void)? { get set }
var onDimmingBackgroundTap: (() -> Void)? { get set }
}
public typealias SoptlogToolTipViewModelType = ViewModelType & SoptlogToolTipCoordinatable
public typealias SoptlogTooltipPresentable = (vc: SoptlogToolTipViewControllable, vm: any SoptlogToolTipViewModelType)
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ extension SoptlogAppServiceCVC {

private func setStackView() {
serviceTitleStackView.addArrangedSubviews(serviceLabel, infoToolTipButton)
serviceTitleStackView.setCustomSpacing(1, after: serviceLabel)

stackView.addArrangedSubviews(serviceTitleStackView, serviceImageView, serviceValue)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ public final class SoptlogCoordinator: DefaultCoordinator {
var soptlogToolTip = factory.makeSoptlogToolTip(frame)

soptlogToolTip.vm.onDismissButtonTap = { [weak self] in
self?.rootViewController?.dismiss(animated: true )
self?.rootViewController?.dismiss(animated: true)
}

soptlogToolTip.vm.onDimmingBackgroundTap = { [weak self] in
self?.rootViewController?.dismiss(animated: true)
}

soptlogToolTip.vc.viewController.modalPresentationStyle = .overFullScreen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ final class SoptlogToolTipVC: UIViewController, SoptlogToolTipViewControllable {
public var viewModel: SoptlogToolTipViewModel
private let cancelBag = CancelBag()
private let toolTipFrame: CGRect

private var dimmingBackgroundTap = PassthroughSubject<Void, Never>()

// MARK: - UI Components

Expand Down Expand Up @@ -55,6 +57,7 @@ final class SoptlogToolTipVC: UIViewController, SoptlogToolTipViewControllable {
$0.text = I18N.Soptlog.toolTip
$0.font = DSKitFontFamily.Suit.medium.font(size: 13)
$0.numberOfLines = 0
$0.setLineSpacing(lineSpacing: 4)
}

init(viewModel: SoptlogToolTipViewModel, toolTipFrame: CGRect) {
Expand All @@ -75,6 +78,8 @@ final class SoptlogToolTipVC: UIViewController, SoptlogToolTipViewControllable {
}
}

// MARK: - UI & Layout

extension SoptlogToolTipVC {
private func setUI() {
self.view.backgroundColor = DSKitAsset.Colors.black100.color.withAlphaComponent(0.6)
Expand Down Expand Up @@ -124,12 +129,30 @@ extension SoptlogToolTipVC {
}
}

// MARK: - Methods

extension SoptlogToolTipVC {
private func bindViewModels() {
let input = SoptlogToolTipViewModel.Input(
dismissbuttonTap: self.dismissButton.publisher(for: .touchUpInside).mapVoid().asDriver()
dismissbuttonTap: self.dismissButton.publisher(for: .touchUpInside).mapVoid().asDriver(),
dimmingBackgroundTap: self.dimmingBackgroundTap.asDriver()
)

_ = viewModel.transform(from: input, cancelBag: cancelBag)
}
}

// MARK: - Override Methods

extension SoptlogToolTipVC {
/// dimming 뒷배경을 눌렀을 때, dismiss 이벤트를 전달합니다.
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
guard let touch = touches.first else { return }
let location = touch.location(in: self.view)
// toolTipView 프레임의 밖일 경우에만 dismiss
if !toolTipView.frame.contains(location) {
self.dimmingBackgroundTap.send()
}
super.touchesBegan(touches, with: event)
Comment on lines +148 to +156
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

우와아ㅏㅇ 감사합니다 너무 좋네요👍👍 이 기능은 명세서에 없어서 따로 구현하지 않았는데, 안드로이드 측에 여쭤보고 맞춰가면 더 좋을 것 같습니다 !!

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class SoptlogToolTipViewModel: SoptlogToolTipViewModelType {

public struct Input {
let dismissbuttonTap: Driver<Void>
let dimmingBackgroundTap: Driver<Void>
}

// MARK: - Outputs
Expand All @@ -33,7 +34,7 @@ public class SoptlogToolTipViewModel: SoptlogToolTipViewModelType {
// MARK: - SoptlogToolTipCoordinatable

public var onDismissButtonTap: (() -> Void)?

public var onDimmingBackgroundTap: (() -> Void)?

// MARK: - initialization

Expand All @@ -52,6 +53,12 @@ extension SoptlogToolTipViewModel {
owner.onDismissButtonTap?()
}.store(in: cancelBag)

input.dimmingBackgroundTap
.withUnretained(self)
.sink { owner, _ in
owner.onDimmingBackgroundTap?()
}.store(in: cancelBag)

return output
}
}
27 changes: 24 additions & 3 deletions SOPT-iOS/Projects/Features/WebFeature/Sources/SOPTWebView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,16 @@ public final class SOPTWebView: UIViewController, SOPTWebViewControllable {

self.view.backgroundColor = DSKitAsset.Colors.black100.color

self.webView.scrollView.delegate = self
self.webView.navigationDelegate = self
self.webView.uiDelegate = self
downloadManager.webVC = self
self.initializeViews()
self.setupConstraints()
self.setupNavigationButtonActions()
self.setDelegate()
}

public override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.setGestureDelegate()
}
}

Expand Down Expand Up @@ -110,6 +113,12 @@ extension SOPTWebView {
self?.navigationController?.popViewController(animated: true)
}.store(in: self.cancelbag)
}

private func setDelegate() {
self.webView.scrollView.delegate = self
self.webView.navigationDelegate = self
self.webView.uiDelegate = self
}
Comment on lines +117 to +121
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

함수 분리 너무 좋네요🚀🚀

}

extension SOPTWebView: WKNavigationDelegate {
Expand Down Expand Up @@ -165,3 +174,15 @@ extension SOPTWebView: WKDownloadDelegate {
download.delegate = self
}
}

// MARK: - UIGestureRecognizerDelegate

extension SOPTWebView: UIGestureRecognizerDelegate {
private func setGestureDelegate() {
self.navigationController?.interactivePopGestureRecognizer?.delegate = self
}

public func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
return true
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "Frame 1171275665.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "Layer_1.svg",
"filename" : "Frame 1171275665@2x.svg",
"idiom" : "universal"
}
],
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading