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
# Compiled source # | |
################### | |
*.com | |
*.class | |
*.dll | |
*.exe | |
*.o | |
*.so | |
# Packages # |
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
-(void)geocodeMe { | |
CLGeocoder *geocoder = [CLGeocoder new]; | |
[geocoder geocodeAddressString:@"" completionHandler:^(NSArray *placemarks, NSError *error) { | |
/** | |
* deprecated sample error message | |
*/ | |
if (error) | |
{ | |
// [self.latitudeTextField setText:@"Not found"]; | |
// [self.longitudeTextField setText:@"Not found"]; |
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/UIKit.h> | |
@interface UIImage (FromURL) | |
+(UIImage*)imageWithContentsOfURLString:(NSString*)URLString; | |
@end | |
//************************************* |
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 | |
extension String | |
{ | |
var length: Int { | |
get { | |
return countElements(self) | |
} | |
} | |
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
// | |
// NSAttributedString+HTML.swift | |
// | |
// Created by Amitai Blickstein on 6/22/16. | |
// Copyright © 2016 Amitai Blickstein, LLC. All rights reserved. | |
// | |
import UIKit | |
//////////////////////// |
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
/* | |
Instead of, say: | |
if let definitelyAString = perhapsAString as? String { // yadda... } | |
We now have: | |
String(perhapsAString) // returns a String? (an optional) | |
*/ | |
protocol OptionalLiteralType { |
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
// Swift 3.0 | |
// snake_cased | |
import Foundation | |
extension String { | |
mutating func snake_cased() { | |
self = self.snake_case() | |
} | |
func snake_case() -> 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
import UIKit | |
// Swift 3.0 | |
// Helper | |
public extension Character { | |
public var stringValue: String { return String(self) } | |
} | |
extension String { | |
// MARK: - CamelCase |
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
precedencegroup BooleanPrecedence { associativity: left } | |
infix operator ^^ : BooleanPrecedence | |
/** | |
Swift Logical XOR operator | |
``` | |
true ^^ true // false | |
true ^^ false // true | |
false ^^ true // true | |
false ^^ false // false | |
``` |
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
// | |
// UITableViewCellExtensions.swift | |
// HealthBucks | |
// | |
// Created by Amitai Blickstein on 11/28/16. | |
// Copyright © 2016 Amitai Blickstein, LLC. All rights reserved. | |
// | |
import UIKit |
OlderNewer