Skip to content

Instantly share code, notes, and snippets.

View ferbass's full-sized avatar
:octocat:
ι(`ロ´)ノ

Fernando Bass ferbass

:octocat:
ι(`ロ´)ノ
View GitHub Profile
NSNotificationCenter.defaultCenter().addObserver(self,
selector: "didReceiveUIContentSizeCategoryDidChangeNotification:",
name: UIContentSizeCategoryDidChangeNotification, object: nil)
- (void)didReceiveUIContentSizeCategoryDidChangeNotification:(NSNotification *)notification
{
label.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody];
}
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(didReceiveUIContentSizeCategoryDidChangeNotification:)
name:UIContentSizeCategoryDidChangeNotification object:nil];
label.font = UIFont.preferredFontForTextStyle(UIFontTextStyleBody)
label.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody];
@ferbass
ferbass / gist:c5a6993cb7b8b56fadbe
Created November 28, 2014 02:12
gitignore previously tracked files
git ls-files --ignored --exclude-standard | xargs git rm --cached
@ferbass
ferbass / gist:3ecc06a8ae992365bf73
Created September 20, 2014 03:04
Xcode failed to download. Use the Purchases page to try again.
Steps:
Open Terminal.
Run the following command:
defaults write com.apple.appstore ShowDebugMenu -bool true
Relaunch the App Store.
Choose the menu item Debug → Reset Application.
@ferbass
ferbass / gist:281947f23f47fb1a6011
Created July 21, 2014 16:47
Disable iTunesHelper
sudo mv /Applications/iTunes.app/Contents/MacOS/iTunesHelper.app /Applications/iTunes.app/Contents/MacOS/iTunesHelper-disable.app
@ferbass
ferbass / gist:7239784
Last active December 27, 2015 00:39
create a circle in view using bezierpath wi
- (void)drawRect:(CGRect)rect
{
CGRect box = CGRectInset(self.bounds, self.bounds.size.width * 0.1f, self.bounds.size.height * 0.1f);
UIBezierPath *ballBezierPath = [UIBezierPath bezierPathWithOvalInRect:box];
[[UIColor whiteColor] setStroke];
[[UIColor colorWithRed:0.734 green:0.000 blue:0.000 alpha:1.000] setFill];
@ferbass
ferbass / gist:7231889
Created October 30, 2013 12:32
Objective-C ZigZag line with CoreGraphics
- (void)drawRect:(CGRect)rect
{
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetStrokeColorWithColor(context, [[UIColor colorWithRed:241.0/255.0 green:241.0/255.0 blue:238.0/255.0 alpha:1] CGColor]);
CGContextSetLineWidth(context, 0.6);
CGContextMoveToPoint(context, CGRectGetMinX(rect), CGRectGetMaxY(rect) - 5);