This file contains hidden or 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
@interface NSDictionary (Swapping) | |
- (NSDictionary *)dictionaryBySwappingKey:(id)oldKey withKey:(id)newKey; | |
@end | |
@implementation NSDictionary (Swapping) | |
- (NSDictionary *)dictionaryBySwappingKey:(id)oldKey withKey:(id)newKey | |
{ |
This file contains hidden or 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
@interface NSDictionary (Swapping) | |
- (NSDictionary *)dictionaryBySwappingKeyWithValue; | |
@end | |
@interface NSDictionary (Swapping) | |
- (NSDictionary *)dictionaryBySwappingKeyWithValue | |
{ |
This file contains hidden or 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
/** | |
* Presents a view controller modally by superposing it's view on top of the | |
* presenting's view, but retaining it's context. | |
* | |
* Useful for creating a modal presentation with a dimmed background. | |
*/ | |
typedef enum { |
This file contains hidden or 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
git mergetool --tool=mergepbx <# ProjectName #>.xcodeproj/project.pbxproj |
This file contains hidden or 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 | |
enum Result<T> { | |
case success(T?) | |
case failure(Error) | |
} | |
enum HTTPError: Error { | |
case noResponse | |
case unsuccesfulStatusCode(Int) |
This file contains hidden or 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
protocol <#Name#>ViewModelInputs { | |
} | |
protocol <#Name#>ViewModelOutputs { | |
} | |
protocol <#Name#>ViewModelType { | |
var inputs: <#Name#>ViewModelInputs{ get } | |
var outputs: <#Name#>ViewModelOutputs { get } | |
} |
This file contains hidden or 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
let params = [ "userID" : 1, "balance" : 1000 ] | |
let string: String = params.reduce("") { | |
if $0.isEmpty { | |
return $1.key + "=" + String($1.value) | |
} else { | |
return $0 + "&" + $1.key + "=" + String($1.value) | |
} | |
} |