Skip to content

Instantly share code, notes, and snippets.

View yutailang0119's full-sized avatar

Yutaro Muta yutailang0119

View GitHub Profile
@shinyaohira
shinyaohira / App States and Multitasking.md
Last active October 5, 2023 07:57
アプリケーションの状態とマルチタスキング

全体的に簡略化し、必要と思われる部分を抜粋しました。

  • Not running

    アプリは起動されていないか、実行されていたけれどもシステムによって終了されています。

  • Inactive

@kawanet
kawanet / NSURL+dictionaryFromQueryString.h
Last active December 23, 2015 15:49 — forked from halsk/NSURL+dictionaryFromQueryString.h
val にも = が入っていたり、key/val に + があった場合に対応してみました。 val が不正で stringByReplacingPercentEscapesUsingEncoding が例外を出す場合もあるけど未対応。
#import <Foundation/Foundation.h>
@interface NSURL (dictionaryFromQueryString)
-(NSDictionary *) dictionaryFromQueryString;
@end
@mono0926
mono0926 / commit_message_example.md
Last active June 20, 2024 13:24
[転載] gitにおけるコミットログ/メッセージ例文集100
@dealforest
dealforest / slack.py
Last active January 24, 2018 01:53
send to slack in LLDB
#!/usr/bin/env python
import lldb
def slack(debugger, command, result, internal_dict):
frame = lldb.debugger.GetSelectedTarget().GetProcess().GetSelectedThread().GetSelectedFrame()
path = command
lldb.debugger.HandleCommand("""
expr -l swift --
@ukitaka
ukitaka / convert_to_srgb.md
Created February 9, 2017 10:13
Storyboardとxibのcolor spaceをsRGBに統一する

calibratedRGB → sRGB

% find . -name "*.storyboard" | xargs sed -i "" '-e s/colorSpace="calibratedRGB"/colorSpace="custom" customColorSpace="sRGB"/g'
% find . -name "*.xib" | xargs sed -i "" '-e s/colorSpace="calibratedRGB"/colorSpace="custom" customColorSpace="sRGB"/g'

calibratedWhite → sRGB

@lattner
lattner / async_swift_proposal.md
Last active April 21, 2024 09:43 — forked from oleganza/async_swift_proposal.md
Concrete proposal for async semantics in Swift

Async/Await for Swift

Introduction

Modern Cocoa development involves a lot of asynchronous programming using closures and completion handlers, but these APIs are hard to use. This gets particularly problematic when many asynchronous operations are used, error handling is required, or control flow between asynchronous calls gets complicated. This proposal describes a language extension to make this a lot more natural and less error prone.

This paper introduces a first class Coroutine model to Swift. Functions can opt into to being async, allowing the programmer to compose complex logic involving asynchronous operations, leaving the compiler in charge of producing the necessary closures and state machines to implement that logic.

@tarunon
tarunon / Image.swift
Created October 4, 2018 06:48
How to solve Bundle things in microframeworks
public struct BundleReference<T: NSObjectProtocol> {
static var _bundle: Bundle {
return Bundle(for: T.self)
}
}
public protocol BundleReferencable {
associatedtype Referenced: NSObjectProtocol
static var bundle: BundleReference<Referenced>.Type { get }
@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
@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> {}

slidenumber: true autoscale: true

ABI安定化とLibrary Evolution

omochimetaru

わいわいswiftc #11


Swift5といえば