Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add today tshirt view controller to iPhone stotoryboard

  • Loading branch information...
commit d53465f986a1e04da31f679a322c3ff7505636a1 1 parent b8371d9
@vtourraine vtourraine authored
View
8 client-ios/MyTee/Classes/MTEAppDelegate.m
@@ -8,6 +8,7 @@
#import "MTEAppDelegate.h"
+#import "MTETodayTShirtViewController.h"
#import "MTETShirtsViewController.h"
#import "MTESettingsViewController.h"
@@ -45,12 +46,15 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
else
{
UITabBarController *tabBarController = (UITabBarController*)self.window.rootViewController;
- UINavigationController * navController1 = [tabBarController.viewControllers objectAtIndex:0];
+ UINavigationController * navController0 = [tabBarController.viewControllers objectAtIndex:0];
+ MTETodayTShirtViewController * todayViewController = (MTETodayTShirtViewController*)navController0.topViewController;
+ UINavigationController * navController1 = [tabBarController.viewControllers objectAtIndex:1];
MTETShirtsViewController * tshirtsViewController = (MTETShirtsViewController*)navController1.topViewController;
- UINavigationController * navController2 = [tabBarController.viewControllers objectAtIndex:1];
+ UINavigationController * navController2 = [tabBarController.viewControllers objectAtIndex:2];
MTESettingsViewController * settingsViewController = (MTESettingsViewController*)navController2.topViewController;
settingsViewController.syncManager = tshirtsViewController.syncManager;
+ todayViewController.managedObjectContext = self.managedObjectContext;
}
return YES;
View
15 client-ios/MyTee/Classes/MTETodayTShirtViewController.h
@@ -0,0 +1,15 @@
+//
+// MTETodayTShirtViewController.h
+// mytee
+//
+// Created by Vincent Tourraine on 5/2/12.
+// Copyright (c) 2012 Keres-Sy, Studio AMANgA. All rights reserved.
+//
+
+#import "MTETShirtViewController.h"
+
+@interface MTETodayTShirtViewController : MTETShirtViewController
+
+@property (nonatomic, weak) NSManagedObjectContext * managedObjectContext;
+
+@end
View
67 client-ios/MyTee/Classes/MTETodayTShirtViewController.m
@@ -0,0 +1,67 @@
+//
+// MTETodayTShirtViewController.m
+// mytee
+//
+// Created by Vincent Tourraine on 5/2/12.
+// Copyright (c) 2012 Keres-Sy, Studio AMANgA. All rights reserved.
+//
+
+#import "MTETodayTShirtViewController.h"
+
+#import "MTETShirt.h"
+
+@interface MTETodayTShirtViewController ()
+
+@property (weak, nonatomic) IBOutlet UILabel *emptyDataLabel;
+
+@end
+
+@implementation MTETodayTShirtViewController
+@synthesize emptyDataLabel;
+
+@synthesize managedObjectContext;
+
+- (void)viewWillAppear:(BOOL)animated
+{
+ [super viewWillAppear:animated];
+
+ NSDate * today = [NSDate date];
+ NSCalendar * gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
+ NSDateComponents * components = [[NSDateComponents alloc] init];
+ NSUInteger unitFlags = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit;
+ components = [gregorian components:unitFlags fromDate:today];
+ components.hour = 0;
+ components.minute = 0;
+ NSDate * todayMidnight = [gregorian dateFromComponents:components];
+
+ NSFetchRequest * fetchRequest = [NSFetchRequest fetchRequestWithEntityName:NSStringFromClass([MTETShirt class])];
+ NSPredicate * predicate = [NSPredicate predicateWithFormat:@"ANY wears.date > %@", todayMidnight];
+ [fetchRequest setPredicate:predicate];
+
+ NSError * error = nil;
+ NSArray * todayTShirts = [self.managedObjectContext executeFetchRequest:fetchRequest error:&error];
+ if (!error && todayTShirts && [todayTShirts count]>0)
+ {
+ self.tshirt = [todayTShirts lastObject];
+ }
+ else
+ {
+ self.tshirt = nil;
+ }
+}
+
+- (void)viewDidUnload
+{
+ [super viewDidUnload];
+
+ self.emptyDataLabel = nil;
+}
+
+- (void)configureView
+{
+ [super configureView];
+
+ self.emptyDataLabel.hidden = (self.tshirt != nil);
+}
+
+@end
View
148 client-ios/MyTee/Resources/Storyboards/Storyboard_iPhone.storyboard
@@ -410,7 +410,7 @@
<navigationItem key="navigationItem" title="Wash History" id="rAl-9w-Oku"/>
</tableViewController>
</objects>
- <point key="canvasLocation" x="2315" y="-787"/>
+ <point key="canvasLocation" x="2841" y="-787"/>
</scene>
<!--Wear Wash View Controller - Wear History-->
<scene sceneID="Zl6-37-ePq">
@@ -454,7 +454,7 @@
<navigationItem key="navigationItem" title="Wear History" id="EoT-DQ-5Dy"/>
</tableViewController>
</objects>
- <point key="canvasLocation" x="1875" y="-787"/>
+ <point key="canvasLocation" x="2401" y="-787"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="auR-ws-a1u">
@@ -662,12 +662,148 @@
<autoresizingMask key="autoresizingMask"/>
</tabBar>
<connections>
+ <segue destination="Onm-WV-IXO" kind="relationship" relationship="viewControllers" id="Bqq-kb-Cyd"/>
<segue destination="2mb-jW-cge" kind="relationship" relationship="viewControllers" id="634-bL-UpM"/>
<segue destination="9ba-Tg-mkM" kind="relationship" relationship="viewControllers" id="y8G-7T-b9Y"/>
</connections>
</tabBarController>
</objects>
- <point key="canvasLocation" x="-46" y="658"/>
+ <point key="canvasLocation" x="12" y="442"/>
+ </scene>
+ <!--TodayT Shirt View Controller - Today-->
+ <scene sceneID="yPI-fw-Cfy">
+ <objects>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="r0M-Up-FbA" userLabel="First Responder" sceneMemberID="firstResponder"/>
+ <viewController id="DJY-4b-xaN" customClass="MTETodayTShirtViewController" sceneMemberID="viewController">
+ <view key="view" contentMode="scaleToFill" id="GSA-Sa-wvV" customClass="UIScrollView">
+ <rect key="frame" x="0.0" y="64" width="320" height="600"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <subviews>
+ <imageView userInteractionEnabled="NO" contentMode="scaleToFill" id="dQ7-bi-PuK">
+ <rect key="frame" x="20" y="20" width="280" height="280"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ </imageView>
+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="7k9-oS-Xno">
+ <rect key="frame" x="20" y="392" width="135" height="37"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
+ <state key="normal" title="Wear History">
+ <color key="titleColor" cocoaTouchSystemColor="darkTextColor"/>
+ <color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
+ </state>
+ <state key="highlighted">
+ <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+ </state>
+ </button>
+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="FLo-5Z-KHu">
+ <rect key="frame" x="165" y="392" width="135" height="37"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
+ <state key="normal" title="Wash History">
+ <color key="titleColor" cocoaTouchSystemColor="darkTextColor"/>
+ <color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
+ </state>
+ <state key="highlighted">
+ <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+ </state>
+ </button>
+ <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="jL8-AL-w0z">
+ <rect key="frame" x="20" y="346" width="280" height="38"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
+ <inset key="contentEdgeInsets" minX="8" minY="0.0" maxX="0.0" maxY="0.0"/>
+ <inset key="titleEdgeInsets" minX="5" minY="0.0" maxX="0.0" maxY="0.0"/>
+ <state key="normal" title="Store" image="80-shopping-cart.png">
+ <color key="titleColor" cocoaTouchSystemColor="darkTextColor"/>
+ <color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
+ </state>
+ <state key="highlighted">
+ <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+ </state>
+ </button>
+ <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="★★★★☆" lineBreakMode="tailTruncation" minimumFontSize="10" id="ivi-Z7-dqQ">
+ <rect key="frame" x="20" y="308" width="116" height="38"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <fontDescription key="fontDescription" type="system" pointSize="17"/>
+ <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
+ <nil key="highlightedColor"/>
+ </label>
+ <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="XS" textAlignment="center" lineBreakMode="tailTruncation" minimumFontSize="10" id="mhw-4K-Xzn">
+ <rect key="frame" x="258" y="316" width="42" height="22"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+ <fontDescription key="fontDescription" type="boldSystem" pointSize="14"/>
+ <color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
+ <nil key="highlightedColor"/>
+ <color key="shadowColor" cocoaTouchSystemColor="darkTextColor"/>
+ <size key="shadowOffset" width="0.0" height="1"/>
+ </label>
+ <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Labels" lineBreakMode="tailTruncation" minimumFontSize="10" id="f0a-bN-myd">
+ <rect key="frame" x="58" y="437" width="242" height="27"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <fontDescription key="fontDescription" type="system" pointSize="15"/>
+ <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
+ <nil key="highlightedColor"/>
+ </label>
+ <imageView userInteractionEnabled="NO" contentMode="center" image="14-tag.png" id="2ZG-nW-bNX">
+ <rect key="frame" x="26" y="437" width="30" height="27"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ </imageView>
+ <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Notes" lineBreakMode="tailTruncation" numberOfLines="0" minimumFontSize="10" id="5Gl-v1-aNH">
+ <rect key="frame" x="58" y="478" width="242" height="18"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <fontDescription key="fontDescription" type="system" pointSize="15"/>
+ <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
+ <nil key="highlightedColor"/>
+ </label>
+ <imageView userInteractionEnabled="NO" contentMode="center" image="179-notepad.png" id="3Og-a7-gaY">
+ <rect key="frame" x="26" y="470" width="30" height="34"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ </imageView>
+ <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Time to Dress Up!" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="10" id="b4X-Aj-eDk">
+ <rect key="frame" x="0.0" y="0.0" width="320" height="320"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <fontDescription key="fontDescription" type="boldSystem" pointSize="18"/>
+ <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
+ <nil key="highlightedColor"/>
+ </label>
+ </subviews>
+ <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
+ </view>
+ <navigationItem key="navigationItem" title="Today" id="HNw-MT-Atx"/>
+ <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
+ <connections>
+ <outlet property="emptyDataLabel" destination="b4X-Aj-eDk" id="Xf5-IL-FCP"/>
+ <outlet property="noteIconImageView" destination="3Og-a7-gaY" id="qZF-wf-oY8"/>
+ <outlet property="noteLabel" destination="5Gl-v1-aNH" id="D7f-rZ-tgU"/>
+ <outlet property="ratingLabel" destination="ivi-Z7-dqQ" id="DBD-IZ-ZPh"/>
+ <outlet property="sizeLabel" destination="mhw-4K-Xzn" id="hIL-qg-JJJ"/>
+ <outlet property="storeButton" destination="jL8-AL-w0z" id="pHH-rF-cGE"/>
+ <outlet property="tagsLabel" destination="f0a-bN-myd" id="80A-Qu-Kmj"/>
+ <outlet property="tshirtImageView" destination="dQ7-bi-PuK" id="wV2-XL-WcH"/>
+ </connections>
+ </viewController>
+ </objects>
+ <point key="canvasLocation" x="1274" y="-886"/>
+ </scene>
+ <!--Navigation Controller - Today-->
+ <scene sceneID="RI9-D4-F2s">
+ <objects>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="cht-ZF-ed8" userLabel="First Responder" sceneMemberID="firstResponder"/>
+ <navigationController id="Onm-WV-IXO" sceneMemberID="viewController">
+ <tabBarItem key="tabBarItem" title="Today" image="83-calendar.png" id="c4D-dT-cmZ"/>
+ <toolbarItems/>
+ <navigationBar key="navigationBar" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" id="IAc-sE-hUM">
+ <rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
+ <autoresizingMask key="autoresizingMask"/>
+ </navigationBar>
+ <nil name="viewControllers"/>
+ <connections>
+ <segue destination="DJY-4b-xaN" kind="relationship" relationship="rootViewController" id="zux-xf-3c0"/>
+ </connections>
+ </navigationController>
+ </objects>
+ <point key="canvasLocation" x="769" y="-817"/>
</scene>
</scenes>
<resources>
@@ -741,6 +877,12 @@
<relationship kind="outlet" name="settingsBarButtonItem" candidateClass="UIBarButtonItem"/>
</relationships>
</class>
+ <class className="MTETodayTShirtViewController" superclassName="MTETShirtViewController">
+ <source key="sourceIdentifier" type="project" relativePath="./Classes/MTETodayTShirtViewController.h"/>
+ <relationships>
+ <relationship kind="outlet" name="emptyDataLabel" candidateClass="UILabel"/>
+ </relationships>
+ </class>
<class className="MTEWearWashViewController" superclassName="UITableViewController">
<source key="sourceIdentifier" type="project" relativePath="./Classes/MTEWearWashViewController.h"/>
</class>
View
8 client-ios/mytee.xcodeproj/project.pbxproj
@@ -43,6 +43,7 @@
1F294E1314D74F2300A24AED /* KeychainItemWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F294E1214D74F2300A24AED /* KeychainItemWrapper.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
1F294E1714D7515A00A24AED /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1F294E1614D7515A00A24AED /* Security.framework */; };
1F294E1A14D7558600A24AED /* MTESyncManagerSpec.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1F294E1914D7558600A24AED /* MTESyncManagerSpec.mm */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
+ 1F2C7F2D15509760002A160C /* MTETodayTShirtViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F2C7F2C15509760002A160C /* MTETodayTShirtViewController.m */; };
1F67661614EB28F60035EF7D /* 19-gear-w.png in Resources */ = {isa = PBXBuildFile; fileRef = 1F67661414EB28F60035EF7D /* 19-gear-w.png */; };
1F67661714EB28F60035EF7D /* 19-gear-w@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1F67661514EB28F60035EF7D /* 19-gear-w@2x.png */; };
1F6AC78814D9FE890040A06A /* MTETShirtViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F6AC78714D9FE890040A06A /* MTETShirtViewController.m */; };
@@ -154,6 +155,8 @@
1F294E1214D74F2300A24AED /* KeychainItemWrapper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = KeychainItemWrapper.m; path = Libraries/KeychainItemWrapper/KeychainItemWrapper.m; sourceTree = SOURCE_ROOT; };
1F294E1614D7515A00A24AED /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
1F294E1914D7558600A24AED /* MTESyncManagerSpec.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MTESyncManagerSpec.mm; path = MyTeeTests/Specs/MTESyncManagerSpec.mm; sourceTree = SOURCE_ROOT; };
+ 1F2C7F2B15509760002A160C /* MTETodayTShirtViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MTETodayTShirtViewController.h; path = MyTee/Classes/MTETodayTShirtViewController.h; sourceTree = SOURCE_ROOT; };
+ 1F2C7F2C15509760002A160C /* MTETodayTShirtViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MTETodayTShirtViewController.m; path = MyTee/Classes/MTETodayTShirtViewController.m; sourceTree = SOURCE_ROOT; };
1F67661414EB28F60035EF7D /* 19-gear-w.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "19-gear-w.png"; path = "MyTee/Resources/Images/19-gear-w.png"; sourceTree = SOURCE_ROOT; };
1F67661514EB28F60035EF7D /* 19-gear-w@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "19-gear-w@2x.png"; path = "MyTee/Resources/Images/19-gear-w@2x.png"; sourceTree = SOURCE_ROOT; };
1F6AC78614D9FE890040A06A /* MTETShirtViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MTETShirtViewController.h; path = MyTee/Classes/MTETShirtViewController.h; sourceTree = SOURCE_ROOT; };
@@ -619,6 +622,8 @@
1F6AC78B14DA03E00040A06A /* MTEWearWashViewController.m */,
1F01F15814DB464700D6EF0C /* MTETShirtCell.h */,
1F01F15914DB464700D6EF0C /* MTETShirtCell.m */,
+ 1F2C7F2B15509760002A160C /* MTETodayTShirtViewController.h */,
+ 1F2C7F2C15509760002A160C /* MTETodayTShirtViewController.m */,
);
name = "T-Shirts";
sourceTree = "<group>";
@@ -686,7 +691,7 @@
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0430;
- ORGANIZATIONNAME = "Keres-Sy, Studio AMANgA";
+ ORGANIZATIONNAME = "Studio AMANgA";
};
buildConfigurationList = 1F7BF96E14D4429500D7F4A3 /* Build configuration list for PBXProject "mytee" */;
compatibilityVersion = "Xcode 3.2";
@@ -815,6 +820,7 @@
1FA8536114EC5BCB00736DAD /* MTESettingsViewController.m in Sources */,
1F02F4AD14F12915005F738B /* MTESettingsManager.m in Sources */,
1FFAB03314F1D44A00851D81 /* MTESettingCell.m in Sources */,
+ 1F2C7F2D15509760002A160C /* MTETodayTShirtViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Please sign in to comment.
Something went wrong with that request. Please try again.