Simple visual illustrations of how CGRectDivideWithPadding works.
+-------+---------+------------>
e | | |
d | slice | padding | remainder…
g | | |
e | | |
| { | |
| "bold_folder_labels": true, | |
| "color_scheme": "Packages/User/Espresso Soda.tmTheme", | |
| "ensure_newline_at_eof_on_save": true, | |
| "file_exclude_patterns": | |
| [ | |
| ".DS_Store", | |
| ".gitkeep", | |
| "dump.rdb" | |
| ], |
| // Smart little helper to find main thread hangs. Enable in appDidFinishLaunching. | |
| // Only available with source code in DEBUG mode. | |
| @interface PSPDFHangDetector : NSObject | |
| + (void)startHangDetector; | |
| @end | |
| @implementation PSPDFHangDetector | |
| + (void)startHangDetector { | |
| #ifdef DEBUG |
| // | |
| // SOInsetLabel.h | |
| // | |
| // Created by Joseph Hankin on 11/2/12. | |
| // From code posted by Rob Mayoff. | |
| // http://stackoverflow.com/questions/8467141/ios-how-to-achieve-emboss-effect-for-the-text-on-uilabel | |
| // Copyright (c) 2012 Joseph Hankin. All rights reserved. | |
| // |
| // | |
| // OLD AND BUSTED | |
| // | |
| if ([self.zoomingDelegate respondsToSelector:@selector(zoomingWindow:didZoomOutViewController:)] == YES) | |
| { | |
| // Do something important. | |
| } | |
| // |
| /* ----------------------------------------------------------------------- */ | |
| /* */ | |
| /* Improved upon a mixin from 37signals and combined */ | |
| /* with these numbers from marc. */ | |
| /* */ | |
| /* 37signals-version: */ | |
| /* http://37signals.com/svn/posts/3271-easy-retina-ready-images-using-scss */ | |
| /* */ | |
| /* @kimroen */ | |
| /* */ |
Simple visual illustrations of how CGRectDivideWithPadding works.
+-------+---------+------------>
e | | |
d | slice | padding | remainder…
g | | |
e | | |
| // Taken from the commercial iOS PDF framework http://pspdfkit.com. | |
| // Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved. | |
| // Licensed under MIT (http://opensource.org/licenses/MIT) | |
| // | |
| // You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it. | |
| // PLEASE DUPE rdar://27192338 (https://openradar.appspot.com/27192338) if you would like to see this in UIKit. | |
| #import <objc/runtime.h> | |
| #import <objc/message.h> |
| source ~/.bash_profile | |
| cd ${SRCROOT} | |
| /path/to/xctool.sh -reporter json-compilation-database:compile_commands.json clean | |
| /path/to/xctool.sh -reporter json-compilation-database:compile_commands.json build | |
| oclint-json-compilation-database | sed 's/\(.*\.\m\{1,2\}:[0-9]*:[0-9]*:\)/\1 warning:/' |
| @implementation UITextView (RSExtras) | |
| static BOOL stringCharacterIsAllowedAsPartOfLink(NSString *s) { | |
| /*[s length] is assumed to be 0 or 1. s may be nil. | |
| Totally not a strict check.*/ | |
| if (s == nil || [s length] < 1) | |
| return NO; |
| //This should be added before the layout of the view | |
| - (void) adaptToTopLayoutGuide { | |
| //Check if we can get the top layoutguide | |
| if (![self respondsToSelector:@selector(topLayoutGuide)]) { | |
| return; | |
| } | |
| //tankView is a contaner view | |
| NSArray * array = [self.tankView referencingConstraintsInSuperviews]; //<--For this method get the Autolayout Demistified Book Sample made by Erica Sadun | |
| [self.view removeConstraints:array]; | |
| NSArray * constraintsVertical = [NSLayoutConstraint constraintsWithVisualFormat:@"V:|[topLayoutGuide]-0-[tankView]|" options:0 metrics:nil views:@{@"tankView": self.tankView, @"topLayoutGuide":self.topLayoutGuide}]; |