diff --git a/iTunesSearch.xcodeproj/project.pbxproj b/iTunesSearch.xcodeproj/project.pbxproj index 79e06d7..c062fec 100644 --- a/iTunesSearch.xcodeproj/project.pbxproj +++ b/iTunesSearch.xcodeproj/project.pbxproj @@ -17,6 +17,11 @@ 92C21CE11AAE76930052ABE6 /* TableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 92C21CDF1AAE76930052ABE6 /* TableViewCell.m */; }; 92C21CE21AAE76930052ABE6 /* TableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 92C21CE01AAE76930052ABE6 /* TableViewCell.xib */; }; 92C21CE81AAE858E0052ABE6 /* Filme.m in Sources */ = {isa = PBXBuildFile; fileRef = 92C21CE71AAE858E0052ABE6 /* Filme.m */; }; + CA4E47051AB34FDF001F320E /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = CA4E47071AB34FDF001F320E /* Localizable.strings */; }; + CA4E47401AB735EB001F320E /* DetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CA4E473E1AB735EB001F320E /* DetailViewController.m */; }; + CA4E47411AB735EB001F320E /* DetailViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = CA4E473F1AB735EB001F320E /* DetailViewController.xib */; }; + CA4EE5701AAF820C001E427A /* ReaderTableView.xib in Resources */ = {isa = PBXBuildFile; fileRef = CA4EE56F1AAF820C001E427A /* ReaderTableView.xib */; }; + CA4EE5731AAF8267001E427A /* HeaderTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = CA4EE5721AAF8267001E427A /* HeaderTableViewCell.m */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -49,6 +54,16 @@ 92C21CE01AAE76930052ABE6 /* TableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = TableViewCell.xib; sourceTree = ""; }; 92C21CE61AAE858E0052ABE6 /* Filme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Filme.h; path = Entidades/Filme.h; sourceTree = ""; }; 92C21CE71AAE858E0052ABE6 /* Filme.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Filme.m; path = Entidades/Filme.m; sourceTree = ""; }; + CA4E47061AB34FDF001F320E /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/Localizable.strings; sourceTree = ""; }; + CA4E47081AB34FE2001F320E /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; + CA4E47091AB35076001F320E /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Localizable.strings; sourceTree = ""; }; + CA4E470A1AB35174001F320E /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/Localizable.strings; sourceTree = ""; }; + CA4E473D1AB735EB001F320E /* DetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DetailViewController.h; sourceTree = ""; }; + CA4E473E1AB735EB001F320E /* DetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DetailViewController.m; sourceTree = ""; }; + CA4E473F1AB735EB001F320E /* DetailViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = DetailViewController.xib; sourceTree = ""; }; + CA4EE56F1AAF820C001E427A /* ReaderTableView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ReaderTableView.xib; sourceTree = ""; }; + CA4EE5711AAF8267001E427A /* HeaderTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HeaderTableViewCell.h; sourceTree = ""; }; + CA4EE5721AAF8267001E427A /* HeaderTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HeaderTableViewCell.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -96,6 +111,9 @@ 92C21CB81AAE757A0052ABE6 /* AppDelegate.m */, 92C21CBA1AAE757A0052ABE6 /* TableViewController.h */, 92C21CBB1AAE757A0052ABE6 /* TableViewController.m */, + CA4E473D1AB735EB001F320E /* DetailViewController.h */, + CA4E473E1AB735EB001F320E /* DetailViewController.m */, + CA4E473F1AB735EB001F320E /* DetailViewController.xib */, 92C21CDC1AAE75DC0052ABE6 /* TableView.xib */, 92C21CD91AAE75B30052ABE6 /* iTunesManager.h */, 92C21CDA1AAE75B30052ABE6 /* iTunesManager.m */, @@ -136,6 +154,10 @@ children = ( 92C21CDE1AAE76930052ABE6 /* TableViewCell.h */, 92C21CDF1AAE76930052ABE6 /* TableViewCell.m */, + CA4EE56F1AAF820C001E427A /* ReaderTableView.xib */, + CA4EE5711AAF8267001E427A /* HeaderTableViewCell.h */, + CA4EE5721AAF8267001E427A /* HeaderTableViewCell.m */, + CA4E47071AB34FDF001F320E /* Localizable.strings */, 92C21CE01AAE76930052ABE6 /* TableViewCell.xib */, ); name = Celulas; @@ -213,6 +235,8 @@ knownRegions = ( en, Base, + fr, + pt, ); mainGroup = 92C21CA71AAE757A0052ABE6; productRefGroup = 92C21CB11AAE757A0052ABE6 /* Products */; @@ -230,8 +254,11 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + CA4E47051AB34FDF001F320E /* Localizable.strings in Resources */, + CA4E47411AB735EB001F320E /* DetailViewController.xib in Resources */, 92C21CC11AAE757A0052ABE6 /* Images.xcassets in Resources */, 92C21CE21AAE76930052ABE6 /* TableViewCell.xib in Resources */, + CA4EE5701AAF820C001E427A /* ReaderTableView.xib in Resources */, 92C21CDD1AAE75DC0052ABE6 /* TableView.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -251,7 +278,9 @@ buildActionMask = 2147483647; files = ( 92C21CBC1AAE757A0052ABE6 /* TableViewController.m in Sources */, + CA4EE5731AAF8267001E427A /* HeaderTableViewCell.m in Sources */, 92C21CDB1AAE75B30052ABE6 /* iTunesManager.m in Sources */, + CA4E47401AB735EB001F320E /* DetailViewController.m in Sources */, 92C21CB91AAE757A0052ABE6 /* AppDelegate.m in Sources */, 92C21CE81AAE858E0052ABE6 /* Filme.m in Sources */, 92C21CE11AAE76930052ABE6 /* TableViewCell.m in Sources */, @@ -277,6 +306,20 @@ }; /* End PBXTargetDependency section */ +/* Begin PBXVariantGroup section */ + CA4E47071AB34FDF001F320E /* Localizable.strings */ = { + isa = PBXVariantGroup; + children = ( + CA4E47061AB34FDF001F320E /* Base */, + CA4E47081AB34FE2001F320E /* en */, + CA4E47091AB35076001F320E /* fr */, + CA4E470A1AB35174001F320E /* pt */, + ); + name = Localizable.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + /* Begin XCBuildConfiguration section */ 92C21CD11AAE757A0052ABE6 /* Debug */ = { isa = XCBuildConfiguration; diff --git a/iTunesSearch/Base.lproj/Localizable.strings b/iTunesSearch/Base.lproj/Localizable.strings new file mode 100644 index 0000000..d7136c1 --- /dev/null +++ b/iTunesSearch/Base.lproj/Localizable.strings @@ -0,0 +1,9 @@ +/* + Localizable.strings + iTunesSearch + + Created by Rafael Fernandes de Oliveira Carvalho on 3/13/15. + Copyright (c) 2015 joaquim. All rights reserved. +*/ + +"Pesquisar"= "Pesquisar"; \ No newline at end of file diff --git a/iTunesSearch/DetailViewController.h b/iTunesSearch/DetailViewController.h new file mode 100644 index 0000000..2f4fc5a --- /dev/null +++ b/iTunesSearch/DetailViewController.h @@ -0,0 +1,16 @@ +// +// DetailViewController.h +// iTunesSearch +// +// Created by Rafael Fernandes de Oliveira Carvalho on 3/16/15. +// Copyright (c) 2015 joaquim. All rights reserved. +// + +#import +#import "Filme.h" + +@interface DetailViewController : UIViewController + +@property Filme *filme; + +@end diff --git a/iTunesSearch/DetailViewController.m b/iTunesSearch/DetailViewController.m new file mode 100644 index 0000000..245f379 --- /dev/null +++ b/iTunesSearch/DetailViewController.m @@ -0,0 +1,51 @@ +// +// DetailViewController.m +// iTunesSearch +// +// Created by Rafael Fernandes de Oliveira Carvalho on 3/16/15. +// Copyright (c) 2015 joaquim. All rights reserved. +// + +#import "DetailViewController.h" + +@interface DetailViewController () +@property (weak, nonatomic) IBOutlet UILabel *nameLabel; +@property (weak, nonatomic) IBOutlet UILabel *tipoLabel; +@property (weak, nonatomic) IBOutlet UILabel *localLabel; +@property (weak, nonatomic) IBOutlet UILabel *artistaLabel; +@property (weak, nonatomic) IBOutlet UILabel *midiaLabel; + +@end + +@implementation DetailViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + _nameLabel.text = _filme.nome; + _tipoLabel.text = _filme.genero; + _localLabel.text = _filme.pais; + _artistaLabel.text = _filme.artista; + _midiaLabel.text = @"Filme"; + + // Do any additional setup after loading the view from its nib. +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} +- (IBAction)back:(id)sender { + [self dismissViewControllerAnimated:YES completion:nil]; +} + +/* +#pragma mark - Navigation + +// In a storyboard-based application, you will often want to do a little preparation before navigation +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + // Get the new view controller using [segue destinationViewController]. + // Pass the selected object to the new view controller. +} +*/ + +@end diff --git a/iTunesSearch/DetailViewController.xib b/iTunesSearch/DetailViewController.xib new file mode 100644 index 0000000..0eb83c8 --- /dev/null +++ b/iTunesSearch/DetailViewController.xib @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/iTunesSearch/HeaderTableViewCell.h b/iTunesSearch/HeaderTableViewCell.h new file mode 100644 index 0000000..a7d4f96 --- /dev/null +++ b/iTunesSearch/HeaderTableViewCell.h @@ -0,0 +1,14 @@ +// +// HeaderTableViewCell.h +// iTunesSearch +// +// Created by Rafael Fernandes de Oliveira Carvalho on 3/10/15. +// Copyright (c) 2015 joaquim. All rights reserved. +// + +#import + +@interface HeaderTableViewCell : UITableViewCell +@property (weak, nonatomic) IBOutlet UISearchBar *searchBar; + +@end diff --git a/iTunesSearch/HeaderTableViewCell.m b/iTunesSearch/HeaderTableViewCell.m new file mode 100644 index 0000000..30de3cf --- /dev/null +++ b/iTunesSearch/HeaderTableViewCell.m @@ -0,0 +1,35 @@ +// +// HeaderTableViewCell.m +// iTunesSearch +// +// Created by Rafael Fernandes de Oliveira Carvalho on 3/10/15. +// Copyright (c) 2015 joaquim. All rights reserved. +// + +#import "HeaderTableViewCell.h" +#import "TableViewController.h" +#import "iTunesManager.h" + +@implementation HeaderTableViewCell + +- (void)awakeFromNib { + [_searchBar setDelegate:self]; + _searchBar.placeholder = NSLocalizedString(@"Pesquisar", @""); + +} + +- (void)setSelected:(BOOL)selected animated:(BOOL)animated { + [super setSelected:selected animated:animated]; + + // Configure the view for the selected state +} + + +- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar { + iTunesManager *itunes = [iTunesManager sharedInstance]; + TableViewController *tableView = (TableViewController *)[UIApplication sharedApplication].keyWindow.rootViewController; + tableView.midias = [itunes buscarMidias:[_searchBar.text stringByReplacingOccurrencesOfString:@" " withString:@"-"]]; + [tableView.tableview reloadData]; +} + +@end diff --git a/iTunesSearch/ReaderTableView.xib b/iTunesSearch/ReaderTableView.xib new file mode 100644 index 0000000..366e1f2 --- /dev/null +++ b/iTunesSearch/ReaderTableView.xib @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/iTunesSearch/TableViewCell.h b/iTunesSearch/TableViewCell.h index b630349..70f856f 100644 --- a/iTunesSearch/TableViewCell.h +++ b/iTunesSearch/TableViewCell.h @@ -12,6 +12,9 @@ @property (weak, nonatomic) IBOutlet UILabel *nome; @property (weak, nonatomic) IBOutlet UILabel *tipo; +@property (weak, nonatomic) IBOutlet UILabel *genero; +@property (weak, nonatomic) IBOutlet UILabel *artista; +@property (weak, nonatomic) IBOutlet UILabel *pais; @end diff --git a/iTunesSearch/TableViewCell.xib b/iTunesSearch/TableViewCell.xib index bf8bd3f..de5e1a3 100644 --- a/iTunesSearch/TableViewCell.xib +++ b/iTunesSearch/TableViewCell.xib @@ -1,5 +1,5 @@ - + @@ -17,27 +17,76 @@ -