This file contains hidden or 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
| /// Core Animation doesn't support chaining of animations by default. The `CAAnimationChain` class adds this ability. | |
| /// The `CAAnimationSet` struct holds animation set for one target, and `CAAnimationChain` accepts an array of | |
| /// `CAAnimationSet`s to support multiple targets. | |
| import Foundation | |
| class CAAnimationChain: NSObject, CAAnimationDelegate { | |
| private var animationSets: [CAAnimationSet] | |
| private let completion: (() -> Void)? |
This file contains hidden or 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 UIFont { | |
| /** | |
| Will return the best font conforming to the descriptor which will fit in the provided bounds. | |
| */ | |
| static func bestFittingFontSize(for text: String, in bounds: CGRect, fontDescriptor: UIFontDescriptor, additionalAttributes: [NSAttributedStringKey: Any]? = nil) -> CGFloat { | |
| let constrainingDimension = min(bounds.width, bounds.height) | |
| let properBounds = CGRect(origin: .zero, size: bounds.size) | |
| var attributes = additionalAttributes ?? [:] | |
This file contains hidden or 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
| //: A UIKit based Playground for presenting user interface | |
| import UIKit | |
| import PlaygroundSupport | |
| let container = UIView(frame: CGRect(x: 0, y: 0, width: 500, height: 200)) | |
| container.backgroundColor = .lightGray | |
| class MyView: UIView { |
This file contains hidden or 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
| #!/bin/bash | |
| # | |
| # hook script for swiftlint. It will triggered when you make a commit. | |
| # | |
| #TODO: move this content to separate file ('lint'), add separate file for swiftformat ('format'), use them here in pre-commit | |
| GUI=0 | |
| LINT_PATH_FOR_GUI="/usr/local/bin/swiftlint" |
NewerOlder