Added VC to the AppDelegate

This commit is contained in:
Kyle Fang
2013-02-25 21:53:21 +08:00
parent 097da88e5c
commit 59dfbc4d74
8 changed files with 365 additions and 9 deletions

View File

@@ -13,6 +13,8 @@
044C661516AFE28100F9BC1E /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 044C661416AFE28100F9BC1E /* Icon@2x.png */; };
044C661816AFE29F00F9BC1E /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 044C661716AFE29F00F9BC1E /* Icon.png */; };
0486284C16B000D700F62384 /* Progress.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 0486284A16B000D700F62384 /* Progress.xcdatamodeld */; };
048D433D16DB9BA400A40CB1 /* Progress.nss in Resources */ = {isa = PBXBuildFile; fileRef = 048D433C16DB9BA400A40CB1 /* Progress.nss */; };
048D434016DB9D5400A40CB1 /* PPRemindersViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 048D433F16DB9D5400A40CB1 /* PPRemindersViewController.m */; };
04BDDEC516902D0900D04A9E /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 04BDDEC416902D0900D04A9E /* UIKit.framework */; };
04BDDEC716902D0900D04A9E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 04BDDEC616902D0900D04A9E /* Foundation.framework */; };
04BDDEC916902D0900D04A9E /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 04BDDEC816902D0900D04A9E /* CoreGraphics.framework */; };
@@ -54,6 +56,9 @@
044C661416AFE28100F9BC1E /* Icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Icon@2x.png"; path = "../Icon@2x.png"; sourceTree = "<group>"; };
044C661716AFE29F00F9BC1E /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Icon.png; path = ../Icon.png; sourceTree = "<group>"; };
0486284B16B000D700F62384 /* Progress.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Progress.xcdatamodel; sourceTree = "<group>"; };
048D433C16DB9BA400A40CB1 /* Progress.nss */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Progress.nss; sourceTree = "<group>"; };
048D433E16DB9D5300A40CB1 /* PPRemindersViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PPRemindersViewController.h; sourceTree = "<group>"; };
048D433F16DB9D5400A40CB1 /* PPRemindersViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PPRemindersViewController.m; sourceTree = "<group>"; };
04BDDEC016902D0900D04A9E /* Progress.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Progress.app; sourceTree = BUILT_PRODUCTS_DIR; };
04BDDEC416902D0900D04A9E /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
04BDDEC616902D0900D04A9E /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
@@ -153,6 +158,8 @@
04BDDECA16902D0900D04A9E /* Progress */ = {
isa = PBXGroup;
children = (
048D433E16DB9D5300A40CB1 /* PPRemindersViewController.h */,
048D433F16DB9D5400A40CB1 /* PPRemindersViewController.m */,
04FD824516DB02910028AF2A /* GVUserDefaults+Progress.h */,
04FD824616DB02910028AF2A /* GVUserDefaults+Progress.m */,
04FD824016DAFB770028AF2A /* PPEvenKitManager.h */,
@@ -177,6 +184,7 @@
04BDDECC16902D0900D04A9E /* Progress-Info.plist */,
04BDDECD16902D0900D04A9E /* InfoPlist.strings */,
04BDDED016902D0900D04A9E /* main.m */,
048D433C16DB9BA400A40CB1 /* Progress.nss */,
04BDDED216902D0900D04A9E /* Progress-Prefix.pch */,
04BDDED616902D0900D04A9E /* Default.png */,
04BDDED816902D0900D04A9E /* Default@2x.png */,
@@ -287,6 +295,7 @@
04BDDEDE16902D0900D04A9E /* Progress.storyboard in Resources */,
044C661516AFE28100F9BC1E /* Icon@2x.png in Resources */,
044C661816AFE29F00F9BC1E /* Icon.png in Resources */,
048D433D16DB9BA400A40CB1 /* Progress.nss in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -355,6 +364,7 @@
0486284C16B000D700F62384 /* Progress.xcdatamodeld in Sources */,
04FD824216DAFB770028AF2A /* PPEvenKitManager.m in Sources */,
04FD824716DB02910028AF2A /* GVUserDefaults+Progress.m in Sources */,
048D434016DB9D5400A40CB1 /* PPRemindersViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

View File

@@ -31,9 +31,13 @@
[[GAI sharedInstance] trackerWithTrackingId:@"UA-37324298-1"];
[[PPEvenKitManager sharedManager] setupEventManagerWithCompletionBlock:^(BOOL success) {
UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"Progress" bundle:nil];
if (success) {
NSLog(@"success");
UIViewController *reminedrsVC = [storyBoard instantiateViewControllerWithIdentifier:@"Reminders"];
self.window.rootViewController = reminedrsVC;
} else {
UIViewController *accessDenyVC = [storyBoard instantiateViewControllerWithIdentifier:@"AccessDeny"];
self.window.rootViewController = accessDenyVC;
NSLog(@"failed");
}
}];

View File

@@ -0,0 +1,13 @@
//
// PPRemindersViewController.h
// Progress
//
// Created by Kyle Fang on 2/25/13.
// Copyright (c) 2013 kylefang. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface PPRemindersViewController : UITableViewController
@end

View File

@@ -0,0 +1,125 @@
//
// PPRemindersViewController.m
// Progress
//
// Created by Kyle Fang on 2/25/13.
// Copyright (c) 2013 kylefang. All rights reserved.
//
#import "PPRemindersViewController.h"
#import "PPEvenKitManager.h"
#import <SVProgressHUD/SVProgressHUD.h>
@interface PPRemindersViewController ()
@property (nonatomic) NSArray *remindersDatasource;
@end
@implementation PPRemindersViewController
- (id)initWithStyle:(UITableViewStyle)style
{
self = [super initWithStyle:style];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
self.clearsSelectionOnViewWillAppear = NO;
self.navigationController.navigationBarHidden = YES;
}
- (void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
[SVProgressHUD show];
NSString *defaultReminderIdentifier = [[PPEvenKitManager sharedManager] defaultReminderListIdentifier];
[[PPEvenKitManager sharedManager] getReminderItemsInListWithIdentifier:defaultReminderIdentifier includeCompleted:YES includeImcompleted:YES withCompletionBlock:^(NSArray *reminedrItems) {
self.remindersDatasource = reminedrItems;
[self.tableView reloadData];
[SVProgressHUD dismiss];
}];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark - Table view data source
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return self.remindersDatasource.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"ReminderCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
EKReminder *reminder = [self.remindersDatasource objectAtIndex:indexPath.row];
cell.textLabel.text = reminder.title;
cell.accessoryType = reminder.completed ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone;
return cell;
}
/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
// Return NO if you do not want the specified item to be editable.
return YES;
}
*/
/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (editingStyle == UITableViewCellEditingStyleDelete) {
// Delete the row from the data source
[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
}
else if (editingStyle == UITableViewCellEditingStyleInsert) {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
}
}
*/
/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
{
}
*/
/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
{
// Return NO if you do not want the item to be re-orderable.
return YES;
}
*/
#pragma mark - Table view delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
// Navigation logic may go here. Create and push another view controller.
/*
<#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:@"<#Nib name#>" bundle:nil];
// ...
// Pass the selected object to the new view controller.
[self.navigationController pushViewController:detailViewController animated:YES];
*/
}
@end

View File

@@ -45,6 +45,8 @@
<array>
<string>armv7</string>
</array>
<key>UIStatusBarHidden</key>
<true/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>

127
Progress/Progress.nss Normal file
View File

@@ -0,0 +1,127 @@
@primaryFontName: AppleGothic;
@secondaryFontName: HelveticaNeue-Light;
@secondaryFontNameBold: HelveticaNeue;
@secondaryFontNameStrong: HelveticaNeue-Medium;
@inputFontName: HelveticaNeue;
@primaryFontColor: #555555;
@secondaryFontColor: #888888;
@primaryBackgroundColor: #E6E6E6;
@primaryBackgroundTintColor: #ECECEC;
@primaryBackgroundColorTop: #F3F3F3;
@primaryBackgroundColorBottom: #E6E6E6;
@primaryBackgroundColorBottomStrong: #DDDDDD;
@secondaryBackgroundColorTop: #FCFCFC;
@secondaryBackgroundColorBottom: #F9F9F9;
@primaryBorderColor: #A2A2A2;
@primaryBorderWidth: 1;
BarButton {
background-color: @primaryBackgroundColor;
background-color-highlighted: #CCCCCC;
border-color: @primaryBorderColor;
border-width: @primaryBorderWidth;
corner-radius: 7;
font-name: @secondaryFontNameBold;
font-color: @primaryFontColor;
font-color-disabled: @secondaryFontColor;
font-size: 13;
text-shadow-color: clear;
}
CustomButton {
background-color-top: #FFFFFF;
background-color-bottom: @primaryBackgroundColorBottom;
border-color: @primaryBorderColor;
border-width: @primaryBorderWidth;
font-color: @primaryFontColor;
font-color-highlighted: @secondaryFontColor;
font-name: @secondaryFontName;
font-size: 18;
height: 37;
corner-radius: 7;
}
LargeButton {
height: 50;
font-size: 20;
corner-radius: 10;
}
SmallButton {
height: 24;
font-size: 14;
corner-radius: 5;
}
Label {
font-name: @secondaryFontName;
font-size: 20;
font-color: @primaryFontColor;
text-auto-fit: false;
}
LargeLabel {
font-size: 24;
}
SmallLabel {
font-size: 15;
}
NavigationBar {
font-name: @secondaryFontName;
font-size: 20;
font-color: @primaryFontColor;
text-shadow-color: clear;
background-color-top: @primaryBackgroundColorTop;
background-color-bottom: @primaryBackgroundColorBottomStrong;
}
SearchBar {
background-color-top: @primaryBackgroundColorTop;
background-color-bottom: @primaryBackgroundColorBottom;
scope-background-color: #FFFFFF;
}
SegmentedControl {
background-color: @primaryBackgroundColorTop;
background-color-selected: @primaryBackgroundColorBottomStrong;
border-color: @primaryBorderColor;
border-width: @primaryBorderWidth;
corner-radius: 7;
font-name: @secondaryFontNameBold;
font-size: 13;
font-color: @primaryFontColor;
text-shadow-color: clear;
}
Switch {
on-tint-color: @primaryBackgroundTintColor;
}
TabBar {
background-color-top: @primaryBackgroundColorTop;
background-color-bottom: @primaryBackgroundColorBottom;
}
TabBarItem {
font-name: @secondaryFontName;
font-color: @primaryFontColor;
font-size: 18;
text-offset: 0,-11;
}
TableCell {
background-color-top: @secondaryBackgroundColorTop;
background-color-bottom: @secondaryBackgroundColorBottom;
font-color: @primaryFontColor;
font-name: @secondaryFontNameBold;
font-size: 17;
}
TableCellDetail {
font-name: @secondaryFontName;
font-size: 14;
font-color: @secondaryFontColor;
}
TextField {
height: 37;
font-name: @inputFontName;
font-size: 18;
border-style: rounded;
vertical-align: center;
}
LargeTextField {
height: 50;
font-size: 28;
}
CustomView {
background-color: @primaryBackgroundColor;
background-image: NUIViewBackground.png;
}

View File

@@ -9,24 +9,99 @@
<objects>
<viewController id="2" customClass="PPViewController" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="3">
<rect key="frame" x="0.0" y="20" width="320" height="548"/>
<rect key="frame" x="0.0" y="20" width="320" height="460"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="nuiClass" value="CustomView"/>
</userDefinedRuntimeAttributes>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="4" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="276" y="121"/>
</scene>
<!--Reminders View Controller-->
<scene sceneID="dQL-Kn-9WR">
<objects>
<tableViewController storyboardIdentifier="Reminders" useStoryboardIdentifierAsRestorationIdentifier="YES" id="1MC-Iw-JPa" customClass="PPRemindersViewController" sceneMemberID="viewController">
<tableView key="view" opaque="NO" clipsSubviews="YES" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" rowHeight="80" sectionHeaderHeight="22" sectionFooterHeight="22" id="xuY-dO-CUX">
<rect key="frame" x="0.0" y="20" width="320" height="460"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes>
<tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="ReminderCell" textLabel="Gi2-2j-rob" style="IBUITableViewCellStyleDefault" id="dwc-W6-Rod">
<rect key="frame" x="0.0" y="22" width="320" height="80"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="320" height="79"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="left" text="Title" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="300" translatesAutoresizingMaskIntoConstraints="NO" id="Gi2-2j-rob">
<fontDescription key="fontDescription" type="boldSystem" pointSize="20"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<color key="highlightedColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
</tableViewCell>
</prototypes>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="nuiClass" value="CustomView"/>
</userDefinedRuntimeAttributes>
<connections>
<outlet property="dataSource" destination="1MC-Iw-JPa" id="kMd-Lv-BMh"/>
<outlet property="delegate" destination="1MC-Iw-JPa" id="ZyO-r5-k8M"/>
</connections>
</tableView>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="UnO-Gb-ptI" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="652" y="122"/>
</scene>
<!--View Controller-->
<scene sceneID="sC8-Wa-VaP">
<objects>
<viewController storyboardIdentifier="AccessDeny" id="reU-lE-hPA" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="76W-GU-YDp">
<rect key="frame" x="0.0" y="20" width="320" height="460"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" usesAttributedText="YES" lineBreakMode="tailTruncation" numberOfLines="3" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="228" translatesAutoresizingMaskIntoConstraints="NO" id="2hz-Hq-due">
<constraints>
<constraint firstAttribute="width" constant="228" id="Sqd-DP-fcm"/>
<constraint firstAttribute="height" constant="211" id="Vu1-4N-kvM"/>
</constraints>
<attributedString key="attributedText">
<fragment content="Give me access, Goddamn it">
<attributes>
<font key="NSFont" size="18" name="LucidaGrande"/>
<paragraphStyle key="NSParagraphStyle" alignment="center" lineBreakMode="wordWrapping" baseWritingDirection="natural"/>
</attributes>
</fragment>
</attributedString>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="2hz-Hq-due" firstAttribute="top" secondItem="76W-GU-YDp" secondAttribute="top" constant="124" id="SE4-4r-hZS"/>
<constraint firstItem="2hz-Hq-due" firstAttribute="centerX" secondItem="76W-GU-YDp" secondAttribute="centerX" type="default" id="Zp9-MR-3ut"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="nuiClass" value="CustomView"/>
</userDefinedRuntimeAttributes>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="avM-jj-Z7e" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="652" y="726"/>
</scene>
</scenes>
<classes>
<class className="PPViewController" superclassName="UIViewController">
<source key="sourceIdentifier" type="project" relativePath="./Classes/PPViewController.h"/>
</class>
</classes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
<simulatedScreenMetrics key="destination"/>
</simulatedMetricsContainer>
</document>

View File

@@ -13,7 +13,7 @@
int main(int argc, char *argv[])
{
@autoreleasepool {
[NUISettings init];
[NUISettings initWithStylesheet:@"Progress"];
return UIApplicationMain(argc, argv, nil, NSStringFromClass([PPAppDelegate class]));
}
}