Skip to content

Commit

Permalink
Fixes #348 - Add support for iPhone
Browse files Browse the repository at this point in the history
  • Loading branch information
pieterclaerhout committed Nov 4, 2014
1 parent 570160e commit ed0bc4d
Show file tree
Hide file tree
Showing 56 changed files with 1,255 additions and 1,073 deletions.
20 changes: 16 additions & 4 deletions Baker.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
BF0785EB1794AF4000EB988E /* info in Resources */ = {isa = PBXBuildFile; fileRef = BF0785EA1794AF4000EB988E /* info */; };
BF78D1B0180C8F070093DFBC /* BakerAssets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BF78D1AF180C8F070093DFBC /* BakerAssets.xcassets */; };
BFAB78D317B2A67E00E91ADE /* BakerAnalyticsEvents.m in Sources */ = {isa = PBXBuildFile; fileRef = BFAB78D217B2A67E00E91ADE /* BakerAnalyticsEvents.m */; };
C649F0981A090B6000B02548 /* BKRShelfHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = C649F0971A090B6000B02548 /* BKRShelfHeaderView.m */; };
C649F09B1A0912F500B02548 /* UIScreen+BakerExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = C649F09A1A0912F500B02548 /* UIScreen+BakerExtensions.m */; };
C66857A01A07D38300776443 /* NSString+Extensions.m in Sources */ = {isa = PBXBuildFile; fileRef = C668579D1A07D38300776443 /* NSString+Extensions.m */; };
C66857A11A07D38300776443 /* UIColor+Extensions.m in Sources */ = {isa = PBXBuildFile; fileRef = C668579F1A07D38300776443 /* UIColor+Extensions.m */; };
C66857A41A07DDBE00776443 /* NSObject+Extensions.m in Sources */ = {isa = PBXBuildFile; fileRef = C66857A31A07DDBE00776443 /* NSObject+Extensions.m */; };
Expand Down Expand Up @@ -142,6 +144,10 @@
BF78D1AF180C8F070093DFBC /* BakerAssets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = BakerAssets.xcassets; path = Baker/BakerAssets.xcassets; sourceTree = "<group>"; };
BFAB78D117B2A67E00E91ADE /* BakerAnalyticsEvents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BakerAnalyticsEvents.h; sourceTree = "<group>"; };
BFAB78D217B2A67E00E91ADE /* BakerAnalyticsEvents.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BakerAnalyticsEvents.m; sourceTree = "<group>"; };
C649F0961A090B6000B02548 /* BKRShelfHeaderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BKRShelfHeaderView.h; sourceTree = "<group>"; };
C649F0971A090B6000B02548 /* BKRShelfHeaderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BKRShelfHeaderView.m; sourceTree = "<group>"; };
C649F0991A0912F500B02548 /* UIScreen+BakerExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIScreen+BakerExtensions.h"; sourceTree = "<group>"; };
C649F09A1A0912F500B02548 /* UIScreen+BakerExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIScreen+BakerExtensions.m"; sourceTree = "<group>"; };
C668579B1A07D27C00776443 /* UIConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIConstants.h; sourceTree = "<group>"; };
C668579C1A07D38300776443 /* NSString+Extensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+Extensions.h"; sourceTree = "<group>"; };
C668579D1A07D38300776443 /* NSString+Extensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+Extensions.m"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -245,6 +251,8 @@
C668579F1A07D38300776443 /* UIColor+Extensions.m */,
AB40044A15B4B83000D87E2A /* Utils.h */,
AB40044B15B4B83000D87E2A /* Utils.m */,
C649F0991A0912F500B02548 /* UIScreen+BakerExtensions.h */,
C649F09A1A0912F500B02548 /* UIScreen+BakerExtensions.m */,
);
path = lib;
sourceTree = "<group>";
Expand Down Expand Up @@ -299,6 +307,8 @@
9F58D85015D66E870027902C /* UICustomNavigationController.m */,
ABF23B1B1708418E003AA3B0 /* BakerAPI.h */,
ABF23B1C1708418E003AA3B0 /* BakerAPI.m */,
C649F0961A090B6000B02548 /* BKRShelfHeaderView.h */,
C649F0971A090B6000B02548 /* BKRShelfHeaderView.m */,
);
path = BakerShelf;
sourceTree = "<group>";
Expand Down Expand Up @@ -440,6 +450,7 @@
C66857A41A07DDBE00776443 /* NSObject+Extensions.m in Sources */,
AB40046D15B4B83000D87E2A /* zip.c in Sources */,
AB40046F15B4B83000D87E2A /* SSZipArchive.m in Sources */,
C649F0981A090B6000B02548 /* BKRShelfHeaderView.m in Sources */,
AB40047115B4B83000D87E2A /* Utils.m in Sources */,
C66857A01A07D38300776443 /* NSString+Extensions.m in Sources */,
C66857A11A07D38300776443 /* UIColor+Extensions.m in Sources */,
Expand All @@ -456,6 +467,7 @@
ABD6FC4016544EAD0032BC44 /* NSData+Base64.m in Sources */,
AB2317D4169F808000BE3BE7 /* PurchasesManager.m in Sources */,
ABDC05AF16A4C42A00F6B63D /* JSONStatus.m in Sources */,
C649F09B1A0912F500B02548 /* UIScreen+BakerExtensions.m in Sources */,
ABDC05B216A4CB3900F6B63D /* ShelfStatus.m in Sources */,
AB246A3116C5BC6E00715E25 /* NSMutableURLRequest+WebServiceClient.m in Sources */,
ABBFD8F216C6614300BA64A4 /* NSString+UUID.m in Sources */,
Expand Down Expand Up @@ -555,9 +567,9 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Baker/Baker-Prefix.pch";
INFOPLIST_FILE = "Baker/Baker-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = 2;
TARGETED_DEVICE_FAMILY = "1,2";
WRAPPER_EXTENSION = app;
};
name = Debug;
Expand All @@ -571,9 +583,9 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Baker/Baker-Prefix.pch";
INFOPLIST_FILE = "Baker/Baker-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = 2;
TARGETED_DEVICE_FAMILY = "1,2";
WRAPPER_EXTENSION = app;
};
name = Release;
Expand Down
18 changes: 4 additions & 14 deletions Baker/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -135,21 +135,11 @@ - (void)configureStandAloneApp:(UIApplication*)application options:(NSDictionary
}

- (void)configureNavigationBar {

UICustomNavigationBar *navigationBar = (UICustomNavigationBar*)self.rootNavigationController.navigationBar;
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0")) {
// Background is 64px high: in iOS7, it will be used as the background for the status bar as well.
navigationBar.tintColor = [UIColor colorWithHexString:ISSUES_ACTION_BUTTON_BACKGROUND_COLOR];
navigationBar.barTintColor = [UIColor colorWithHexString:@"ffffff"];
[navigationBar setBackgroundImage:[UIImage imageNamed:@"navigation-bar-bg"] forBarMetrics:UIBarMetricsDefault];
navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName: [UIColor colorWithHexString:@"000000"]};
} else {
// Background is 44px: in iOS6 and below, a higher background image would make the navigation bar
// appear higher than it should be.
[navigationBar setBackgroundImage:[UIImage imageNamed:@"navigation-bar-bg-ios6"] forBarMetrics:UIBarMetricsDefault];
navigationBar.tintColor = [UIColor colorWithHexString:@"333333"]; // black will not trigger a pushed status
}

navigationBar.tintColor = [UIColor colorWithHexString:ISSUES_ACTION_BUTTON_BACKGROUND_COLOR];
navigationBar.barTintColor = [UIColor colorWithHexString:@"ffffff"];
navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName: [UIColor colorWithHexString:@"000000"]};
[navigationBar setBackgroundImage:[UIImage imageNamed:@"navigation-bar-bg"] forBarMetrics:UIBarMetricsDefault];
}

- (void)configureAnalytics {
Expand Down
6 changes: 4 additions & 2 deletions Baker/Baker-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>4.2.1</string>
<string>4.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>4.2.1</string>
<string>4.3</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIBackgroundModes</key>
Expand All @@ -49,6 +49,8 @@
<array>
<string>armv7</string>
</array>
<key>UIStatusBarHidden</key>
<true/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
Expand Down
3 changes: 2 additions & 1 deletion Baker/BakerAssets.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"idiom" : "iphone",
"filename" : "[email protected]",
"scale" : "3x"
},
{
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions Baker/BakerAssets.xcassets/LaunchImage.launchimage/Contents.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
{
"images" : [
{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "736h",
"filename" : "iPhone-Portrait-iOS7-R55.png",
"minimum-system-version" : "8.0",
"orientation" : "portrait",
"scale" : "3x"
},
{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "736h",
"filename" : "iPhone-Landscape-iOS7-R55.png",
"minimum-system-version" : "8.0",
"orientation" : "landscape",
"scale" : "3x"
},
{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "667h",
"filename" : "iPhone-Portrait-iOS7-R47.png",
"minimum-system-version" : "8.0",
"orientation" : "portrait",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
23 changes: 23 additions & 0 deletions Baker/BakerAssets.xcassets/shelf-header.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "shelf-header.png"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "[email protected]"
},
{
"idiom" : "universal",
"scale" : "3x",
"filename" : "[email protected]"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions BakerShelf/BKRShelfHeaderView.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
//
// BakerAPI.h
// Baker
//
// ==========================================================================================
//
// Copyright (c) 2014, Pieter Claerhout
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met:
//
// Redistributions of source code must retain the above copyright notice, this list of
// conditions and the following disclaimer.
// Redistributions in binary form must reproduce the above copyright notice, this list of
// conditions and the following disclaimer in the documentation and/or other materials
// provided with the distribution.
// Neither the name of the Baker Framework nor the names of its contributors may be used to
// endorse or promote products derived from this software without specific prior written
// permission.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
// SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//

#import <UIKit/UIKit.h>

@interface BKRShelfHeaderView : UICollectionReusableView

@property (nonatomic, strong) UIImageView *headerImage;

@end
51 changes: 51 additions & 0 deletions BakerShelf/BKRShelfHeaderView.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
//
// BakerAPI.h
// Baker
//
// ==========================================================================================
//
// Copyright (c) 2014, Pieter Claerhout
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met:
//
// Redistributions of source code must retain the above copyright notice, this list of
// conditions and the following disclaimer.
// Redistributions in binary form must reproduce the above copyright notice, this list of
// conditions and the following disclaimer in the documentation and/or other materials
// provided with the distribution.
// Neither the name of the Baker Framework nor the names of its contributors may be used to
// endorse or promote products derived from this software without specific prior written
// permission.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
// SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//

#import "BKRShelfHeaderView.h"

@implementation BKRShelfHeaderView

- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {

_headerImage = [[UIImageView alloc] initWithFrame:self.frame];
_headerImage.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth;
_headerImage.contentMode = UIViewContentModeScaleAspectFit;
_headerImage.image = [UIImage imageNamed:@"shelf-header"];

[self addSubview:_headerImage];

}
return self;
}

@end
4 changes: 2 additions & 2 deletions BakerShelf/BakerAPI.m
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ - (NSData*)getFromURL:(NSURL*)url cachePolicy:(NSURLRequestCachePolicy)cachePoli
}

- (NSURL*)replaceParameters:(NSMutableDictionary*)parameters inURL:(NSURL*)url {
__weak NSMutableString *urlString = [NSMutableString stringWithString:[url absoluteString]];
NSMutableString *urlString = [NSMutableString stringWithString:[url absoluteString]];
NSDictionary *allParameters = [NSDictionary dictionaryWithDictionary:parameters];
[allParameters enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
NSString *keyToReplace = [@":" stringByAppendingString:key];
Expand All @@ -245,7 +245,7 @@ - (NSURL*)replaceParameters:(NSMutableDictionary*)parameters inURL:(NSURL*)url {
}

- (NSString*)queryStringFromParameters:(NSDictionary*)parameters {
__weak NSMutableString *queryString = [NSMutableString stringWithString:@""];
NSMutableString *queryString = [NSMutableString stringWithString:@""];
if ([parameters count] > 0) {
[parameters enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
NSString *queryParameter = [NSString stringWithFormat:@"%@=%@&", key, obj];
Expand Down
2 changes: 1 addition & 1 deletion BakerShelf/IssueViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ typedef struct {
#pragma mark - Helper methods
+ (UI)getIssueContentMeasures;
+ (int)getIssueCellHeight;
+ (CGSize)getIssueCellSize;
+ (CGSize)getIssueCellSizeForOrientation:(UIInterfaceOrientation)orientation;

@end

Expand Down
Loading

0 comments on commit ed0bc4d

Please sign in to comment.