Skip to content

Commit d4ecefb

Browse files
author
Dylan Marriott
committed
Now using own pods (DMListener, DMJobManager)
1 parent e1eb625 commit d4ecefb

98 files changed

Lines changed: 11411 additions & 8780 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

BitStore.xcodeproj/project.pbxproj

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030
9A073F421996F044007E0D0F /* PhoneInputViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A073F411996F044007E0D0F /* PhoneInputViewController.m */; };
3131
9A073F4819978042007E0D0F /* PhoneVerificationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A073F4719978042007E0D0F /* PhoneVerificationViewController.m */; };
3232
9A19022D19A0FAD7008D928B /* Keys.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A19022C19A0FAD7008D928B /* Keys.m */; };
33-
9A1DAEBB197BD5B600BB9DF7 /* JobHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A1DAEBA197BD5B600BB9DF7 /* JobHelper.m */; };
34-
9A1DAEC1197BD72900BB9DF7 /* Job.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A1DAEC0197BD72900BB9DF7 /* Job.m */; };
3533
9A1DAEC4197BD95300BB9DF7 /* PushHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A1DAEC3197BD95300BB9DF7 /* PushHelper.m */; };
3634
9A1DAEC8197C2C1C00BB9DF7 /* Unit.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A1DAEC7197C2C1C00BB9DF7 /* Unit.m */; };
3735
9A1DAECB197C305400BB9DF7 /* ChangeUnitViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A1DAECA197C305400BB9DF7 /* ChangeUnitViewController.m */; };
@@ -105,8 +103,6 @@
105103
9AAAC43119D0C97400994EB6 /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9AAAC43019D0C97400994EB6 /* MainInterface.storyboard */; };
106104
9AB7EAF019903DEA00B9A1BA /* API.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AB7EAEF19903DEA00B9A1BA /* API.m */; };
107105
9AB7EAF319903DFB00B9A1BA /* Environment.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AB7EAF219903DFB00B9A1BA /* Environment.m */; };
108-
9ABC07131983092500EC87A3 /* WeakRef.m in Sources */ = {isa = PBXBuildFile; fileRef = 9ABC07121983092500EC87A3 /* WeakRef.m */; };
109-
9ABC071619830FB800EC87A3 /* Listeners.m in Sources */ = {isa = PBXBuildFile; fileRef = 9ABC071519830FB800EC87A3 /* Listeners.m */; };
110106
9ABC07241983171000EC87A3 /* ReceiveNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9ABC07191983171000EC87A3 /* ReceiveNavigationController.m */; };
111107
9ABC07251983171000EC87A3 /* ReceiveViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9ABC071B1983171000EC87A3 /* ReceiveViewController.m */; };
112108
9ABC07271983171000EC87A3 /* SendNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9ABC07211983171000EC87A3 /* SendNavigationController.m */; };
@@ -194,10 +190,6 @@
194190
9A073F4719978042007E0D0F /* PhoneVerificationViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PhoneVerificationViewController.m; sourceTree = "<group>"; };
195191
9A19022B19A0FAD7008D928B /* Keys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Keys.h; sourceTree = "<group>"; };
196192
9A19022C19A0FAD7008D928B /* Keys.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Keys.m; sourceTree = "<group>"; };
197-
9A1DAEB9197BD5B600BB9DF7 /* JobHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JobHelper.h; sourceTree = "<group>"; };
198-
9A1DAEBA197BD5B600BB9DF7 /* JobHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JobHelper.m; sourceTree = "<group>"; };
199-
9A1DAEBF197BD72900BB9DF7 /* Job.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Job.h; sourceTree = "<group>"; };
200-
9A1DAEC0197BD72900BB9DF7 /* Job.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Job.m; sourceTree = "<group>"; };
201193
9A1DAEC2197BD95300BB9DF7 /* PushHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PushHelper.h; sourceTree = "<group>"; };
202194
9A1DAEC3197BD95300BB9DF7 /* PushHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PushHelper.m; sourceTree = "<group>"; };
203195
9A1DAEC6197C2C1C00BB9DF7 /* Unit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Unit.h; sourceTree = "<group>"; };
@@ -342,10 +334,6 @@
342334
9AB7EAF119903DFB00B9A1BA /* Environment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Environment.h; sourceTree = "<group>"; };
343335
9AB7EAF219903DFB00B9A1BA /* Environment.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Environment.m; sourceTree = "<group>"; };
344336
9ABC07091981C18500EC87A3 /* AddressHelperListener.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AddressHelperListener.h; sourceTree = "<group>"; };
345-
9ABC07111983092500EC87A3 /* WeakRef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakRef.h; sourceTree = "<group>"; };
346-
9ABC07121983092500EC87A3 /* WeakRef.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WeakRef.m; sourceTree = "<group>"; };
347-
9ABC071419830FB800EC87A3 /* Listeners.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Listeners.h; sourceTree = "<group>"; };
348-
9ABC071519830FB800EC87A3 /* Listeners.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Listeners.m; sourceTree = "<group>"; };
349337
9ABC07181983171000EC87A3 /* ReceiveNavigationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReceiveNavigationController.h; sourceTree = "<group>"; };
350338
9ABC07191983171000EC87A3 /* ReceiveNavigationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReceiveNavigationController.m; sourceTree = "<group>"; };
351339
9ABC071A1983171000EC87A3 /* ReceiveViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReceiveViewController.h; sourceTree = "<group>"; };
@@ -515,16 +503,12 @@
515503
9AA466BA1972D82A00A7B562 /* Color.h */,
516504
9AA466BB1972D82A00A7B562 /* Color.m */,
517505
9AF0C4F5196B3A0200F62DB5 /* iOSFix.h */,
518-
9ABC071419830FB800EC87A3 /* Listeners.h */,
519-
9ABC071519830FB800EC87A3 /* Listeners.m */,
520506
9A265ED81965EE03005BE50A /* NSString+Satoshi.h */,
521507
9A265ED91965EE03005BE50A /* NSString+Satoshi.m */,
522508
9A265EDB1965EE42005BE50A /* UIAlertView+BitStore.h */,
523509
9A265EDC1965EE42005BE50A /* UIAlertView+BitStore.m */,
524510
9A33C53019956FD100312A88 /* URI.h */,
525511
9A33C53119956FD100312A88 /* URI.m */,
526-
9ABC07111983092500EC87A3 /* WeakRef.h */,
527-
9ABC07121983092500EC87A3 /* WeakRef.m */,
528512
);
529513
path = Utils;
530514
sourceTree = "<group>";
@@ -663,8 +647,6 @@
663647
9A67A7141950D70A001FCE32 /* ContactHelper.m */,
664648
9A67A7151950D70A001FCE32 /* ExchangeHelper.h */,
665649
9A67A7161950D70A001FCE32 /* ExchangeHelper.m */,
666-
9A1DAEB9197BD5B600BB9DF7 /* JobHelper.h */,
667-
9A1DAEBA197BD5B600BB9DF7 /* JobHelper.m */,
668650
9A702651196098BF0033026C /* MessageHelper.h */,
669651
9A702652196098BF0033026C /* MessageHelper.m */,
670652
9A1DAEC2197BD95300BB9DF7 /* PushHelper.h */,
@@ -736,8 +718,6 @@
736718
9A67A74F1950D70A001FCE32 /* Exchange.h */,
737719
9A67A7501950D70A001FCE32 /* Exchange.m */,
738720
9A67A7511950D70A001FCE32 /* ExchangeListener.h */,
739-
9A1DAEBF197BD72900BB9DF7 /* Job.h */,
740-
9A1DAEC0197BD72900BB9DF7 /* Job.m */,
741721
9A073F3D1996EDCD007E0D0F /* Order.h */,
742722
9A073F3E1996EDCD007E0D0F /* Order.m */,
743723
9A67A7521950D70A001FCE32 /* Receiver.h */,
@@ -1132,7 +1112,6 @@
11321112
buildActionMask = 2147483647;
11331113
files = (
11341114
9A702638195F26ED0033026C /* KeyExportViewController.m in Sources */,
1135-
9A1DAEBB197BD5B600BB9DF7 /* JobHelper.m in Sources */,
11361115
9A67A7851950D70A001FCE32 /* Transaction.m in Sources */,
11371116
9ABC07271983171000EC87A3 /* SendNavigationController.m in Sources */,
11381117
9A33C53219956FD100312A88 /* URI.m in Sources */,
@@ -1153,7 +1132,6 @@
11531132
037BB8A21961DEBB001C42B8 /* SettingsNavigationController.m in Sources */,
11541133
9A67A7671950D70A001FCE32 /* ContactHelper.m in Sources */,
11551134
9A8D3C53195E258600E88A1C /* SettingsViewController.m in Sources */,
1156-
9A1DAEC1197BD72900BB9DF7 /* Job.m in Sources */,
11571135
9A8D3C50195E248C00E88A1C /* ChangeCurrencyViewController.m in Sources */,
11581136
9A67A77B1950D70A001FCE32 /* qrspec.c in Sources */,
11591137
9ABC07241983171000EC87A3 /* ReceiveNavigationController.m in Sources */,
@@ -1177,7 +1155,6 @@
11771155
9A67A7831950D70A001FCE32 /* Exchange.m in Sources */,
11781156
9A67A7791950D70A001FCE32 /* qrencode.c in Sources */,
11791157
9A67A7681950D70A001FCE32 /* ExchangeHelper.m in Sources */,
1180-
9ABC07131983092500EC87A3 /* WeakRef.m in Sources */,
11811158
9A19022D19A0FAD7008D928B /* Keys.m in Sources */,
11821159
9A67A77F1950D70A001FCE32 /* Address.m in Sources */,
11831160
9A67A7821950D70A001FCE32 /* ContactList.m in Sources */,
@@ -1209,7 +1186,6 @@
12091186
9A67A76A1950D70A001FCE32 /* RequestHelper.m in Sources */,
12101187
9A9D588E19D4867400EA940A /* AccountActionButton.m in Sources */,
12111188
9A67A7561950D70A001FCE32 /* AppDelegate.m in Sources */,
1212-
9ABC071619830FB800EC87A3 /* Listeners.m in Sources */,
12131189
);
12141190
runOnlyForDeploymentPostprocessing = 0;
12151191
};

BitStore/AppDelegate.m

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,23 @@
1515
#import "SendNavigationController.h"
1616
#import "ReceiveNavigationController.h"
1717
#import "AppStart.h"
18+
#import <DMJobManager/DMJobManager.h>
1819

1920
@implementation AppDelegate
2021

2122
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
2223
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
2324
self.window.backgroundColor = [UIColor whiteColor];
2425
[self.window makeKeyAndVisible];
25-
[AppStart start];
26+
[DMJobManager startManager];
27+
[AppStart start];
2628
return YES;
2729
}
2830

2931
- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken {
3032
NSString* token = [deviceToken description];
31-
token = [token stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"<>"]];
32-
token = [token stringByReplacingOccurrencesOfString:@" " withString:@""];
33+
token = [token stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"<>"]];
34+
token = [token stringByReplacingOccurrencesOfString:@" " withString:@""];
3335
[PushHelper registerPush:token];
3436
}
3537

@@ -45,7 +47,7 @@ - (void)application:(UIApplication*)application didFailToRegisterForRemoteNotifi
4547
- (void)applicationDidBecomeActive:(UIApplication *)application {
4648
Address* address = [AddressHelper instance].defaultAddress;
4749
[address refresh];
48-
[AppStart loadSettings];
50+
[AppStart loadSettings];
4951
}
5052

5153
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
@@ -66,7 +68,7 @@ - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
6668
opened = YES;
6769
}
6870
}
69-
return opened;
71+
return opened;
7072
}
7173

7274
@end

BitStore/Controller/Settings/ChangeUnitViewController.m

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
#import "ExchangeListener.h"
1515
#import "Address.h"
1616
#import "AddressHelper.h"
17-
#import "Job.h"
18-
#import "JobHelper.h"
17+
#import <DMJobManager/DMJobManager.h>
1918

2019
@interface ChangeUnitViewController () <ExchangeListener>
2120
@end
@@ -83,8 +82,8 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
8382
[[PiwikTracker sharedInstance] sendEventWithCategory:@"Events" action:[NSString stringWithFormat:@"ChangedUnit_%@", [unit displayName]] label:@"ChangeUnit"];
8483
[[ExchangeHelper instance] changeUnit:unit];
8584
NSString* url = [NSString stringWithFormat:@"%@?a=%@&u=%@", [API changeUnitUrl], [AddressHelper instance].defaultAddress.address, unit.technicalName];
86-
Job* job = [[Job alloc] initWithUrl:url];
87-
[[JobHelper instance] postJob:job];
85+
DMHTTPRequestJob* job = [[DMHTTPRequestJob alloc] initWithUrl:url];
86+
[DMJobManager postJob:job];
8887
[self.navigationController popViewControllerAnimated:YES];
8988
}
9089

BitStore/Helper/AddressHelper.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
#import "Address.h"
1212
#import "AddressHelperListener.h"
1313
#import "AddressListener.h"
14-
#import "Listeners.h"
14+
#import <DMListener/DMListener.h>
1515

1616
@interface AddressHelper () <AddressListener>
1717
@end
1818

1919
@implementation AddressHelper {
20-
Listeners* _listeners;
20+
DMListeners* _listeners;
2121
NSMutableArray* _addresses;
2222
}
2323

@@ -35,7 +35,7 @@ + (AddressHelper *)instance {
3535
- (id)init {
3636
if (self = [super init]) {
3737
[self loadState];
38-
_listeners = [[Listeners alloc] init];
38+
_listeners = [[DMListeners alloc] init];
3939
}
4040
return self;
4141
}

BitStore/Helper/ContactHelper.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
#import "ContactListListener.h"
1111
#import "UserDefaults.h"
1212
#import "Address.h"
13-
#import "Listeners.h"
13+
#import <DMListener/DMListener.h>
1414

1515
@implementation ContactHelper {
1616
ContactList* _contactList;
17-
Listeners* _listeners;
17+
DMListeners* _listeners;
1818
}
1919

2020
static ContactHelper* sharedHelper;
@@ -30,7 +30,7 @@ + (ContactHelper *)instance {
3030

3131
- (id)init {
3232
if (self = [super init]) {
33-
_listeners = [[Listeners alloc] init];
33+
_listeners = [[DMListeners alloc] init];
3434
[self loadState];
3535
for (Address* a in _contactList.contacts) {
3636
[a refresh];

BitStore/Helper/ExchangeHelper.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
#import "UserDefaults.h"
1212
#import "ExchangeListener.h"
1313
#import "RequestHelper.h"
14-
#import "Listeners.h"
14+
#import <DMListener/DMListener.h>
1515
#import "SharedUser.h"
1616

1717
@implementation ExchangeHelper {
18-
Listeners* _listeners;
18+
DMListeners* _listeners;
1919
Exchange* _exchange;
2020
NSTimer* _timer;
2121
}
@@ -34,7 +34,7 @@ + (ExchangeHelper *)instance {
3434

3535
- (id)init {
3636
if (self = [super init]) {
37-
_listeners = [[Listeners alloc] init];
37+
_listeners = [[DMListeners alloc] init];
3838
[self loadState];
3939
[self update];
4040
_timer = [NSTimer scheduledTimerWithTimeInterval:(DELAY)

BitStore/Helper/JobHelper.h

Lines changed: 0 additions & 19 deletions
This file was deleted.

BitStore/Helper/JobHelper.m

Lines changed: 0 additions & 76 deletions
This file was deleted.

BitStore/Helper/PushHelper.m

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@
77
//
88

99
#import "PushHelper.h"
10-
#import "JobHelper.h"
11-
#import "Job.h"
1210
#import "UserDefaults.h"
1311
#import "Address.h"
1412
#import "AddressHelper.h"
1513
#import "ExchangeHelper.h"
1614
#import "Unit.h"
15+
#import <DMJobManager/DMJobManager.h>
1716

1817
@implementation PushHelper
1918

@@ -23,7 +22,8 @@ + (void)registerPush:(NSString *)token {
2322
NSString* lang = [[NSLocale preferredLanguages] objectAtIndex:0];
2423
Unit* unit = [[ExchangeHelper instance] currentUnit];
2524
NSString* url = [NSString stringWithFormat:@"%@?a=%@&t=%@&l=%@&u=%@", [API registerPushUrl], address.address, token, lang, unit.technicalName];
26-
[[JobHelper instance] postJob:[[Job alloc] initWithUrl:url]];
25+
DMHTTPRequestJob* job = [[DMHTTPRequestJob alloc] initWithUrl:url];
26+
[DMJobManager postJob:job];
2727
}
2828

2929
+ (void)unregister {
@@ -34,7 +34,8 @@ + (void)unregister {
3434
+ (void)unregister:(NSString *)address {
3535
NSLog(@"push unregister: %@", address);
3636
NSString* url = [NSString stringWithFormat:@"%@?a=%@", [API unregisterPushUrl], address];
37-
[[JobHelper instance] postJob:[[Job alloc] initWithUrl:url]];
37+
DMHTTPRequestJob* job = [[DMHTTPRequestJob alloc] initWithUrl:url];
38+
[DMJobManager postJob:job];
3839
}
3940

4041
@end

BitStore/Model/Address.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@
1313
#import "Receiver.h"
1414
#import "MessageHelper.h"
1515
#import "UserDefaults.h"
16-
#import "Listeners.h"
16+
#import <DMListener/DMListener.h>
1717

1818
@implementation Address {
19-
Listeners* _listeners;
19+
DMListeners* _listeners;
2020
NSTimer* _timer;
2121
}
2222

2323
- (id)init {
2424
if (self = [super init]) {
25-
_listeners = [[Listeners alloc] init];
25+
_listeners = [[DMListeners alloc] init];
2626
self.total = -1;
2727
}
2828
return self;

0 commit comments

Comments
 (0)