This file contains hidden or 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
if [[ "$(uname -m)" == arm64 ]]; then | |
export PATH="/opt/homebrew/bin:$PATH" | |
fi | |
if which periphery > /dev/null; then | |
cd ../../ | |
pwd | |
periphery scan --workspace ./Seugi.xcworkspace --schemes Seugi-iOS --targets Seugi-iOS DIContainer Feature Component Core Network Local --format xcode --report-exclude **/Derived/*.swift | |
# Domain is not included |
This file contains hidden or 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
import OSLog | |
extension OSLog { | |
static let subsystem = Bundle.main.bundleIdentifier! | |
static let network = OSLog(subsystem: subsystem, category: "Network") | |
static let debug = OSLog(subsystem: subsystem, category: "Debug") | |
static let info = OSLog(subsystem: subsystem, category: "Info") | |
static let error = OSLog(subsystem: subsystem, category: "Error") | |
} |
This file contains hidden or 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
import Foundation | |
public extension StringProtocol { | |
subscript(offset: Int) -> Character { self[index(startIndex, offsetBy: offset)] } | |
subscript (bounds: CountableRange<Int>) -> String { | |
let start = index(startIndex, offsetBy: bounds.lowerBound) | |
let end = index(startIndex, offsetBy: bounds.upperBound) |
This file contains hidden or 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
public extension Comparable { | |
func clamped(to limits: ClosedRange<Self>) -> Self { | |
return min(max(self, limits.lowerBound), limits.upperBound) | |
} | |
} |
This file contains hidden or 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
import Combine | |
import SwiftUI | |
public extension Publisher { | |
func ignoreError() -> AnyPublisher<Output, Never> { | |
return self.catch { _ in | |
Empty<Output, Never>() | |
} | |
.eraseToAnyPublisher() | |
} |
This file contains hidden or 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
import SwiftUI | |
public struct ScrollOffsetPreferenceKey: PreferenceKey { | |
public static var defaultValue: CGFloat = 0 | |
public static func reduce(value: inout CGFloat, nextValue: () -> CGFloat) { | |
value += nextValue() | |
} | |
} |
This file contains hidden or 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
import SwiftUI | |
import UIKit | |
public extension View { | |
func hideKeyboardWhenTap() -> some View { | |
self.onTapGesture(perform: hideKeyboard) | |
} | |
func hideKeyboard() { | |
UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil) |
This file contains hidden or 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
import SwiftUI | |
public extension View { | |
@ViewBuilder | |
func onReadSize(_ perform: @escaping (CGSize) -> Void) -> some View { | |
self.customBackground { | |
GeometryReader { geometryProxy in | |
Color.clear | |
.preference(key: SizePreferenceKey.self, value: geometryProxy.size) | |
} |
This file contains hidden or 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
import Foundation | |
import Moya | |
// NetRunner 클래스에서 사용. | |
// 원래 NetRunner는 BaseEndpoint를 준수 받는 Endpoint (e.g. MealEndpoint, AIEndpoint)를 Generic하게 사용하고 있었음. | |
// 이런 방식으로 하니 각 Endpoint 별로 NetRunner를 만들어야 함. | |
// | |
// 이 프로젝트에서는 각 Endpoint 별로 다른 NetRunner를 쓸 필요성을 못 느낌. | |
// 따라서 NetRunner는 Generic하게 사용하는 오브젝트를 알 필요가 없음. |
NewerOlder