- с утра посвизлил - весь день свободен
- украл, посвиззлил - в тюрьму
- волков бояться - в лесу не свиззлить
- не все золото что свиззлит
- свиззлинг - всему голова
- и рыбку съесть, и посвиззлить
- в большой семье свиззлом не щелкают
// Advanced SwiftUI Transitions | |
// https://swiftui-lab.com | |
// https://swiftui-lab.com/advanced-transitions | |
import SwiftUI | |
struct CrossEffectDemo: View { | |
let animationDuration: Double = 2 | |
let images = ["photo1", "photo2", "photo3", "photo4"] | |
@State private var idx = 0 |
// The SwiftUI Lab | |
// Website: https://swiftui-lab.com | |
// Article: https://swiftui-lab.com/alignment-guides | |
import SwiftUI | |
class Model: ObservableObject { | |
@Published var minimumContainer = true | |
@Published var extendedTouchBar = false | |
@Published var twoPhases = true |
// The MIT License (MIT) | |
// | |
// Copyright (c) 2017 Alexander Grebenyuk (github.com/kean). | |
import Foundation | |
import RxSwift | |
import RxCocoa | |
extension ObservableType { |
State machines are everywhere in interactive systems, but they're rarely defined clearly and explicitly. Given some big blob of code including implicit state machines, which transitions are possible and under what conditions? What effects take place on what transitions?
There are existing design patterns for state machines, but all the patterns I've seen complect side effects with the structure of the state machine itself. Instances of these patterns are difficult to test without mocking, and they end up with more dependencies. Worse, the classic patterns compose poorly: hierarchical state machines are typically not straightforward extensions. The functional programming world has solutions, but they don't transpose neatly enough to be broadly usable in mainstream languages.
Here I present a composable pattern for pure state machiness with effects,
// Check yourself if you know optionals good enough | |
let x: Int?? = nil | |
let y: Int?? = .Some(nil) | |
let a = x ?? 12 // a == ? | |
let b = y ?? 13 // b == ? |
# This script is based on Jacob Van Order's answer on apple dev forums https://devforums.apple.com/message/971277 | |
# See also http://spin.atomicobject.com/2011/12/13/building-a-universal-framework-for-ios/ for the start | |
# To get this to work with a Xcode 6 Cocoa Touch Framework, create Framework | |
# Then create a new Aggregate Target. Throw this script into a Build Script Phrase on the Aggregate | |
###################### | |
# Options |
#!env ruby | |
# | |
# Recursively replace a string in a directory by renaming files, directories, and rewriting file contents: | |
# | |
# $ rename.rb . GAIM Pidgin | |
# | |
# No changes are made unless -f is specified | |
DRY = !(ARGV.include? "-f") |