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 magic_switcherApp: App { | |
var body: some Scene { | |
WindowGroup { | |
ContentView() | |
.environmentObject(ThemeObservable()) | |
} | |
} |
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
precedencegroup FunctionBuilderUtility { | |
associativity: none | |
} | |
infix operator .. : FunctionBuilderUtility | |
@discardableResult | |
public func .. <T>(object: T, block: (inout T) -> Void) -> T { | |
var object = object | |
block(&object) |
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
// | |
// UserNotificationsHandling.swift | |
// | |
// Copyright © 2023 Eren Kabakci. All rights reserved. | |
// | |
import UserNotifications | |
import AppKit | |
// Generic local notifications API for any consumer to use |
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
final class DepotViewModel: ObservableObject { | |
@Published searchPresented: Bool = false | |
func presentSearch() { | |
showSearch = true | |
} | |
} | |
struct DepotOverviewView: View { |
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
final class DepotViewModel: BaseViewModel<DepotViewModel.State, DepotViewModel.Action> { | |
struct State: Equatable, Copyable { | |
var showSearch = false | |
} | |
enum Action { | |
case .openSearch(let show): | |
showSearch(show: show) |
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
Resigning an iOS ipa for the app store | |
Introduction | |
Friday, October 18, 2019 | |
For the release of company iOS applications to the Apple app store we need to resign those apps with our appropriate distribution certificate. This is the process you need to follow, as-of-this-writing, to properly re-sign an foo.ipa to upload to Apple using the Application Loader. | |
This writing is making the assumption that the foo.ipa bundle that you has been created appropriately and that is only needs to be resigned. |
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 Foundation | |
struct SomeError: Error {} | |
// 1- Subject scenarios | |
let currentValueSubject = CurrentValueSubject<String, Error>("foo") | |
let passThroughSubject = PassthroughSubject<String, Error>() | |
currentValueSubject.send("Loo") // receiveValue of the subscriber will be called when "sink", receiveCompletion won't be called, the subscription is still active |
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 you come from bash you might have to change your $PATH. | |
# export PATH=$HOME/bin:/usr/local/bin:$PATH | |
####### set custom path ############## | |
export PATH=$PATH:~/bin | |
export PATH=$PATH:~/usr/local | |
###################################### | |
# export JAVA_HOME='/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home' |
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
#!/bin/sh | |
echo " ++++++++ DID YOU INCREASE THE BUILD NUMBER ? ++++++++" | |
exec < /dev/tty | |
read input | |
if [ "$input" == "y" ]; then | |
exit 0 | |
else | |
echo "Running hook for build increment" |
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
//: Playground - noun: a place where people can play | |
// Value Type | |
struct StructA { | |
var field1: String = "Default Struct Value" | |
let field2: Int = 1 | |
} | |
let constantStruct = StructA() |
NewerOlder