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
typedef void (^CompletionBlock)(NSArray *results); | |
@interface ApiClient : NSObject | |
-(void)fetchCatalog:(CompletionBlock)block; | |
@end | |
@implementation ApiClient |
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
fastlane_version "1.0.2" | |
default_platform :ios | |
platform :ios do | |
before_all do | |
cocoapods |
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> | |
#import <Specta.h> | |
#import <Expecta.h> | |
#import <OCMock.h> | |
#import "SessionManager.h" | |
SpecBegin(SessionManagerSpec) | |
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 "EnvironmentUtil.h" | |
#import <DBEnvironmentConfiguration/DBEnvironmentConfiguration.h> | |
@implementation EnvironmentUtil | |
+(void)setupEnvironmentMappings{ | |
[DBEnvironmentConfiguration setEnvironmentMapping:@{ | |
[NSNumber numberWithInt:DBBuildTypeSimulator] : @"Staging", | |
[NSNumber numberWithInt:DBBuildTypeDebug] : @"Staging", |
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
__block HomeViewController *vc; | |
beforeAll(^{ | |
UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; | |
UIViewController *controller = [mainStoryboard instantiateViewControllerWithIdentifier:@"HomeViewController"]; | |
vc = (HomeViewController *)(controller); | |
[vc view]; | |
}); | |
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
+(NSDictionary*)parse:(NSDictionary*)dc{ | |
NSMutableDictionary *mutDc = [NSMutableDictionary dictionaryWithDictionary:dc]; | |
for(NSString *key in mutDc.allKeys){ | |
NSString *value = [mutDc objectForKey:key]; | |
if([value isEqualToString:@"true"]) | |
[mutDc setObject:@YES forKey:key]; | |
else if([value isEqualToString:@"false"]) | |
[mutDc setObject:@NO forKey: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
@interface BKBaseMantleObj : MTLModel<MTLJSONSerializing> | |
+ (NSDictionary *)JSONKeyPathsByPropertyKey; | |
+(instancetype)parse:(NSDictionary*)dc error:(NSError**)error; | |
-(NSDictionary*)asDictError:(NSError**)error; | |
@end | |
@interface BKBaseMantleObj (Collections) |
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 Moya | |
import CryptoSwift | |
import Dollar | |
import Keys | |
fileprivate struct MarvelAPIConfig { | |
fileprivate static let keys = MarvelKeys() | |
static let privatekey = keys.marvelPrivateKey()! | |
static let apikey = keys.marvelApiKey()! |
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
# Uncomment the next line to define a global platform for your project | |
platform :ios, '9.0' | |
target 'Marvel' do | |
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks | |
use_frameworks! | |
plugin 'cocoapods-keys', { | |
:project => "Marvel", | |
:keys => [ |
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 Moya | |
import RxSwift | |
import ObjectMapper | |
import Moya_ObjectMapper | |
extension Response { | |
func removeAPIWrappers() -> Response { | |
guard let json = try? self.mapJSON() as? Dictionary<String, AnyObject>, | |
let results = json?["data"]?["results"] ?? [], |
OlderNewer