diff --git a/.DS_Store b/.DS_Store index fc128b7..93d0955 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/Projet.xcodeproj/project.pbxproj b/Projet.xcodeproj/project.pbxproj index adf473f..1f87b3e 100644 --- a/Projet.xcodeproj/project.pbxproj +++ b/Projet.xcodeproj/project.pbxproj @@ -13,6 +13,9 @@ 9B2D6BA616244E730038A459 /* DetailListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B2D6BA516244E730038A459 /* DetailListViewController.m */; }; 9B2D6BA716244FA00038A459 /* DataListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B2D6B9916244AF20038A459 /* DataListViewController.m */; }; 9B2D6BA816244FAD0038A459 /* CustomCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B2D6B9716244AF20038A459 /* CustomCell.m */; }; + 9B499916163936B7000A24DA /* WineViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B499915163936B7000A24DA /* WineViewController.m */; }; + 9B49991C163936EF000A24DA /* bouteille@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9B49991B163936EF000A24DA /* bouteille@2x.png */; }; + 9B49991E16393726000A24DA /* mabout.png in Resources */ = {isa = PBXBuildFile; fileRef = 9B49991D16393726000A24DA /* mabout.png */; }; 9BFC82CF16392F70000C1600 /* iCarousel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BFC82CE16392F70000C1600 /* iCarousel.m */; }; 9BFC82D516392F7D000C1600 /* LBYouTubePlayerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BFC82D216392F7D000C1600 /* LBYouTubePlayerController.m */; }; 9BFC82D616392F7D000C1600 /* LBYouTubePlayerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BFC82D416392F7D000C1600 /* LBYouTubePlayerViewController.m */; }; @@ -22,6 +25,7 @@ 9BFC82EC163930CF000C1600 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9BFC82EB163930CF000C1600 /* Default-568h@2x.png */; }; 9BFC82EE163930F2000C1600 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9BFC82ED163930F2000C1600 /* QuartzCore.framework */; }; 9BFC82F016393108000C1600 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9BFC82EF16393108000C1600 /* MediaPlayer.framework */; }; + 9BFC82FA163933F4000C1600 /* bouteille.png in Resources */ = {isa = PBXBuildFile; fileRef = 9BFC82F9163933F4000C1600 /* bouteille.png */; }; E03C9810151A86590004D2FD /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E03C980F151A86590004D2FD /* UIKit.framework */; }; E03C9812151A86590004D2FD /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E03C9811151A86590004D2FD /* Foundation.framework */; }; E03C9814151A86590004D2FD /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E03C9813151A86590004D2FD /* CoreGraphics.framework */; }; @@ -55,6 +59,10 @@ 9B2D6BA216244E250038A459 /* DetailListViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = DetailListViewController.xib; sourceTree = ""; }; 9B2D6BA416244E4D0038A459 /* DetailListViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DetailListViewController.h; sourceTree = ""; }; 9B2D6BA516244E730038A459 /* DetailListViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DetailListViewController.m; sourceTree = ""; }; + 9B4999141639369F000A24DA /* WineViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WineViewController.h; sourceTree = ""; }; + 9B499915163936B7000A24DA /* WineViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WineViewController.m; sourceTree = ""; }; + 9B49991B163936EF000A24DA /* bouteille@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "bouteille@2x.png"; sourceTree = ""; }; + 9B49991D16393726000A24DA /* mabout.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = mabout.png; sourceTree = ""; }; 9BFC82CD16392F70000C1600 /* iCarousel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iCarousel.h; sourceTree = ""; }; 9BFC82CE16392F70000C1600 /* iCarousel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = iCarousel.m; sourceTree = ""; }; 9BFC82D116392F7D000C1600 /* LBYouTubePlayerController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LBYouTubePlayerController.h; sourceTree = ""; }; @@ -73,6 +81,7 @@ 9BFC82EB163930CF000C1600 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; 9BFC82ED163930F2000C1600 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; 9BFC82EF16393108000C1600 /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = System/Library/Frameworks/MediaPlayer.framework; sourceTree = SDKROOT; }; + 9BFC82F9163933F4000C1600 /* bouteille.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = bouteille.png; sourceTree = ""; }; E03C980B151A86590004D2FD /* Projet.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Projet.app; sourceTree = BUILT_PRODUCTS_DIR; }; E03C980F151A86590004D2FD /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; E03C9811151A86590004D2FD /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; @@ -124,6 +133,7 @@ 9BFC82CA16392F44000C1600 /* MSToolTips */ = { isa = PBXGroup; children = ( + 9BFC82F516393310000C1600 /* WineView */, 9BFC82D716392F98000C1600 /* Download */, 9BFC82D016392F7D000C1600 /* LBYouTubePlayerController */, 9BFC82CC16392F70000C1600 /* iCarousel */, @@ -186,11 +196,21 @@ path = JSONKit; sourceTree = ""; }; + 9BFC82F516393310000C1600 /* WineView */ = { + isa = PBXGroup; + children = ( + 9B49991D16393726000A24DA /* mabout.png */, + 9B49991B163936EF000A24DA /* bouteille@2x.png */, + 9B499915163936B7000A24DA /* WineViewController.m */, + 9B4999141639369F000A24DA /* WineViewController.h */, + 9BFC82F9163933F4000C1600 /* bouteille.png */, + ); + name = WineView; + sourceTree = ""; + }; E03C9800151A86590004D2FD = { isa = PBXGroup; children = ( - 9BFC82EF16393108000C1600 /* MediaPlayer.framework */, - 9BFC82ED163930F2000C1600 /* QuartzCore.framework */, 9BFC82EB163930CF000C1600 /* Default-568h@2x.png */, 9BFC82CA16392F44000C1600 /* MSToolTips */, E03C9815151A86590004D2FD /* TabBar */, @@ -211,6 +231,8 @@ E03C980E151A86590004D2FD /* Frameworks */ = { isa = PBXGroup; children = ( + 9BFC82ED163930F2000C1600 /* QuartzCore.framework */, + 9BFC82EF16393108000C1600 /* MediaPlayer.framework */, E03C980F151A86590004D2FD /* UIKit.framework */, E03C9811151A86590004D2FD /* Foundation.framework */, E03C9813151A86590004D2FD /* CoreGraphics.framework */, @@ -340,6 +362,9 @@ 9BFC82E316393058000C1600 /* CHANGELOG.md in Resources */, 9BFC82E516393058000C1600 /* README.md in Resources */, 9BFC82EC163930CF000C1600 /* Default-568h@2x.png in Resources */, + 9BFC82FA163933F4000C1600 /* bouteille.png in Resources */, + 9B49991C163936EF000A24DA /* bouteille@2x.png in Resources */, + 9B49991E16393726000A24DA /* mabout.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -366,6 +391,7 @@ 9BFC82D516392F7D000C1600 /* LBYouTubePlayerController.m in Sources */, 9BFC82D616392F7D000C1600 /* LBYouTubePlayerViewController.m in Sources */, 9BFC82E416393058000C1600 /* JSONKit.m in Sources */, + 9B499916163936B7000A24DA /* WineViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Projet.xcodeproj/project.xcworkspace/xcuserdata/eleves.xcuserdatad/UserInterfaceState.xcuserstate b/Projet.xcodeproj/project.xcworkspace/xcuserdata/eleves.xcuserdatad/UserInterfaceState.xcuserstate index 2daeb58..a337b12 100644 Binary files a/Projet.xcodeproj/project.xcworkspace/xcuserdata/eleves.xcuserdatad/UserInterfaceState.xcuserstate and b/Projet.xcodeproj/project.xcworkspace/xcuserdata/eleves.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/TabBar/AppDelegate.m b/TabBar/AppDelegate.m index 81bf45c..5542abe 100644 --- a/TabBar/AppDelegate.m +++ b/TabBar/AppDelegate.m @@ -14,6 +14,7 @@ #import "FourthViewController.h" #import "FifthViewController.h" #import "SixthViewController.h" +#import "WineViewController.h" @implementation AppDelegate @@ -26,8 +27,18 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( self.tabBarController = [[UITabBarController alloc] init]; - FirstViewController *firstViewController = [[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil]; - firstViewController.title = @"Vins"; + // FirstViewController *firstViewController = [[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil]; +// firstViewController.title = @"Vins"; + + WineViewController *wineVC = [[WineViewController alloc] init]; + UITabBarItem *tabBarItem3 = [[UITabBarItem alloc] initWithTitle:@"Wine" + image:nil + tag:2]; + wineVC.tabBarItem = tabBarItem3; + + + + UITabBarItem *tabBarItem1 = [[UITabBarItem alloc] initWithTitle:@"List" image:nil @@ -60,7 +71,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( sixthViewController.tabBarItem = tabBarItemSixth; _tabBarController.viewControllers = [NSArray arrayWithObjects: navController, - firstViewController, navigationController, thirdViewController, fourthViewController, fifthViewController, sixthViewController, nil]; + wineVC, navigationController, thirdViewController, fourthViewController, fifthViewController, sixthViewController, nil]; [_tabBarController.tabBar setSelectedImageTintColor:[UIColor grayColor]]; diff --git a/TabBar/MyWineViewController.h b/TabBar/MyWineViewController.h new file mode 100644 index 0000000..c95e80a --- /dev/null +++ b/TabBar/MyWineViewController.h @@ -0,0 +1,13 @@ +// +// MyWineViewController.h +// Projet +// +// Created by Élèves on 25/10/12. +// +// + +#import + +@interface MyWineViewController : UIViewController + +@end diff --git a/TabBar/MyWineViewController.m b/TabBar/MyWineViewController.m new file mode 100644 index 0000000..66e16b0 --- /dev/null +++ b/TabBar/MyWineViewController.m @@ -0,0 +1,38 @@ +// +// MyWineViewController.m +// Projet +// +// Created by Élèves on 25/10/12. +// +// + +#import "MyWineViewController.h" + +@interface MyWineViewController () + +@end + +@implementation MyWineViewController + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) { + // Custom initialization + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + // Do any additional setup after loading the view from its nib. +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +@end diff --git a/TabBar/MyWineViewController.xib b/TabBar/MyWineViewController.xib new file mode 100644 index 0000000..2d5a8f9 --- /dev/null +++ b/TabBar/MyWineViewController.xib @@ -0,0 +1,137 @@ + + + + 1536 + 12A269 + 2835 + 1187 + 624.00 + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 1919 + + + IBProxyObject + IBUIView + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + PluginDependencyRecalculationVersion + + + + + IBFilesOwner + IBCocoaTouchFramework + + + IBFirstResponder + IBCocoaTouchFramework + + + + 274 + {{0, 20}, {320, 548}} + + + + + 3 + MQA + + 2 + + + + + IBUIScreenMetrics + + YES + + + + + + {320, 568} + {568, 320} + + + IBCocoaTouchFramework + Retina 4 Full Screen + 2 + + IBCocoaTouchFramework + + + + + + + view + + + + 3 + + + + + + 0 + + + + + + 1 + + + + + -1 + + + File's Owner + + + -2 + + + + + + + MyWineViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + + + 3 + + + + + MyWineViewController + UIViewController + + IBProjectSource + ./Classes/MyWineViewController.h + + + + + 0 + IBCocoaTouchFramework + YES + 3 + YES + 1919 + + diff --git a/WineViewController.h b/WineViewController.h new file mode 100644 index 0000000..eebd628 --- /dev/null +++ b/WineViewController.h @@ -0,0 +1,17 @@ +// +// WineViewController.h +// MSToolTips +// +// Created by Marian Paul on 02/10/12. +// Copyright (c) 2012 Marian Paul. All rights reserved. +// + +#import +#import "iCarousel.h" + +@interface WineViewController : UIViewController +{ + iCarousel *_carousel; + UITextView *_textView; +} +@end diff --git a/WineViewController.m b/WineViewController.m new file mode 100644 index 0000000..3b7999f --- /dev/null +++ b/WineViewController.m @@ -0,0 +1,143 @@ +// +// WineViewController.m +// MSToolTips +// +// Created by Marian Paul on 02/10/12. +// Copyright (c) 2012 Marian Paul. All rights reserved. +// + +#import "WineViewController.h" + +@interface WineOverlayView : UIView + +@end + +@interface WineViewController () +{ + WineOverlayView *_overlay; +} +@end + +@implementation WineViewController + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; + if (self) { + // Custom initialization + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + self.view.backgroundColor = [UIColor scrollViewTexturedBackgroundColor]; + + _carousel = [[iCarousel alloc] initWithFrame:CGRectMake(0, 300.0, CGRectGetWidth(self.view.bounds), 111.0 /*depends strongly of values in overlay*/)]; + // these values in initWithFrame should be fixed, having hardcoded values is not great! + + //_carousel.type = iCarouselTypeRotary; // Try other values to see what happens + _carousel.type = iCarouselTypeCoverFlow; + _carousel.delegate = self; + _carousel.dataSource = self; + _carousel.clipsToBounds = NO; + _carousel.userInteractionEnabled = YES; + [self.view addSubview:_carousel]; + + _overlay = [[WineOverlayView alloc] initWithFrame:self.view.bounds]; + _overlay.userInteractionEnabled = NO; + [self.view addSubview:_overlay]; + + _textView = [[UITextView alloc] initWithFrame:CGRectMake(10.0, 10.0, 300.0, 280.0)]; + _textView.textColor = [UIColor blackColor]; + _textView.font = [UIFont boldSystemFontOfSize:15.0]; + [self.view addSubview:_textView]; +} + +- (void)viewDidUnload +{ + [super viewDidUnload]; + // Release any retained subviews of the main view. +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return (interfaceOrientation == UIInterfaceOrientationPortrait); +} + +#pragma mark - iCarousel methods + +- (NSUInteger)numberOfItemsInCarousel:(iCarousel *)carousel +{ + return 10 /*This is where you will set count values from server response*/; +} + +- (UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSUInteger)index reusingView:(UIView *)view +{ + //create new view if no view is available for recycling + if (view == nil) + { + + view = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"bouteille.png"]]; + if (index == 0) + { + view = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mabout.png.png"]]; + } + } + + + // Use for example SDWebImageView to load the image from internet in an asynchronous way + + return view; +} + +- (CGFloat)carouselItemWidth:(iCarousel *)carousel +{ + return 90.0; /*image width*/ +} + +- (void)carouselCurrentItemIndexDidChange:(iCarousel *)carousel; +{ + _textView.text = [NSString stringWithFormat:@"This is where you should place the text from the bottle. Current index is %d", carousel.currentItemIndex]; +} + +@end + + +@implementation WineOverlayView + +- (id) initWithFrame:(CGRect)frame +{ + self = [super initWithFrame:frame]; + if (self) { + self.backgroundColor = [UIColor clearColor]; + } + return self; +} + +- (void) drawRect:(CGRect)rect +{ + // Get the context + CGContextRef context = UIGraphicsGetCurrentContext(); + + // Build the path with triangle + CGContextMoveToPoint(context, 0.0, 0.0); + CGContextAddLineToPoint(context, 0.0, 300.0); + CGContextAddLineToPoint(context, 140.0, 300.0); + CGContextAddLineToPoint(context, 160.0, 320.0); + CGContextAddLineToPoint(context, 180.0, 300.0); + CGContextAddLineToPoint(context, 320.0, 300.0); + CGContextAddLineToPoint(context, 320.0, 0.0); + + // Close it + CGContextClosePath(context); + // Set fill color with white + CGContextSetFillColorWithColor(context, [UIColor whiteColor].CGColor); + // Add some shadows + CGContextSetShadowWithColor(context, CGSizeMake(0.0, 2.0), 5.0, [UIColor blackColor].CGColor); + // Fill the path + CGContextFillPath(context); +} + +@end \ No newline at end of file diff --git a/bouteille.png b/bouteille.png new file mode 100644 index 0000000..a2295a4 Binary files /dev/null and b/bouteille.png differ diff --git a/bouteille@2x.png b/bouteille@2x.png new file mode 100644 index 0000000..75d9f00 Binary files /dev/null and b/bouteille@2x.png differ diff --git a/mabout.png b/mabout.png new file mode 100644 index 0000000..6d6c650 Binary files /dev/null and b/mabout.png differ