This file contains 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 AsyncDisplayKit | |
import Foundation | |
import KeyboardGuide | |
import AppFoundation | |
/** | |
A sub-class of ASCollectionNode that supports handling the height of the Keyboard. | |
Using `KeyboardGuide`, it changes its contentInset and scroll-indicator regarding the relative height of the Keyboard. |
This file contains 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
open class ZStackView: UIView { | |
public init(views: [UIView]) { | |
super.init(frame: .zero) | |
views.forEach { view in | |
addSubview(view) | |
view.translatesAutoresizingMaskIntoConstraints = false |
This file contains 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 | |
public final class InputFilter { | |
private final class Storage<T> { | |
let lock = NSLock() |
This file contains 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
//: [Previous](@previous) | |
import Foundation | |
final class FilterStorage { | |
private var storage: [String: Any] = [:] | |
func comparer<T>(for key: String) -> ((T) -> Bool)? { | |
guard let object = storage[key] else { |
This file contains 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
extension CGImage { | |
enum Flipping { | |
case vertically | |
case horizontally | |
} | |
func rotated(angle: CGFloat, flipping: Flipping? = nil) throws -> CGImage | |
{ | |
guard angle != 0 else { |
This file contains 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
{"v":"5.6.5","fr":29.9700012207031,"ip":0,"op":39.0000015885026,"w":253,"h":194,"nm":"baloon_free","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"レイヤー 1/baloon_freeアウトライン 2","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":1,"s":[0]},{"t":11.0000004480392,"s":[100]}],"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":10,"s":[-6]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":14,"s":[2]},{"t":30.0000012219251,"s":[0]}],"ix":10},"p":{"a":0,"k":[72.61,180.651,0],"ix":2},"a":{"a":0,"k":[43.67,131.788,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":10,"s":[89,89,100]},{"i":{"x":[0.833,0.833,0.833],"y":[1,1,1]},"o":{"x":[0.167,0.167,0.167],"y":[0,0,0]},"t":16,"s":[131,131,100]},{"i":{"x":[0.833,0.833,0.833],"y":[1,1,1]},"o":{"x":[0.167,0.167,0.167],"y":[0,0,0]},"t":20,"s":[119,119,100]},{"i":{"x":[0.833,0.833,0.833],"y":[1,1,1]},"o":{"x":[0.167,0.167 |
This file contains 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 StoreA: Store<StateA, Never> { | |
} | |
struct StateB: Equatable { | |
// Changesに包まれたままStateBに埋め込むとStateAの暗黙のコピーが発生しないのでパフォーマンスに優しいです。 | |
var stateA: Changes<StateA> | |
This file contains 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
prefix operator ‼️ | |
prefix public func ‼️(a: Bool) -> Bool { | |
return a | |
} |
This file contains 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 MyView: UIView { | |
init(ageDerived: Derived<Int>) { | |
... | |
} | |
} |
This file contains 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
// 1: UIコンポーネントが持つ値と比較する | |
store.subscribeState { (state: State) in | |
if nameLabel.text != state.name { | |
nameLabel.text = state.name | |
} | |
if ageLabel.text != "\(state.age)" { | |
ageLabel.text = "\(state.age)" | |
} | |
} |