So easy to forget this!
H:|-[icon(==iconDate)]-20-[iconLabel(120@250)]-20@750-[iconDate(>=50)]-|
H:horizontal direction.|-[iconicon's leading edge should have standard distance from its superview's leading edge.
| // nice! from this blog post https://swiftrocks.com/understanding-the-ios-responder-chain.html | |
| extension UIResponder { | |
| func responderChain() -> String { | |
| guard let next = next else { | |
| return String(describing: self) | |
| } | |
| return String(describing: self) + " -> " + next.responderChain() | |
| } | |
| } |
So easy to forget this!
H:|-[icon(==iconDate)]-20-[iconLabel(120@250)]-20@750-[iconDate(>=50)]-|
H: horizontal direction.|-[icon icon's leading edge should have standard distance from its superview's leading edge.| # PR is a work in progress and shouldn't be merged yet | |
| warn "PR is classed as Work in Progress" if github.pr_title.include? "[WIP]" | |
| # Warn when there is a big PR | |
| warn "Big PR, consider splitting into smaller" if git.lines_of_code > 500 | |
| # Ensure a clean commits history | |
| if git.commits.any? { |c| c.message =~ /^Merge branch '#{github.branch_for_base}'/ } | |
| fail "Please rebase to get rid of the merge commits in this PR" | |
| end |
| # The commands below are a guide to remove a large file that has been | |
| # accidentally committed to a Git repository's history. If the file is | |
| # larger than 100 MB, GitHub will prevent you from pushing your latest | |
| # commits. The annotated steps below should help you remove the large | |
| # file from your commit history, even if you've made new commit since. | |
| # Some Git users advise against rebasing. You can safely use it here | |
| # because you haven't published your changes yet. | |
| # So, you first need to rebase your current branch onto the point that |
| /* | |
| * Copyright (c) 2016 Razeware LLC | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy | |
| * of this software and associated documentation files (the "Software"), to deal | |
| * in the Software without restriction, including without limitation the rights | |
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| * copies of the Software, and to permit persons to whom the Software is | |
| * furnished to do so, subject to the following conditions: | |
| * |
// https://mokagio.github.io/tech-journal/2015/03/12/xcode-list-available-devices.html
instruments -s devices
Known Devices:
Gio’s MacBook Pro [<uuid>]
Gio's iPhone 6 (8.2) [<uuid>]
Resizable iPad (8.2 Simulator) []
| import UIKit | |
| func singlePixelLine(at y: CGFloat, in rect: CGRect, topBias: Bool = true) { | |
| let offset = pixelUnit/2.0 | |
| let adjustedY = round(from: y - offset, fraction: pixelUnit, down: topBias) + offset | |
| let line = makeLine(at: adjustedY, in: rect) | |
| strokePath(line, width: pixelUnit) | |
| } | |
| - (void)reconfigureVisibleCells | |
| { | |
| NSInteger sectionCount = [self numberOfSectionsInTableView:self.tableView]; | |
| for (NSInteger section = 0; section < sectionCount; ++section) { | |
| NSInteger rowCount = [self tableView:self.tableView numberOfRowsInSection:section]; | |
| for (NSInteger row = 0; row < rowCount; ++row) { | |
| NSIndexPath *indexPath = [NSIndexPath indexPathForRow:row inSection:section]; | |
| UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath]; |
Draw a mask image like Left-3 to blend a rounded corner:
func UIGraphicsDrawAntiRoundedCornerImageWithRadius(radius: CGFloat, outerSize: CGSize, innerSize: CGSize, fillColor: UIColor) -> UIImage{
UIGraphicsBeginImageContextWithOptions(outerSize, false, UIScreen.mainScreen().scale)
let currentContext = UIGraphicsGetCurrentContext()
let bezierPath = UIBezierPath()
| // SKImage | |
| // A simple class that draws a PaintCode StyleKit "Image Method" image centered inside a UIView | |
| // - installation: add to project and replace STYLEKIT_NAME comment with name of StyleKit class | |
| // - instantiation: SKImage(image: "NameOfImage") | |
| // - instantiation (with custom size): SKImage(image: "NameOfImage", size: CGRectMake(0, 0, 16, 16)) | |
| import UIKit | |
| class SKImage: UIView { |