Skip to content

Instantly share code, notes, and snippets.

View yutailang0119's full-sized avatar

Yutaro Muta yutailang0119

View GitHub Profile

slidenumber: true autoscale: true

Swift6のprotocol

わいわいswiftc #36

@omochimetaru


@sidepelican
sidepelican / ContentView.swift
Created January 13, 2022 09:12
.task{}のバックポート検討
import SwiftUI
func longlongAsyncFunction() async {
let id = UUID()
print("\(id): start")
do {
try await withTaskCancellationHandler {
try await Task.sleep(nanoseconds: 1000 * 1000 * 1000 * 10)
print("\(id): end")
} onCancel: {
@rizumita
rizumita / CodePiece.swift
Created February 8, 2020 23:40
Swiftにasync/awaitが無いのでCombineでなんちゃってasync/awaitを書いた。Swift5.2のcallAsFunctionを使うことでyieldが書きやすくなった。 #CodePiece
import Foundation
import Combine
public func async<T>(_ body: @escaping (Yield<T>) throws -> ()) -> Async<T> {
Async(body: body)
}
public func await<P>(_ publisher: P) throws -> P.Output where P: Publisher {
try publisher.await()
}
#!/bin/sh
echo "Running pre-commit..."
# pre-commit自体が最新かどうかをチェック
PRECOMMIT_MASTER_FILE='./script/pre-commit'
if [ -e $PRECOMMIT_MASTER_FILE ]; then
diff -s $PRECOMMIT_MASTER_FILE ./.git/hooks/pre-commit > /dev/null 2>&1
if [ $? -ne 0 ]; then
cp $PRECOMMIT_MASTER_FILE ./.git/hooks/pre-commit

slidenumber: true autoscale: true

iOS13とmacOS CatalinaのWebSocketサポート

参加してなくてもついていけるもん!

WWDCゴリゴリキャッチアップ会 2019

@omochimetaru


slidenumber: true autoscale: true

Opaque Result Typeの実装

omochimetaru

わいわいswiftc #11


疑問

slidenumber: true autoscale: true

Opaque Result Typeの解説

omochimetaru

わいわいswiftc #11


5秒なら

slidenumber: true autoscale: true

ABI安定化とLibrary Evolution

omochimetaru

わいわいswiftc #11


Swift5といえば

@marty-suzuki
marty-suzuki / UnidirectionalInputOutputViewModelWithKeyPath.swift
Last active March 28, 2019 09:43
Logic of Unidirectional Input / Output ViewModel Sample with Swift KeyPath (Sample logic of https://github.com/cats-oss/Unio)
// This sample works on Swift4.2 and Swift5!
// Let's try to execute this sample with Playground!
import Foundation
// - MARK: Artificially RxSwift classes
public enum Rx {
public final class Observable<E> {}
@floriankugler
floriankugler / AutoLayoutHelpers.swift
Last active August 30, 2023 21:17
Very simple key path based Auto Layout helpers
import UIKit
typealias Constraint = (UIView, UIView) -> NSLayoutConstraint
func equal<L, Axis>(_ to: KeyPath<UIView, L>, constant: CGFloat = 0) -> Constraint where L: NSLayoutAnchor<Axis> {
return equal(to, to, constant: constant)
}
func equal<L, Axis>(_ from: KeyPath<UIView, L>, _ to: KeyPath<UIView, L>, constant: CGFloat = 0) -> Constraint where L: NSLayoutAnchor<Axis> {
return { view1, view2 in