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 struct EncodingURL: Codable { | |
private let value: String | |
public var url: URL? { | |
guard let url = URL(string: value) else { | |
guard let encodedValue = value.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed), | |
let url = URL(string: encodedValue) else { | |
return 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 XCTest | |
import Combine | |
public extension XCTestCase { | |
func awaitPublisher<T: Publisher>( | |
_ publisher: T, | |
timeout: TimeInterval = 10, | |
file: StaticString = #file, | |
line: UInt = #line |
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
env > env.txt | |
instruments -s devices > devices.txt | |
#! /bin/sh -e | |
# This script demonstrates archive and create action on frameworks and libraries | |
# Based on script by @author Boris Bielik | |
# Release dir path | |
OUTPUT_DIR_PATH="${PROJECT_DIR}/XCFramework" | |
function archivePathSimulator { |
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 | |
@main | |
struct NotificationSwiftUIApp: App { | |
var body: some Scene { | |
WindowGroup { | |
ContentView() | |
.task { | |
await NotificationHelper.shared.requestAuth() |
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 | |
class KeyChainHelper { | |
static let shared = KeyChainHelper() | |
func save(data: Data, key: String, account: String) { | |
let query = [ | |
kSecValueData: data, |
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 | |
struct AsyncAwaitWithCombineView: View { | |
@StateObject var viewModel: AsyncAwaitWithCombineViewModel = AsyncAwaitWithCombineViewModel() | |
var body: some View { | |
NavigationView { | |
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 | |
// MARK: - SheetPresentation | |
public extension View { | |
func sheetPresentation<SheetView: View>(isPresented: Binding<Bool>, @ViewBuilder sheetView: @escaping () -> SheetView, onDismiss: SheetPresentationController<SheetView>.DefaultClosureType? = nil) -> some View { | |
self.background( |
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
$ xcodebuild archive -scheme [Scheme 명] -archivePath [Archive 출력 경로] -sdk iphoneos SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES | |
# ex) iOS, iOS Simulator, macOS | |
$ xcodebuild archive -scheme FlightKit -archivePath "./build/ios.xcarchive" -sdk iphoneos SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES | |
$ xcodebuild archive -scheme FlightKit -archivePath "./build/ios_sim.xcarchive" -sdk iphonesimulator SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES | |
$ xcodebuild archive -scheme FlightKit -archivePath "./build/mac.xcarchive" SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES | |
# create xcframework | |
xcodebuild -create-xcframework \ |
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
class Observable<T> { | |
var value: T? { | |
didSet { | |
listener?(value) | |
} | |
} | |
private var listener: ((T?) -> Void)? | |
NewerOlder