Skip to content

Instantly share code, notes, and snippets.

View Adobels's full-sized avatar
🎯
Focusing

Blazej SLEBODA Adobels

🎯
Focusing
View GitHub Profile

The Composable Architecture

CI Slack

The Composable Architecture (w skrócie TCA) to biblioteka do budowania aplikacji w sposób spójny i zrozumiały, z myślą o kompozycji, testach i ergonomii. Może być używana w SwiftUI, UIKit

@Adobels
Adobels / gist:72649a612f2bf2913c1f3933c0f49ac9
Created October 8, 2021 12:53
@IBSegueAction method signature
@IBSegueAction private func showPerson(coder: NSCoder, sender: Any?, segueIdentifier: String?)
working variants:
@IBSegueAction private func showPerson(coder: NSCoder)
@IBSegueAction private func showPerson(_ coder: NSCoder, sender: Any?, segueIdentifier: String?)
@IBSegueAction private func showPerson(_ coder: NSCoder)
@IBSegueAction private func showPerson(coder: NSCoder)
@icanzilb
icanzilb / Task.sleep.swift
Created September 9, 2021 09:30
Task.sleep(seconds:)
extension Task where Success == Never, Failure == Never {
/// Suspends the current task for at least the given duration in seconds.
/// Throws if the task is cancelled while suspended.
/// - Parameter seconds: The sleep duration in seconds.
static func sleep(seconds: TimeInterval) async throws {
try await Task.sleep(nanoseconds: UInt64(seconds * 1_000_000_000))
}
}
@ole
ole / !swiftui-reflection-dump.md
Last active June 24, 2024 18:00
A dump of the SwiftUI.framework binary for the iOS simulator (as of Xcode 12.0 beta 2) using the swift-reflection-dump tool.

A dump of the SwiftUI.framework binary for the iOS simulator (as of Xcode 12.0 beta 2) using the swift-reflection-dump tool.

Note: I used a Swift 5.3 compiler build from a few weeks ago that I had laying around. Because of ABI stability, I don't think the swift-reflection-dump version has to match the compiler version that was used to build the binary, but I'm not 100% sure.

@Adobels
Adobels / RxSwift5_0_1-SingleFile.swift
Last active February 12, 2020 14:35
RxSwift 5.0.1 Framework concatenated to a single file
//
// AddRef.swift
// RxSwift
//
// Created by Junior B. on 30/10/15.
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
//
final class AddRefSink<Observer: ObserverType> : Sink<Observer>, ObserverType {
@Saissaken
Saissaken / Update git fork with tags.sh
Last active November 12, 2024 02:24
Update git fork with tags
# Repo: someuser/myframework
# Fork: superteam/myframework
# Track:
git clone https://github.com/superteam/myframework.git
cd myframework
git remote add upstream https://github.com/someuser/myframework.git
# Update:
git fetch upstream
@krzyzanowskim
krzyzanowskim / Demangle Swift
Created October 16, 2016 23:20
Hopper Disassembler Swift names demangle script
import subprocess
def looksLikeBeginning(doc,seg,adr):
if isinstance(seg.getNameAtAddress(adr), str):
label = seg.getNameAtAddress(adr)
pos = label.find("_T")
if pos != -1:
return label[pos:]
return None
@kakajika
kakajika / ScopeFuncs.swift
Last active June 21, 2023 13:11
A port of Kotlin's scope functions to Swift.
protocol ScopeFunc {}
extension ScopeFunc {
@inline(__always) func apply(block: (Self) -> ()) -> Self {
block(self)
return self
}
@inline(__always) func letIt<R>(block: (Self) -> R) -> R {
return block(self)
}
}
@evgenyneu
evgenyneu / concatenate_swift_files.sh
Last active March 27, 2023 00:35
Concatenates all Swift files into one file. Used in Xcode to build a single swift distributive file. In Xcode it is done by creating an external build tool configuration.
#!/bin/bash
#
# Combines *.swift files into a single file. Used in Xcode to build a single swift distributive file.
#
# Here is how to use it in Xcode:
#
# 1. Create an "External build system" target.
# 2. Click "Info" tab in target settings.
# 3. In "Build Tool" field specify the path to this script file, for example: $PROJECT_DIR/scripts/concatenate_swift_files.sh
@JaviLorbada
JaviLorbada / FRP iOS Learning resources.md
Last active June 17, 2024 06:08
The best FRP iOS resources.

Videos