Skip to content

Commit 1886c15

Browse files
committed
Refactored code
1 parent 5ebb9fe commit 1886c15

2 files changed

Lines changed: 5 additions & 12 deletions

File tree

BitStore/Controller/Account/Send/SendNavigationController.m

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,7 @@
1212
@implementation SendNavigationController
1313

1414
- (id)init {
15-
if (self = [super init]) {
16-
SendViewController* vc = [[SendViewController alloc] init];
17-
self.title = vc.title;
18-
[self pushViewController:vc animated:NO];
19-
}
20-
return self;
15+
return [self initWithAddress:nil amount:nil];
2116
}
2217

2318
- (id)initWithAddress:(NSString *)address amount:(NSString *)amount {

BitStore/Controller/Account/Send/SendViewController.m

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,15 @@ @implementation SendViewController {
4949
}
5050

5151
- (id)init {
52+
return [self initWithAddress:nil amount:nil];
53+
}
54+
55+
- (id)initWithAddress:(NSString *)address amount:(NSString *)amount {
5256
if (self = [super initWithStyle:UITableViewStyleGrouped]) {
5357
self.title = l10n(@"send");
5458
Address* a = [AddressHelper instance].defaultAddress;
5559
[a addAddressListener:self];
5660
[[ExchangeHelper instance] addExchangeListener:self];
57-
}
58-
return self;
59-
}
60-
61-
- (id)initWithAddress:(NSString *)address amount:(NSString *)amount {
62-
if (self = [self init]) {
6361
_initAddress = address;
6462
_initAmount = amount;
6563
}

0 commit comments

Comments
 (0)