forked from IdeasOnCanvas/Ashton
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathiOSViewController.m
More file actions
25 lines (19 loc) · 850 Bytes
/
iOSViewController.m
File metadata and controls
25 lines (19 loc) · 850 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#import "iOSViewController.h"
#import "iOSAppDelegate.h"
#import "AshtonCoreText.h"
@interface iOSViewController ()
@end
@implementation iOSViewController
- (void)viewWillAppear:(BOOL)animated
{
NSAttributedString *intermediate = ((iOSAppDelegate *)[[UIApplication sharedApplication] delegate]).intermediateAS;
self.coreTextView.attributedString = [[AshtonCoreText sharedInstance] targetRepresentationWithIntermediateRepresentation:intermediate];
[super viewWillAppear:animated];
}
- (void)viewWillDisappear:(BOOL)animated
{
NSAttributedString *intermediate = [[AshtonCoreText sharedInstance] intermediateRepresentationWithTargetRepresentation:self.coreTextView.attributedString];
((iOSAppDelegate *)[[UIApplication sharedApplication] delegate]).intermediateAS = intermediate;
[super viewWillDisappear:animated];
}
@end