diff options
Diffstat (limited to 'example/ios/iOS UI Test/iOS UI Test')
4 files changed, 40 insertions, 5 deletions
diff --git a/example/ios/iOS UI Test/iOS UI Test/MCTTableViewCell.h b/example/ios/iOS UI Test/iOS UI Test/MCTTableViewCell.h new file mode 100644 index 00000000..0d680415 --- /dev/null +++ b/example/ios/iOS UI Test/iOS UI Test/MCTTableViewCell.h @@ -0,0 +1,16 @@ +// +// MCTTableViewCell.h +// iOS UI Test +// +// Created by Paul Young on 14/07/2013. +// Copyright (c) 2013 AppJon. All rights reserved. +// + +#import <UIKit/UIKit.h> +#import <MailCore/MailCore.h> + +@interface MCTTableViewCell : UITableViewCell + +@property (nonatomic, strong) MCOIMAPMessageRenderingOperation * messageRenderingOperation; + +@end diff --git a/example/ios/iOS UI Test/iOS UI Test/MCTTableViewCell.m b/example/ios/iOS UI Test/iOS UI Test/MCTTableViewCell.m new file mode 100644 index 00000000..21d22e38 --- /dev/null +++ b/example/ios/iOS UI Test/iOS UI Test/MCTTableViewCell.m @@ -0,0 +1,13 @@ +// +// MCTTableViewCell.m +// iOS UI Test +// +// Created by Paul Young on 14/07/2013. +// Copyright (c) 2013 AppJon. All rights reserved. +// + +#import "MCTTableViewCell.h" + +@implementation MCTTableViewCell + +@end diff --git a/example/ios/iOS UI Test/iOS UI Test/MasterViewController.m b/example/ios/iOS UI Test/iOS UI Test/MasterViewController.m index 1b2528d1..c05fdd9a 100644 --- a/example/ios/iOS UI Test/iOS UI Test/MasterViewController.m +++ b/example/ios/iOS UI Test/iOS UI Test/MasterViewController.m @@ -11,6 +11,7 @@ #import "FXKeychain.h" #import "MCTMsgViewController.h" #import "GTMOAuth2ViewControllerTouch.h" +#import "MCTTableViewCell.h" #define CLIENT_ID @"the-client-id" #define CLIENT_SECRET @"the-client-secret" @@ -167,15 +168,17 @@ finishedRefreshWithFetcher:(GTMHTTPFetcher *)fetcher } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath]; + MCTTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath]; MCOIMAPMessage *message = self.messages[indexPath.row]; cell.textLabel.text = message.header.subject; - MCOIMAPMessageRenderingOperation * op = [self.imapSession plainTextBodyRenderingOperationWithMessage:message - folder:@"INBOX"]; + [cell.messageRenderingOperation cancel]; - [op start:^(NSString * htmlString, NSError * error) { + cell.messageRenderingOperation = [self.imapSession plainTextBodyRenderingOperationWithMessage:message + folder:@"INBOX"]; + + [cell.messageRenderingOperation start:^(NSString * htmlString, NSError * error) { cell.detailTextLabel.text = htmlString; }]; diff --git a/example/ios/iOS UI Test/iOS UI Test/en.lproj/MainStoryboard.storyboard b/example/ios/iOS UI Test/iOS UI Test/en.lproj/MainStoryboard.storyboard index 91422073..2e9d223f 100644 --- a/example/ios/iOS UI Test/iOS UI Test/en.lproj/MainStoryboard.storyboard +++ b/example/ios/iOS UI Test/iOS UI Test/en.lproj/MainStoryboard.storyboard @@ -30,7 +30,7 @@ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <prototypes> - <tableViewCell contentMode="scaleToFill" selectionStyle="blue" accessoryType="disclosureIndicator" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="Cell" textLabel="phq-AM-6qj" detailTextLabel="uHd-0U-sVX" style="IBUITableViewCellStyleSubtitle" id="lJ0-d7-vTF"> + <tableViewCell contentMode="scaleToFill" selectionStyle="blue" accessoryType="disclosureIndicator" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="Cell" textLabel="phq-AM-6qj" detailTextLabel="uHd-0U-sVX" style="IBUITableViewCellStyleSubtitle" id="lJ0-d7-vTF" customClass="MCTTableViewCell"> <rect key="frame" x="0.0" y="22" width="320" height="44"/> <autoresizingMask key="autoresizingMask"/> <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center"> @@ -75,6 +75,9 @@ </scene> </scenes> <classes> + <class className="MCTTableViewCell" superclassName="UITableViewCell"> + <source key="sourceIdentifier" type="project" relativePath="./Classes/MCTTableViewCell.h"/> + </class> <class className="MasterViewController" superclassName="UITableViewController"> <source key="sourceIdentifier" type="project" relativePath="./Classes/MasterViewController.h"/> <relationships> |