Skip to content

Instantly share code, notes, and snippets.

View Yaro812's full-sized avatar

Thorax Yaro812

  • St.Petersburg, Russia
View GitHub Profile
@ahbou
ahbou / ComposeView.swift
Last active July 12, 2019 03:30
iPhone X InputAccessoryView Fix
//
// ComposeView.swift
import UIKit
class ComposeView: UIView {
// ........
// Other layout code and methods
// ........
@JadenGeller
JadenGeller / Cluster.swift
Created March 13, 2017 01:27
Class Cluster
class Number /* class cluser */ {
class Int8: Number {
var value: Swift.Int8
init(_ value: Swift.Int8) { self.value = value }
}
class Int: Number {
var value: Swift.Int
init(_ value: Swift.Int) { self.value = value }
}
@Sorix
Sorix / AsynchronousOperation.swift
Last active June 15, 2023 10:50
Subclass of NSOperation (Operation) to make it asynchronous in Swift 3, 4, 5
// Created by Vasily Ulianov on 09.02.17, updated in 2019.
// License: MIT
import Foundation
/// Subclass of `Operation` that adds support of asynchronous operations.
/// 1. Call `super.main()` when override `main` method.
/// 2. When operation is finished or cancelled set `state = .finished` or `finish()`
open class AsynchronousOperation: Operation {
public override var isAsynchronous: Bool {
@morganwilde
morganwilde / gist:5574439
Created May 14, 2013 08:12
CATransform3D matrix with values explained
CATransform3D transformation = CATransform3DIdentity;
// x line
transformation.m11 = 1; // 20% less wide wall
transformation.m12 = 0; //-1 / 10.0; // skews left up, right down if >0
transformation.m13 = 0; // extends sideways for a short time
transformation.m14 = 0;// // 1 / 5000 = left side towards viewer, right side away from viewer
// y line
transformation.m21 = 0; //-1 / 2.0; // skews bottom left, top right if <0
transformation.m22 = 1; // .8 - 20% less tall
transformation.m23 = 0; // extends upward for a short time