Skip to content

Instantly share code, notes, and snippets.

NSError *error = nil;
if ([self.managedObjectContext save:&error] == NO) {
NSAssert(NO, @"Save should not fail");
[self showAlert];
}
- (void)showAlert {
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Could Not Save Data"
message:@"There was a problem saving your data but it is not your fault. If you restart the app, you can try again. Please contact support (support@domain.com) to notify us of this issue."
delegate:self
if gem list CFPropertyList -i; then
ruby InteriorDecorationAssistant/Settings/acknowledgementGenerator.rb "InteriorDecorationAssistant/Settings/Settings.bundle" "InteriorDecorationAssistant/Settings/licenses"
fi
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE")
buildNumber=$(($buildNumber + 1))
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "$INFOPLIST_FILE"
productVersion=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "$INFOPLIST_FILE")
/usr/libexec/PlistBuddy -c "Set PreferenceSpecifiers:2:DefaultValue $buildNumber" InteriorDecorationAssistant/Settings/Settings.bundle/Root.plist
// cheers to @stroughtonsmith for helping out with this one
UIColor *barColour = [UIColor colorWithRed:0.13f green:0.14f blue:0.15f alpha:1.00f];
UIView *colourView = [[UIView alloc] initWithFrame:CGRectMake(0.f, -20.f, 320.f, 64.f)];
colourView.opaque = NO;
colourView.alpha = .7f;
colourView.backgroundColor = barColour;
self.navigationBar.barTintColor = barColour;
http://devstreaming.apple.com/videos/wwdc/2015/1014o78qhj07pbfxt9g7/101/101_hd_keynote.mp4?dl=1
http://devstreaming.apple.com/videos/wwdc/2015/1026npwuy2crj2xyuq11/102/102_hd_platforms_state_of_the_union.mp4?dl=1
http://devstreaming.apple.com/videos/wwdc/2015/103ot7lzkdri2fvn1iyh/103/103_hd_apple_design_awards.mp4?dl=1
http://devstreaming.apple.com/videos/wwdc/2015/104usewvb5m0qbwafx8p/104/104_hd_whats_new_in_xcode.mp4?dl=1
http://devstreaming.apple.com/videos/wwdc/2015/105ncyldc6ofunvsgtan/105/105_hd_introducing_watchkit_for_watchos_2.mp4?dl=1
http://devstreaming.apple.com/videos/wwdc/2015/106z3yjwpfymnauri96m/106/106_hd_whats_new_in_swift.mp4?dl=1
http://devstreaming.apple.com/videos/wwdc/2015/1075hpxmc54818sn59su/107/107_hd_whats_new_in_cocoa_touch.mp4?dl=1
http://devstreaming.apple.com/videos/wwdc/2015/1086gvs7f4vryixs49s6/108/108_hd_building_watch_apps.mp4?dl=1
http://devstreaming.apple.com/videos/wwdc/2015/112lwa56zromr4h6uf0/112/112_hd_think_audacious.mp4?dl=1
http://devstreaming.apple.com/videos/wwdc/
//
// VIPSaleView.m
// BSNBrowser
//
// Created by Jun Xia on 15/7/27.
// Copyright (c) 2015年 BlueSeaNetwork. All rights reserved.
//
#import "BSNVIPMembershipSuggestionView.h"
#import "UIView+AutoLayout.h"
//
// VIPSaleView.m
// BSNBrowser
//
// Created by Jun Xia on 15/7/27.
// Copyright (c) 2015年 BlueSeaNetwork. All rights reserved.
//
#import "BSNVIPMembershipSuggestionView.h"
#import "UIView+AutoLayout.h"
@interface MFLMHorizontalFlowLayout()
@property (nonatomic, strong) NSDictionary *layoutInfo;
@end
@implementation MFLMHorizontalFlowLayout
- (void)prepareLayout {
self.itemSize = CGSizeMake((ScreenRect.size.width - 45) / 3, (ScreenRect.size.width - 45) / 3);
@xdream86
xdream86 / YourViewController.m
Created October 24, 2015 14:58 — forked from amster/YourViewController.m
Load a UIWebView in iOS that can also load local resources like images, CSS, and JavaScript
// An example viewDidLoad
- (void)viewDidLoad
{
[super viewDidLoad];
[self loadWebView];
}
// The example loader
//
// Assumes you have an IBOutlet for the UIWebView defined: @property (strong, nonatomic) UIWebView *wv;
@xdream86
xdream86 / iOSMapKitFitAnnotations.m
Created December 16, 2015 09:52 — forked from andrewgleave/iOSMapKitFitAnnotations.m
Zooms out a MKMapView to enclose all its annotations (inc. current location)
MKMapRect zoomRect = MKMapRectNull;
for (id <MKAnnotation> annotation in mapView.annotations) {
MKMapPoint annotationPoint = MKMapPointForCoordinate(annotation.coordinate);
MKMapRect pointRect = MKMapRectMake(annotationPoint.x, annotationPoint.y, 0, 0);
if (MKMapRectIsNull(zoomRect)) {
zoomRect = pointRect;
} else {
zoomRect = MKMapRectUnion(zoomRect, pointRect);
}
}
//
// ADBackFadeTransition.m
// AppLibrary
//
// Created by Patrick Nollet on 14/03/11.
// Copyright 2011 Applidium. All rights reserved.
//
#import "ADBackFadeTransition.h"
#import "ADDualTransition.h"