-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feat] Stamp 34기 대응 : missionDate를 같이 올릴수 있도록, 라우팅 영역 변경, 닉네임 변경 제한 (#…
…366) * [Feat] ListDetailModel, S3 URL, PresignedUrl 등 ServiceLayer에 반영 * [Feat] Repository와 Usecase에 반영 * [Feat] ListDetailViewController와 ViewModel에 이벤트 연결 * [Feat] Listview에서 username containerClick event로 detail page로 이동할수 있도록 변경 * [Fix] List DetailViewController focus 동작 수정 * [Feat] 마이페이지에서 솝탬프 닉네임 변경 제거 * [Fix] 민재 리뷰 반영: 미사용 Extension 제거
- Loading branch information
Showing
35 changed files
with
1,779 additions
and
1,117 deletions.
There are no files selected for viewing
76 changes: 76 additions & 0 deletions
76
SOPT-iOS/Projects/Core/Sources/Extension/Combine+UIKit/Publisher+UIBarButton.swift
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,76 @@ | ||
// | ||
// Publisher+UIBarButton.swift | ||
// Core | ||
// | ||
// Created by Ian on 4/4/24. | ||
// Copyright © 2024 SOPT-iOS. All rights reserved. | ||
// | ||
|
||
import Combine | ||
import UIKit | ||
|
||
public extension UIBarButtonItem { | ||
final class Subscription<SubscriberType: Subscriber, Input: UIBarButtonItem>: Combine.Subscription where SubscriberType.Input == Input { | ||
private var subscriber: SubscriberType? | ||
private let input: Input | ||
|
||
// MARK: - Initialization | ||
|
||
public init(subscriber: SubscriberType, input: Input) { | ||
self.subscriber = subscriber | ||
self.input = input | ||
|
||
input.target = self | ||
input.action = #selector(eventHandler) | ||
} | ||
|
||
// MARK: - Subscriber | ||
|
||
// Do nothing as we only want to send events when they occur | ||
public func request(_ demand: Subscribers.Demand) {} | ||
|
||
// MARK: - Cancellable | ||
|
||
public func cancel() { | ||
subscriber = nil | ||
} | ||
|
||
// MARK: - Internal Functions | ||
|
||
@objc private func eventHandler() { | ||
_ = subscriber?.receive(input) | ||
} | ||
} | ||
|
||
// MARK: - | ||
|
||
struct Publisher<Output: UIBarButtonItem>: Combine.Publisher { | ||
public typealias Output = Output | ||
public typealias Failure = Never | ||
|
||
let output: Output | ||
|
||
// MARK: - Initialization | ||
|
||
public init(output: Output) { | ||
self.output = output | ||
} | ||
|
||
// MARK: - Publisher | ||
|
||
public func receive<S>(subscriber: S) where S : Subscriber, Never == S.Failure, Output == S.Input { | ||
let subscription: Subscription = Subscription(subscriber: subscriber, input: output) | ||
subscriber.receive(subscription: subscription) | ||
} | ||
} | ||
} | ||
|
||
// MARK: - CombineCompatible | ||
|
||
extension UIBarButtonItem: CombineCompatible { } | ||
|
||
extension CombineCompatible where Self: UIBarButtonItem { | ||
public var tapPublisher: UIBarButtonItem.Publisher<Self> { | ||
return UIBarButtonItem.Publisher(output: self) | ||
} | ||
} |
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
19 changes: 19 additions & 0 deletions
19
SOPT-iOS/Projects/Data/Sources/Transform/PresignedUrlTransform.swift
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,19 @@ | ||
// | ||
// PresignedUrlTransform.swift | ||
// Data | ||
// | ||
// Created by Ian on 4/7/24. | ||
// Copyright © 2024 SOPT-iOS. All rights reserved. | ||
// | ||
|
||
import Domain | ||
import Networks | ||
|
||
extension PreSignedUrlEntity { | ||
func toDomain() -> PresignedUrlModel { | ||
return PresignedUrlModel( | ||
preSignedURL: self.preSignedURL, | ||
imageURL: self.imageURL | ||
) | ||
} | ||
} |
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
SOPT-iOS/Projects/Domain/Sources/Model/PresignedUrlModel.swift
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 @@ | ||
// | ||
// PresignedUrlModel.swift | ||
// Domain | ||
// | ||
// Created by Ian on 4/7/24. | ||
// Copyright © 2024 SOPT-iOS. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
public struct PresignedUrlModel { | ||
public let preSignedURL: String | ||
public let imageURL: String | ||
|
||
public init( | ||
preSignedURL: String, | ||
imageURL: String | ||
) { | ||
self.preSignedURL = preSignedURL | ||
self.imageURL = imageURL | ||
} | ||
} |
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.