Skip to content

Instantly share code, notes, and snippets.

@TimothyChilvers
TimothyChilvers / keybase
Created July 30, 2018 13:44
KeyBase ID
### Keybase proof
I hereby claim:
* I am timothychilvers on github.
* I am chilvman (https://keybase.io/chilvman) on keybase.
* I have a public key ASBXqwTIw2H6xBha1xQseAI_x_HWpKyVJKUqihoWh6_ppwo
To claim this, I am signing this object:
@TimothyChilvers
TimothyChilvers / .swiftlint.yaml
Created May 18, 2018 09:59
A SwiftLint rule forbidding new lines at the start of a new scope.
custom_rules:
no_newlines_at_start_of_scope:
included: ".*.swift"
name: "No newlines at the start of a scope"
regex: "\\{\\n\\s*\\n"
@TimothyChilvers
TimothyChilvers / DemoEnum.swift
Created February 21, 2018 17:38
Swift enum switch insufficient cases still builds
enum Demo {
case value1
case value2
case value3
case value4
case value5
case value6
case value7
case value8
case value9
- (void)moveStuff {
CGRect originalFrame = self.moveMe.frame;
CGAffineTransform firstTransform = CGAffineTransformMake(0, 1, -1, 0, -50, -50);
[UIView animateWithDuration:0.5 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
self.moveMe.transform = firstTransform;
} completion:^(BOOL finished) {
CGRect stashFrame = self.moveMe.frame;
self.moveMe.transform = CGAffineTransformIdentity;
@TimothyChilvers
TimothyChilvers / UINib Class Loading
Last active August 29, 2015 14:15
Convenience constructor for nibs from classes
@interface UINib (ClassLoading)
+ (UINib *)nibWithClass:(Class)classToLoad;
@end
@implementation UINib (ClassLoading)
+ (UINib *)nibWithClass:(Class)classToLoad {