|
@@ -53,6 +53,7 @@ typedef UIViewController *(^FLEXNetworkDetailRowSelectionFuture)(void);
|
|
|
self = [super initWithStyle:UITableViewStyleGrouped];
|
|
self = [super initWithStyle:UITableViewStyleGrouped];
|
|
|
if (self) {
|
|
if (self) {
|
|
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleTransactionUpdatedNotification:) name:kFLEXNetworkRecorderTransactionUpdatedNotification object:nil];
|
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleTransactionUpdatedNotification:) name:kFLEXNetworkRecorderTransactionUpdatedNotification object:nil];
|
|
|
|
|
+ self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Copy" style:UIBarButtonItemStylePlain target:self action:@selector(copyButtonPressed:)];
|
|
|
}
|
|
}
|
|
|
return self;
|
|
return self;
|
|
|
}
|
|
}
|
|
@@ -117,6 +118,30 @@ typedef UIViewController *(^FLEXNetworkDetailRowSelectionFuture)(void);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+- (void)copyButtonPressed:(id)sender
|
|
|
|
|
+{
|
|
|
|
|
+ NSMutableString *requestDetailString = [NSMutableString string];
|
|
|
|
|
+
|
|
|
|
|
+ for (FLEXNetworkDetailSection *section in self.sections) {
|
|
|
|
|
+ if ([section.rows count] > 0) {
|
|
|
|
|
+ if ([section.title length] > 0) {
|
|
|
|
|
+ [requestDetailString appendString:section.title];
|
|
|
|
|
+ [requestDetailString appendString:@"\n\n"];
|
|
|
|
|
+ }
|
|
|
|
|
+ for (FLEXNetworkDetailRow *row in section.rows) {
|
|
|
|
|
+ NSString *rowDescription = [[[self class] attributedTextForRow:row] string];
|
|
|
|
|
+ if ([rowDescription length] > 0) {
|
|
|
|
|
+ [requestDetailString appendString:rowDescription];
|
|
|
|
|
+ [requestDetailString appendString:@"\n"];
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ [requestDetailString appendString:@"\n\n"];
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ [[UIPasteboard generalPasteboard] setString:requestDetailString];
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
#pragma mark - Table view data source
|
|
#pragma mark - Table view data source
|
|
|
|
|
|
|
|
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
|
|
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
|