Browse files

v2.7.0

  • Loading branch information...
1 parent 87a138c commit ff5249bd0b577b4b880f0c020c27c7f0b05ac3ea @vfr committed Oct 3, 2013
View
4 Classes/ReaderAppDelegate.m
@@ -1,6 +1,6 @@
//
// ReaderAppDelegate.m
-// Reader v2.6.0
+// Reader v2.7.0
//
// Created by Julius Oklamcak on 2011-07-01.
// Copyright © 2011-2013 Julius Oklamcak. All rights reserved.
@@ -50,7 +50,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
navigationController = [[UINavigationController alloc] initWithRootViewController:readerDemoController];
- mainWindow.backgroundColor = [UIColor scrollViewTexturedBackgroundColor]; // Window background color
+ mainWindow.backgroundColor = [UIColor grayColor]; // Neutral gray window background color
navigationController.navigationBar.barStyle = UIBarStyleBlack; navigationController.navigationBar.translucent = YES;
View
4 Classes/ReaderBookDelegate.m
@@ -1,6 +1,6 @@
//
// ReaderBookDelegate.m
-// Reader v2.6.0
+// Reader v2.7.0
//
// Created by Julius Oklamcak on 2011-09-01.
// Copyright © 2011-2013 Julius Oklamcak. All rights reserved.
@@ -48,7 +48,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
{
mainWindow = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; // Main application window
- mainWindow.backgroundColor = [UIColor scrollViewTexturedBackgroundColor]; // Window background color
+ mainWindow.backgroundColor = [UIColor grayColor]; // Neutral gray window background color
NSString *phrase = nil; // Document password (for unlocking most encrypted PDF files)
View
8 Classes/ReaderDemoController.m
@@ -1,6 +1,6 @@
//
// ReaderDemoController.m
-// Reader v2.6.0
+// Reader v2.7.0
//
// Created by Julius Oklamcak on 2011-07-01.
// Copyright © 2011-2013 Julius Oklamcak. All rights reserved.
@@ -79,7 +79,7 @@ - (void)viewDidLoad
tapLabel.text = @"Tap";
tapLabel.textColor = [UIColor whiteColor];
- tapLabel.textAlignment = UITextAlignmentCenter;
+ tapLabel.textAlignment = NSTextAlignmentCenter;
tapLabel.backgroundColor = [UIColor clearColor];
tapLabel.font = [UIFont systemFontOfSize:24.0f];
tapLabel.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin;
@@ -193,7 +193,7 @@ - (void)handleSingleTap:(UITapGestureRecognizer *)recognizer
readerViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
readerViewController.modalPresentationStyle = UIModalPresentationFullScreen;
- [self presentModalViewController:readerViewController animated:YES];
+ [self presentViewController:readerViewController animated:YES completion:NULL];
#endif // DEMO_VIEW_CONTROLLER_PUSH
}
@@ -209,7 +209,7 @@ - (void)dismissReaderViewController:(ReaderViewController *)viewController
#else // dismiss the modal view controller
- [self dismissModalViewControllerAnimated:YES];
+ [self dismissViewControllerAnimated:YES completion:NULL];
#endif // DEMO_VIEW_CONTROLLER_PUSH
}
View
BIN Graphics/AppIcon-076.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN Graphics/AppIcon-114.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN Graphics/AppIcon-120.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN Graphics/AppIcon-144.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN Graphics/AppIcon-152.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
4 HISTORY.md
@@ -1,6 +1,10 @@
## History
+2013-10-03: Version 2.7.0
+
+ - iOS 7 and Xcode 5.0 support.
+
2013-06-04: Version 2.6.2
- Touch two UIButton, exclusiveTouch = NO. Not good. Fixed.
View
20 README.md
@@ -9,7 +9,7 @@ screens.
The code is universal and does not require any XIBs (as all UI
elements are code generated, allowing for greatest flexibility).
-It runs on iPad, iPhone and iPod touch with iOS 4.0 and up. Also
+It runs on iPad, iPhone and iPod touch with iOS 6.0 and up. Also
supported are the Retina displays in all new devices and is ready
to be fully internationalized. The idea was to provide a complete
project template that you could start building from, or, just pull
@@ -32,7 +32,7 @@ This implementation has been tested with large PDF files (over
250MB in size and over 2800 pages in length) and with PDF files of
all flavors (from text only documents to graphics heavy magazines).
It also works rather well on older devices (such as the iPod touch
-2nd generation and iPhone 3G) and takes advantage of the dual-core
+4th generation and iPhone 3GS) and takes advantage of the dual-core
processor (via CATiledLayer and multi-threading) in new devices.
To see an example open source PDF Viewer App that uses this code
@@ -46,16 +46,21 @@ Multithreaded: The UI is always quite smooth and responsive.
Supports:
- iBooks-like document navigation.
- - Device rotation and all orientations.¹
+ - Device rotation and all orientations.
- Encrypted (password protected) PDFs.
- PDF links (URI and go to page).
- PDFs with rotated pages.
### Notes
+Version 2.x of the PDF reader code was originally developed
+and tested under Xcode 3.2.6, LLVM 1.7 and iOS 4 with current
+development and testing under Xcode 5.0, LLVM 5.0 and iOS 7.
+Please note that as of v2.6, the code was refactored to use ARC.
+
Version 2.x of the PDF reader code was originally developed and
tested under Xcode 3.2.6, LLVM 1.7, iOS 4.3.5 and iOS 4.2.1 with
-current development and testing under Xcode 4.6.2, LLVM 4.2, iOS 6.
+current development and testing under Xcode 5.0, LLVM 5.0, iOS 7.
Please note that as of v2.6, the code was refactored to use ARC.
The overall PDF reader functionality is encapsulated in the
@@ -161,13 +166,6 @@ of the ReaderDocument object for a document is mandatory since this is
where the current page number, bookmarks and directory of the document
page thumb cache is kept.
-### Caveats
-
-¹ There appears to be a bug in iOS 4 with its view controller rotation
-handling when a modal view controller is presented in landscape from a
-modal view controller when the status bar is visible on iPhone and iPod
-touch. The good news is that iOS 5 appears to have fixed this bug.
-
### Contact Info
Website: [http://www.vfr.org/](http://www.vfr.org/)
View
11 Reader-Info.plist
@@ -8,27 +8,30 @@
<string>en</string>
<key>CFBundleIconFiles</key>
<array>
+ <string>AppIcon-152.png</string>
<string>AppIcon-144.png</string>
+ <string>AppIcon-120.png</string>
<string>AppIcon-114.png</string>
+ <string>AppIcon-076.png</string>
<string>AppIcon-072.png</string>
<string>AppIcon-057.png</string>
</array>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>com.example.${PRODUCT_NAME:rfc1034identifier}</string>
- <key>CFBundleName</key>
- <string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>2.6.2</string>
+ <string>2.7.0</string>
<key>CFBundleShortVersionString</key>
- <string>2.6.2</string>
+ <string>2.7.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIPrerenderedIcon</key>
View
79 Reader.xcodeproj/project.pbxproj
@@ -13,6 +13,9 @@
288765FD0DF74451002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765FC0DF74451002DB57D /* CoreGraphics.framework */; };
450A670411D27B9D00014BF5 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 450A670311D27B9D00014BF5 /* QuartzCore.framework */; };
4541A9D8122EA716001A5E60 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 4541A9D7122EA716001A5E60 /* Localizable.strings */; };
+ 4544394817FDD5E700781873 /* AppIcon-076.png in Resources */ = {isa = PBXBuildFile; fileRef = 4544394517FDD5E700781873 /* AppIcon-076.png */; };
+ 4544394917FDD5E700781873 /* AppIcon-120.png in Resources */ = {isa = PBXBuildFile; fileRef = 4544394617FDD5E700781873 /* AppIcon-120.png */; };
+ 4544394A17FDD5E700781873 /* AppIcon-152.png in Resources */ = {isa = PBXBuildFile; fileRef = 4544394717FDD5E700781873 /* AppIcon-152.png */; };
4544D87C1610A3C2003DB132 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4544D87B1610A3C2003DB132 /* Default-568h@2x.png */; };
4555C74C14211A00005F448D /* ReaderBookDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4555C74B14211A00005F448D /* ReaderBookDelegate.m */; };
455C7891142687CA0053D73B /* UIXToolbarView.m in Sources */ = {isa = PBXBuildFile; fileRef = 455C7890142687CA0053D73B /* UIXToolbarView.m */; };
@@ -72,6 +75,9 @@
32CA4F630368D1EE00C91783 /* Reader-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Reader-Prefix.pch"; sourceTree = "<group>"; };
450A670311D27B9D00014BF5 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
4541A9D5122EA686001A5E60 /* en */ = {isa = PBXFileReference; fileEncoding = 10; indentWidth = 4; lastKnownFileType = text.plist.strings; name = en; path = Resources/en.lproj/Localizable.strings; sourceTree = "<group>"; tabWidth = 4; };
+ 4544394517FDD5E700781873 /* AppIcon-076.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "AppIcon-076.png"; path = "Graphics/AppIcon-076.png"; sourceTree = "<group>"; };
+ 4544394617FDD5E700781873 /* AppIcon-120.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "AppIcon-120.png"; path = "Graphics/AppIcon-120.png"; sourceTree = "<group>"; };
+ 4544394717FDD5E700781873 /* AppIcon-152.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "AppIcon-152.png"; path = "Graphics/AppIcon-152.png"; sourceTree = "<group>"; };
4544D87B1610A3C2003DB132 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "Graphics/Default-568h@2x.png"; sourceTree = "<group>"; };
4555C74A14211A00005F448D /* ReaderBookDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReaderBookDelegate.h; sourceTree = "<group>"; };
4555C74B14211A00005F448D /* ReaderBookDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReaderBookDelegate.m; sourceTree = "<group>"; };
@@ -189,9 +195,8 @@
isa = PBXGroup;
children = (
080E96DDFE201D6D7F000001 /* Classes */,
- 45BD5A7C13AE6C3B00D6FE97 /* Sources */,
- 45CED630140BD22A0092F460 /* Support */,
- 29B97315FDCFA39411CA2CEA /* Other Sources */,
+ 45943FC217FDC9ED003CC77A /* Reader */,
+ 29B97315FDCFA39411CA2CEA /* Support Files */,
29B97317FDCFA39411CA2CEA /* Resources */,
450A66D911D27B5800014BF5 /* Graphics */,
29B97323FDCFA39411CA2CEA /* Frameworks */,
@@ -200,23 +205,23 @@
name = CustomTemplate;
sourceTree = "<group>";
};
- 29B97315FDCFA39411CA2CEA /* Other Sources */ = {
+ 29B97315FDCFA39411CA2CEA /* Support Files */ = {
isa = PBXGroup;
children = (
+ 8D1107310486CEB800E47090 /* Reader-Info.plist */,
32CA4F630368D1EE00C91783 /* Reader-Prefix.pch */,
29B97316FDCFA39411CA2CEA /* main.m */,
);
- name = "Other Sources";
+ name = "Support Files";
sourceTree = "<group>";
};
29B97317FDCFA39411CA2CEA /* Resources */ = {
isa = PBXGroup;
children = (
+ 4541A9D7122EA716001A5E60 /* Localizable.strings */,
45AB72DF141FC04B003524C3 /* README.md */,
45D5AD9E1610E66B00706B9A /* HISTORY.md */,
45AB72DD141FC043003524C3 /* LICENSE.md */,
- 8D1107310486CEB800E47090 /* Reader-Info.plist */,
- 4541A9D7122EA716001A5E60 /* Localizable.strings */,
45AB72DB141FC039003524C3 /* Reader.pdf */,
);
name = Resources;
@@ -238,11 +243,39 @@
450A66D911D27B5800014BF5 /* Graphics */ = {
isa = PBXGroup;
children = (
+ 45943FC317FDCA36003CC77A /* App */,
+ 45943FC417FDCA3E003CC77A /* Reader */,
+ );
+ name = Graphics;
+ sourceTree = "<group>";
+ };
+ 45943FC217FDC9ED003CC77A /* Reader */ = {
+ isa = PBXGroup;
+ children = (
+ 45BD5A7C13AE6C3B00D6FE97 /* Sources */,
+ 45CED630140BD22A0092F460 /* Support */,
+ );
+ name = Reader;
+ sourceTree = "<group>";
+ };
+ 45943FC317FDCA36003CC77A /* App */ = {
+ isa = PBXGroup;
+ children = (
45AB72B9141FBFCA003524C3 /* AppIcon-057.png */,
45AB72BA141FBFCA003524C3 /* AppIcon-072.png */,
+ 4544394517FDD5E700781873 /* AppIcon-076.png */,
45AB72BB141FBFCA003524C3 /* AppIcon-114.png */,
+ 4544394617FDD5E700781873 /* AppIcon-120.png */,
4583767E1533B0AC003CD230 /* AppIcon-144.png */,
+ 4544394717FDD5E700781873 /* AppIcon-152.png */,
4544D87B1610A3C2003DB132 /* Default-568h@2x.png */,
+ );
+ name = App;
+ sourceTree = "<group>";
+ };
+ 45943FC417FDCA3E003CC77A /* Reader */ = {
+ isa = PBXGroup;
+ children = (
455C789914268F6A0053D73B /* Reader-Button-H.png */,
455C789A14268F6A0053D73B /* Reader-Button-H@2x.png */,
455C789B14268F6A0053D73B /* Reader-Button-N.png */,
@@ -258,7 +291,7 @@
45AB72C4141FBFCA003524C3 /* Reader-Thumbs.png */,
45AB72C5141FBFCA003524C3 /* Reader-Thumbs@2x.png */,
);
- name = Graphics;
+ name = Reader;
sourceTree = "<group>";
};
45BD5A7C13AE6C3B00D6FE97 /* Sources */ = {
@@ -341,7 +374,7 @@
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 0460;
+ LastUpgradeCheck = 0500;
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Reader" */;
compatibilityVersion = "Xcode 3.2";
@@ -389,8 +422,11 @@
455C789F14268F6A0053D73B /* Reader-Button-N.png in Resources */,
455C78A014268F6A0053D73B /* Reader-Button-N@2x.png in Resources */,
4583767F1533B0AC003CD230 /* AppIcon-144.png in Resources */,
+ 4544394917FDD5E700781873 /* AppIcon-120.png in Resources */,
4544D87C1610A3C2003DB132 /* Default-568h@2x.png in Resources */,
45D5AD9F1610E66B00706B9A /* HISTORY.md in Resources */,
+ 4544394817FDD5E700781873 /* AppIcon-076.png in Resources */,
+ 4544394A17FDD5E700781873 /* AppIcon-152.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -475,8 +511,9 @@
458529CE13DDE2DF00EDC79D /* Testing */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)";
+ CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -485,10 +522,13 @@
GCC_MODEL_TUNING = "";
GCC_PREPROCESSOR_DEFINITIONS = NDEBUG;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 4.3;
+ IPHONEOS_DEPLOYMENT_TARGET = 6.0;
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
@@ -511,8 +551,9 @@
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)";
+ CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -521,10 +562,14 @@
GCC_MODEL_TUNING = "";
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 4.3;
+ IPHONEOS_DEPLOYMENT_TARGET = 6.0;
+ ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
@@ -533,8 +578,9 @@
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)";
+ CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -543,10 +589,13 @@
GCC_MODEL_TUNING = "";
GCC_PREPROCESSOR_DEFINITIONS = NDEBUG;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 4.3;
+ IPHONEOS_DEPLOYMENT_TARGET = 6.0;
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
View
BIN Resources/Reader.pdf
Binary file not shown.
View
BIN Resources/de.lproj/Localizable.strings
Binary file not shown.
View
BIN Resources/en.lproj/Localizable.strings
Binary file not shown.
View
4 Sources/ReaderContentView.m
@@ -153,9 +153,7 @@ - (id)initWithFrame:(CGRect)frame fileURL:(NSURL *)fileURL page:(NSUInteger)page
- (void)dealloc
{
-// [self removeObserver:self forKeyPath:@"frame" context:ReaderContentViewContext];
-
- [self removeObserver:self forKeyPath:@"frame"]; // Maintain iOS 4.x compatability
+ [self removeObserver:self forKeyPath:@"frame" context:ReaderContentViewContext];
}
- (void)showPageThumb:(NSURL *)fileURL page:(NSInteger)page password:(NSString *)phrase guid:(NSString *)guid
View
6 Sources/ReaderMainPagebar.m
@@ -124,7 +124,7 @@ - (void)updatePageNumberText:(NSInteger)page
{
NSInteger pages = [document.pageCount integerValue]; // Total pages
- NSString *format = NSLocalizedString(@"%d of %d", @"format"); // Format
+ NSString *format = NSLocalizedString(@"%i of %i", @"format"); // Format
NSString *number = [NSString stringWithFormat:format, page, pages]; // Text
@@ -179,14 +179,14 @@ - (id)initWithFrame:(CGRect)frame document:(ReaderDocument *)object
pageNumberLabel.autoresizesSubviews = NO;
pageNumberLabel.autoresizingMask = UIViewAutoresizingNone;
- pageNumberLabel.textAlignment = UITextAlignmentCenter;
+ pageNumberLabel.textAlignment = NSTextAlignmentCenter;
pageNumberLabel.backgroundColor = [UIColor clearColor];
pageNumberLabel.textColor = [UIColor whiteColor];
pageNumberLabel.font = [UIFont systemFontOfSize:16.0f];
pageNumberLabel.shadowOffset = CGSizeMake(0.0f, 1.0f);
pageNumberLabel.shadowColor = [UIColor blackColor];
pageNumberLabel.adjustsFontSizeToFitWidth = YES;
- pageNumberLabel.minimumFontSize = 12.0f;
+ pageNumberLabel.minimumScaleFactor = 0.75f;
[pageNumberView addSubview:pageNumberLabel]; // Add label view
View
4 Sources/ReaderMainToolbar.m
@@ -207,7 +207,7 @@ - (id)initWithFrame:(CGRect)frame document:(ReaderDocument *)object
UILabel *titleLabel = [[UILabel alloc] initWithFrame:titleRect];
- titleLabel.textAlignment = UITextAlignmentCenter;
+ titleLabel.textAlignment = NSTextAlignmentCenter;
titleLabel.font = [UIFont systemFontOfSize:19.0f];
titleLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth;
titleLabel.baselineAdjustment = UIBaselineAdjustmentAlignCenters;
@@ -216,7 +216,7 @@ - (id)initWithFrame:(CGRect)frame document:(ReaderDocument *)object
titleLabel.backgroundColor = [UIColor clearColor];
titleLabel.shadowOffset = CGSizeMake(0.0f, 1.0f);
titleLabel.adjustsFontSizeToFitWidth = YES;
- titleLabel.minimumFontSize = 14.0f;
+ titleLabel.minimumScaleFactor = 0.75f;
titleLabel.text = [object.fileName stringByDeletingPathExtension];
[self addSubview:titleLabel];
View
30 Sources/ReaderViewController.m
@@ -65,6 +65,8 @@ @implementation ReaderViewController
#define PAGING_VIEWS 3
+#define STATUS_HEIGHT 20.0f
+
#define TOOLBAR_HEIGHT 44.0f
#define PAGEBAR_HEIGHT 48.0f
@@ -311,10 +313,18 @@ - (void)viewDidLoad
assert(document != nil); // Must have a valid ReaderDocument
- self.view.backgroundColor = [UIColor scrollViewTexturedBackgroundColor];
+ self.view.backgroundColor = [UIColor grayColor]; // Neutral gray
CGRect viewRect = self.view.bounds; // View controller's view bounds
+ if ([self respondsToSelector:@selector(edgesForExtendedLayout)])
+ {
+ if ([self prefersStatusBarHidden] == NO) // Visible status bar
+ {
+ viewRect.origin.y += STATUS_HEIGHT;
+ }
+ }
+
theScrollView = [[UIScrollView alloc] initWithFrame:viewRect]; // All
theScrollView.scrollsToTop = NO;
@@ -431,6 +441,16 @@ - (void)viewDidUnload
[super viewDidUnload];
}
+- (BOOL)prefersStatusBarHidden
+{
+ return YES;
+}
+
+- (UIStatusBarStyle)preferredStatusBarStyle
+{
+ return UIStatusBarStyleLightContent;
+}
+
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
@@ -762,7 +782,7 @@ - (void)tappedInToolbar:(ReaderMainToolbar *)toolbar thumbsButton:(UIButton *)bu
thumbsViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
thumbsViewController.modalPresentationStyle = UIModalPresentationFullScreen;
- [self presentModalViewController:thumbsViewController animated:NO];
+ [self presentViewController:thumbsViewController animated:NO completion:NULL];
}
- (void)tappedInToolbar:(ReaderMainToolbar *)toolbar printButton:(UIButton *)button
@@ -846,7 +866,7 @@ - (void)tappedInToolbar:(ReaderMainToolbar *)toolbar emailButton:(UIButton *)but
mailComposer.mailComposeDelegate = self; // Set the delegate
- [self presentModalViewController:mailComposer animated:YES];
+ [self presentViewController:mailComposer animated:YES completion:NULL];
}
}
@@ -877,7 +897,7 @@ - (void)mailComposeController:(MFMailComposeViewController *)controller didFinis
if ((result == MFMailComposeResultFailed) && (error != NULL)) NSLog(@"%@", error);
#endif
- [self dismissModalViewControllerAnimated:YES]; // Dismiss
+ [self dismissViewControllerAnimated:YES completion:NULL]; // Dismiss
}
#pragma mark ThumbsViewControllerDelegate methods
@@ -886,7 +906,7 @@ - (void)dismissThumbsViewController:(ThumbsViewController *)viewController
{
[self updateToolbarBookmarkIcon]; // Update bookmark icon
- [self dismissModalViewControllerAnimated:NO]; // Dismiss
+ [self dismissViewControllerAnimated:YES completion:NULL]; // Dismiss
}
- (void)thumbsViewController:(ThumbsViewController *)viewController gotoPage:(NSInteger)page
View
8 Sources/ThumbsMainToolbar.m
@@ -90,12 +90,14 @@ - (id)initWithFrame:(CGRect)frame title:(NSString *)title
UIImage *bookmarkImage = [UIImage imageNamed:@"Reader-Mark-Y"];
NSArray *buttonItems = [NSArray arrayWithObjects:thumbsImage, bookmarkImage, nil];
+ BOOL useTint = [self respondsToSelector:@selector(tintColor)]; // iOS 7 and up
+
UISegmentedControl *showControl = [[UISegmentedControl alloc] initWithItems:buttonItems];
showControl.frame = CGRectMake(showControlX, BUTTON_Y, SHOW_CONTROL_WIDTH, BUTTON_HEIGHT);
+ showControl.tintColor = (useTint ? [UIColor blackColor] : [UIColor colorWithWhite:0.8f alpha:1.0f]);
showControl.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
showControl.segmentedControlStyle = UISegmentedControlStyleBar;
- showControl.tintColor = [UIColor colorWithWhite:0.8f alpha:1.0f];
showControl.selectedSegmentIndex = 0; // Default segment index
showControl.exclusiveTouch = YES;
@@ -113,7 +115,7 @@ - (id)initWithFrame:(CGRect)frame title:(NSString *)title
UILabel *titleLabel = [[UILabel alloc] initWithFrame:titleRect];
- titleLabel.textAlignment = UITextAlignmentCenter;
+ titleLabel.textAlignment = NSTextAlignmentCenter;
titleLabel.font = [UIFont systemFontOfSize:19.0f];
titleLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth;
titleLabel.baselineAdjustment = UIBaselineAdjustmentAlignCenters;
@@ -122,7 +124,7 @@ - (id)initWithFrame:(CGRect)frame title:(NSString *)title
titleLabel.backgroundColor = [UIColor clearColor];
titleLabel.shadowOffset = CGSizeMake(0.0f, 1.0f);
titleLabel.adjustsFontSizeToFitWidth = YES;
- titleLabel.minimumFontSize = 14.0f;
+ titleLabel.minimumScaleFactor = 0.75f;
titleLabel.text = title;
[self addSubview:titleLabel];
View
26 Sources/ThumbsViewController.m
@@ -54,6 +54,8 @@ @implementation ThumbsViewController
#pragma mark Constants
+#define STATUS_HEIGHT 20.0f
+
#define TOOLBAR_HEIGHT 44.0f
#define PAGE_THUMB_SMALL 160
@@ -90,10 +92,18 @@ - (void)viewDidLoad
assert(delegate != nil); assert(document != nil);
- self.view.backgroundColor = [UIColor scrollViewTexturedBackgroundColor];
+ self.view.backgroundColor = [UIColor grayColor]; // Neutral gray
CGRect viewRect = self.view.bounds; // View controller's view bounds
+ if ([self respondsToSelector:@selector(edgesForExtendedLayout)])
+ {
+ if ([self prefersStatusBarHidden] == NO) // Visible status bar
+ {
+ viewRect.origin.y += STATUS_HEIGHT;
+ }
+ }
+
NSString *toolbarTitle = [document.fileName stringByDeletingPathExtension];
CGRect toolbarRect = viewRect; toolbarRect.size.height = TOOLBAR_HEIGHT;
@@ -163,6 +173,16 @@ - (void)viewDidUnload
[super viewDidUnload];
}
+- (BOOL)prefersStatusBarHidden
+{
+ return YES;
+}
+
+- (UIStatusBarStyle)preferredStatusBarStyle
+{
+ return UIStatusBarStyleLightContent;
+}
+
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
@@ -259,7 +279,7 @@ - (void)thumbsView:(ReaderThumbsView *)thumbsView updateThumbCell:(ThumbsPageThu
NSInteger page = (showBookmarked ? [[bookmarked objectAtIndex:index] integerValue] : (index + 1));
- [thumbCell showText:[NSString stringWithFormat:@"%d", page]]; // Page number place holder
+ [thumbCell showText:[NSString stringWithFormat:@"%i", page]]; // Page number place holder
[thumbCell showBookmark:[document.bookmarks containsIndex:page]]; // Show bookmarked status
@@ -361,7 +381,7 @@ - (id)initWithFrame:(CGRect)frame
textLabel.userInteractionEnabled = NO;
textLabel.contentMode = UIViewContentModeRedraw;
textLabel.autoresizingMask = UIViewAutoresizingNone;
- textLabel.textAlignment = UITextAlignmentCenter;
+ textLabel.textAlignment = NSTextAlignmentCenter;
textLabel.font = [UIFont systemFontOfSize:fontSize];
textLabel.textColor = [UIColor colorWithWhite:0.24f alpha:1.0f];
textLabel.backgroundColor = [UIColor whiteColor];

0 comments on commit ff5249b

Please sign in to comment.