This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ (UIColor *)colorFromString:(NSString *)string | |
{ | |
if (![string isKindOfClass:[NSString class]] && (string.length != 3 || string.length != 6 || string.length != 8)) | |
return [UIColor USPGrayColour]; | |
if (string.length == 3) | |
{ | |
NSMutableString *str = [NSMutableString new]; | |
for(int i =0 ;i<[string length]; i++) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Created by Liam Nichols on 14/10/2013. | |
// Copyright (c) 2013 Mubaloo Ltd. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
@interface LNOrderedMutableDictionary : NSMutableDictionary | |
///If `anObject` is nil, it will not be added to the dictionary. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSFetchRequest *search = [NSFetchRequest fetchRequestWithEntityName:@"<<ENTITY NAME>>"]; | |
search.resultType = NSDictionaryResultType; | |
search.returnsDistinctResults = YES; | |
search.propertiesToFetch = @[ @"<<ID KEY>>" ]; | |
NSArray *results = [managedObjectContext executeFetchRequest:search error:nil]; | |
NSSet *allIDs = [NSSet setWithArray:[results valueForKeyPath:@"<<ID KEY>>"]]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSMutableAttributedString *string = [[NSMutableAttributedString alloc] init]; | |
//Total Part | |
[string appendAttributedString:[[NSAttributedString alloc] initWithString:@"Total: " attributes:[self standardAttributes]]]; | |
//Main Price Part | |
[string appendAttributedString:[[NSAttributedString alloc] initWithString:@"£99.10" attributes:[self boldAttributes]]]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ (UIImage *)installButtonBackground:(BOOL)fill | |
{ | |
CGFloat borderWidth = 1.0; | |
CGFloat cornerRadius = 3.0; | |
CGSize size = CGSizeMake((cornerRadius * 2) + 1.0, (cornerRadius * 2) + 1.0); | |
UIColor *buttonColor = [UIColor installButtonColor]; | |
UIGraphicsBeginImageContextWithOptions(size, NO, 0.0); | |
UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake((borderWidth / 2), (borderWidth / 2), size.width - borderWidth, size.height - borderWidth) byRoundingCorners:UIRectCornerAllCorners cornerRadii:CGSizeMake(cornerRadius, cornerRadius)]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Incident Identifier: 2986E199-B268-464A-883E-362B59A00AD0 | |
CrashReporter Key: c68af6ee22388954851f65669288c7fb6e1c03dc | |
Hardware Model: iPad4,1 | |
OS Version: iPhone OS 7.1.2 (11D257) | |
Kernel Version: Darwin Kernel Version 14.0.0: Thu May 15 23:17:54 PDT 2014; root:xnu-2423.10.71~1/RELEASE_ARM64_S5L8960X | |
Date: 2014-10-21 09:58:46 +0100 | |
Time since snapshot: 218 ms | |
Free pages: 1951 | |
Active pages: 133010 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<array> | |
<string>fb254145378030027</string> | |
<string>isupr8</string> | |
<string>fb176151905794941</string> | |
<string>recipeSearch-iPad</string> | |
<string>airfile</string> | |
<string>univision</string> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public extension UIFont { | |
/// Helper method to create a UIFont with updated attributes applied to the UIFontDescriptor | |
/// | |
/// - parameter attributes: The new attributes to apply to the fontDescriptor | |
/// | |
/// - returns: A UIFont object with the new attributes appended to the receivers fontDescriptor | |
func addingAttributes(_ attributes: [String : Any] = [:]) -> UIFont { | |
return UIFont(descriptor: fontDescriptor.addingAttributes(attributes), size: pointSize) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import FirebaseRemoteConfig | |
final class Config { | |
/// The shared instance of config to use | |
static let shared: Config = Config() | |
/// The maximum number of items that are allowed in this mystery app | |
internal let maxItemCount: Int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
extension URLSessionTask: WebImageOperation { } | |
protocol WebImageOperation { | |
func cancel() | |
} | |
class WebImageManager { | |
struct Error: Swift.Error { |