2121#import " PDFKBasicPDFViewerSinglePageCollectionView.h"
2222#import < TTOpenInAppActivity/TTOpenInAppActivity.h>
2323
24+
2425@interface PDFKBasicPDFViewer () <UIToolbarDelegate, UIDocumentInteractionControllerDelegate, PDFKPageScrubberDelegate, UIGestureRecognizerDelegate, PDFKBasicPDFViewerThumbsCollectionViewDelegate, PDFKBasicPDFViewerSinglePageCollectionViewDelegate>
2526
26- /* *
27- The toolbar displaied at the top of the screen.
28- */
29- @property (nonatomic , retain ) UIToolbar *navigationToolbar;
30- /* *
31- The slider at the bottom of the screen to show the thumbnails.
32- */
33- @property (nonatomic , retain ) UIToolbar *thumbnailSlider;
34- /* *
35- The popover controller to share the document on the iPad.
36- */
37- @property (nonatomic , strong ) UIPopoverController *activityPopoverController;
38- /* *
39- The share button.
40- */
41- @property (nonatomic , strong ) UIBarButtonItem *shareItem;
42- /* *
43- The item that notes wether or not the page is bookmarked.
44- */
45- @property (nonatomic , strong ) UIBarButtonItem *bookmarkItem;
46- /* *
47- The page scrubber at the bottom of the view.
48- */
49- @property (nonatomic , strong ) PDFKPageScrubber *pageScrubber;
50- /* *
51- The collection view of single pages to display.
52- */
53- @property (nonatomic , strong ) PDFKBasicPDFViewerSinglePageCollectionView *pageCollectionView;
54- /* *
55- Wether or not the view is showing a single page.
56- */
57- @property (nonatomic , assign ) BOOL showingSinglePage;
58- /* *
59- The collection view that displays all the thumbs.
60- */
61- @property (nonatomic , strong ) PDFKBasicPDFViewerThumbsCollectionView *thumbsCollectionView;
62- /* *
63- Wether or not the thumbs collection view is showing thumbs.
64- */
65- @property (nonatomic , assign ) BOOL showingBookmarks;
66- /* *
67- YES once view did load called.
68- */
69- @property (nonatomic , assign ) BOOL loadedView;
27+ @property (nonatomic , retain , readwrite ) UIToolbar *navigationToolbar;
28+ @property (nonatomic , retain , readwrite ) UIToolbar *thumbnailSlider;
29+ @property (nonatomic , strong , readwrite ) UIPopoverController *activityPopoverController;
30+ @property (nonatomic , strong , readwrite ) UIBarButtonItem *shareItem;
31+ @property (nonatomic , strong , readwrite ) UIBarButtonItem *bookmarkItem;
32+ @property (nonatomic , strong , readwrite ) PDFKPageScrubber *pageScrubber;
33+ @property (nonatomic , strong , readwrite ) PDFKBasicPDFViewerSinglePageCollectionView *pageCollectionView;
34+ @property (nonatomic , assign , readwrite ) BOOL showingSinglePage;
35+ @property (nonatomic , strong , readwrite ) PDFKBasicPDFViewerThumbsCollectionView *thumbsCollectionView;
36+ @property (nonatomic , assign , readwrite ) BOOL showingBookmarks;
37+ @property (nonatomic , assign , readwrite ) BOOL loadedView;
7038
7139@property (nonatomic , strong ) UITapGestureRecognizer *singleTapGestureRecognizer;
7240@property (nonatomic , strong ) UITapGestureRecognizer *doubleTapGestureRecognizer;
7341
7442@end
7543
44+
7645@implementation PDFKBasicPDFViewer
7746
7847#pragma mark - Initalization and Loading
@@ -290,15 +259,6 @@ - (void)resetNavigationToolbar
290259 UIBarButtonItem *listItem = [[UIBarButtonItem alloc ] initWithImage: [UIImage imageNamed: @" Thumbs" ] landscapeImagePhone: [UIImage imageNamed: @" Thumbs" ] style: UIBarButtonItemStylePlain target: self action: @selector (list )];
291260 [buttonsArray addObject: listItem];
292261
293- // Sharing Button
294- if (_enableSharing || _enablePrinting || _enableOpening) {
295- UIBarButtonItem *space = [[UIBarButtonItem alloc ] initWithBarButtonSystemItem: UIBarButtonSystemItemFixedSpace target: nil action: nil ];
296- space.width = 10.0 ;
297- [buttonsArray addObject: space];
298- _shareItem = [[UIBarButtonItem alloc ] initWithBarButtonSystemItem: UIBarButtonSystemItemAction target: self action: @selector (send )];
299- [buttonsArray addObject: _shareItem];
300- }
301-
302262 // Flexible space
303263 [buttonsArray addObject: [[UIBarButtonItem alloc ] initWithBarButtonSystemItem: UIBarButtonSystemItemFlexibleSpace target: nil action: nil ]];
304264
@@ -318,6 +278,15 @@ - (void)resetNavigationToolbar
318278
319279 [buttonsArray addObject: _bookmarkItem];
320280 }
281+
282+ // Sharing Button
283+ if (_enableSharing || _enablePrinting || _enableOpening) {
284+ UIBarButtonItem *space = [[UIBarButtonItem alloc ] initWithBarButtonSystemItem: UIBarButtonSystemItemFixedSpace target: nil action: nil ];
285+ space.width = 10.0 ;
286+ [buttonsArray addObject: space];
287+ _shareItem = [[UIBarButtonItem alloc ] initWithBarButtonSystemItem: UIBarButtonSystemItemAction target: self action: @selector (send )];
288+ [buttonsArray addObject: _shareItem];
289+ }
321290 } else {
322291
323292 // Set controls for thumbs
@@ -335,7 +304,10 @@ - (void)resetNavigationToolbar
335304 }
336305
337306 // Go back
338- UIBarButtonItem *listItem = [[UIBarButtonItem alloc ] initWithTitle: @" Resume" style: UIBarButtonItemStylePlain target: self action: @selector (list )];
307+ if (!self.backButtonTitle ) {
308+ self.backButtonTitle = @" Resume" ;
309+ }
310+ UIBarButtonItem *listItem = [[UIBarButtonItem alloc ] initWithTitle: self .backButtonTitle style: UIBarButtonItemStylePlain target: self action: @selector (list )];
339311 [buttonsArray addObject: listItem];
340312
341313 // Flexible space
0 commit comments