-
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.
Browse files
Browse the repository at this point in the history
Feat : 둘러보기 디자인 수정
- Loading branch information
Showing
23 changed files
with
285 additions
and
231 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
File renamed without changes.
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
16 changes: 16 additions & 0 deletions
16
Projects/Core/PPACData/Sources/DTO/MemeReactionResponseDTO.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,16 @@ | ||
// | ||
// MemeReactionResponseDTO.swift | ||
// PPACData | ||
// | ||
// Created by 김종윤 on 9/28/24. | ||
// | ||
|
||
import Foundation | ||
|
||
struct MemeReactionResponseDTO: Decodable { | ||
public let count: Int | ||
|
||
public init(count: Int) { | ||
self.count = count | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// | ||
// Throttler.swift | ||
// PPACUtil | ||
// | ||
// Created by 김종윤 on 9/25/24. | ||
// | ||
|
||
import Foundation | ||
|
||
public class Throttler { | ||
private var workItem: DispatchWorkItem? | ||
private var lastExecution: Date? | ||
private let queue: DispatchQueue | ||
private let interval: TimeInterval | ||
|
||
public init(seconds: TimeInterval, queue: DispatchQueue = DispatchQueue.main) { | ||
self.interval = seconds | ||
self.queue = queue | ||
} | ||
|
||
public func throttle(action: @escaping () -> Void) { | ||
// 기존의 예약된 작업이 있으면 취소 | ||
workItem?.cancel() | ||
|
||
// 새로운 작업 생성 | ||
workItem = DispatchWorkItem { [weak self] in | ||
self?.lastExecution = Date() | ||
action() | ||
} | ||
|
||
// 인터벌 후에 작업을 실행하도록 예약 (즉시 실행하지 않음) | ||
queue.asyncAfter(deadline: .now() + interval, execute: workItem!) | ||
} | ||
|
||
public func cancel() { | ||
workItem?.cancel() | ||
} | ||
} |
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.