Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions iTunesSearch.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -49,6 +54,16 @@
92C21CE01AAE76930052ABE6 /* TableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = TableViewCell.xib; sourceTree = "<group>"; };
92C21CE61AAE858E0052ABE6 /* Filme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Filme.h; path = Entidades/Filme.h; sourceTree = "<group>"; };
92C21CE71AAE858E0052ABE6 /* Filme.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Filme.m; path = Entidades/Filme.m; sourceTree = "<group>"; };
CA4E47061AB34FDF001F320E /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/Localizable.strings; sourceTree = "<group>"; };
CA4E47081AB34FE2001F320E /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
CA4E47091AB35076001F320E /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Localizable.strings; sourceTree = "<group>"; };
CA4E470A1AB35174001F320E /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/Localizable.strings; sourceTree = "<group>"; };
CA4E473D1AB735EB001F320E /* DetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DetailViewController.h; sourceTree = "<group>"; };
CA4E473E1AB735EB001F320E /* DetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DetailViewController.m; sourceTree = "<group>"; };
CA4E473F1AB735EB001F320E /* DetailViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = DetailViewController.xib; sourceTree = "<group>"; };
CA4EE56F1AAF820C001E427A /* ReaderTableView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ReaderTableView.xib; sourceTree = "<group>"; };
CA4EE5711AAF8267001E427A /* HeaderTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HeaderTableViewCell.h; sourceTree = "<group>"; };
CA4EE5721AAF8267001E427A /* HeaderTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HeaderTableViewCell.m; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -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 */,
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -213,6 +235,8 @@
knownRegions = (
en,
Base,
fr,
pt,
);
mainGroup = 92C21CA71AAE757A0052ABE6;
productRefGroup = 92C21CB11AAE757A0052ABE6 /* Products */;
Expand All @@ -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;
Expand All @@ -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 */,
Expand All @@ -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 = "<group>";
};
/* End PBXVariantGroup section */

/* Begin XCBuildConfiguration section */
92C21CD11AAE757A0052ABE6 /* Debug */ = {
isa = XCBuildConfiguration;
Expand Down
9 changes: 9 additions & 0 deletions iTunesSearch/Base.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -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";
16 changes: 16 additions & 0 deletions iTunesSearch/DetailViewController.h
Original file line number Diff line number Diff line change
@@ -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 <UIKit/UIKit.h>
#import "Filme.h"

@interface DetailViewController : UIViewController

@property Filme *filme;

@end
51 changes: 51 additions & 0 deletions iTunesSearch/DetailViewController.m
Original file line number Diff line number Diff line change
@@ -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
73 changes: 73 additions & 0 deletions iTunesSearch/DetailViewController.xib
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6751" systemVersion="14C1510" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6736"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="DetailViewController">
<connections>
<outlet property="artistaLabel" destination="U7s-xZ-o8j" id="rJ6-N9-F8b"/>
<outlet property="localLabel" destination="WJw-SX-dzW" id="fhT-NK-hmi"/>
<outlet property="midiaLabel" destination="SAg-Vi-jJ8" id="f2t-KO-bOG"/>
<outlet property="nameLabel" destination="bxU-f2-QOJ" id="XB8-Ty-w7D"/>
<outlet property="tipoLabel" destination="x6A-f0-ita" id="MA8-7G-Wp7"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bxU-f2-QOJ">
<rect key="frame" x="49" y="153" width="488" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="x6A-f0-ita">
<rect key="frame" x="49" y="192" width="383" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="WJw-SX-dzW">
<rect key="frame" x="49" y="237" width="410" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="U7s-xZ-o8j">
<rect key="frame" x="49" y="274" width="465" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SAg-Vi-jJ8">
<rect key="frame" x="49" y="319" width="488" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<navigationBar contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Bvg-Dp-4B8">
<rect key="frame" x="0.0" y="20" width="600" height="44"/>
<items>
<navigationItem title="Detalhes" id="nog-MN-UDt">
<barButtonItem key="leftBarButtonItem" title="Voltar" id="fN0-fC-jxs">
<connections>
<action selector="back:" destination="-1" id="Yez-Fj-X80"/>
</connections>
</barButtonItem>
</navigationItem>
</items>
</navigationBar>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="Bvg-Dp-4B8" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" constant="20" id="JBc-au-P4E"/>
<constraint firstItem="Bvg-Dp-4B8" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="MhC-yj-lHi"/>
<constraint firstAttribute="trailing" secondItem="Bvg-Dp-4B8" secondAttribute="trailing" id="P8c-QV-SCN"/>
</constraints>
</view>
</objects>
</document>
14 changes: 14 additions & 0 deletions iTunesSearch/HeaderTableViewCell.h
Original file line number Diff line number Diff line change
@@ -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 <UIKit/UIKit.h>

@interface HeaderTableViewCell : UITableViewCell <UISearchBarDelegate>
@property (weak, nonatomic) IBOutlet UISearchBar *searchBar;

@end
35 changes: 35 additions & 0 deletions iTunesSearch/HeaderTableViewCell.m
Original file line number Diff line number Diff line change
@@ -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
31 changes: 31 additions & 0 deletions iTunesSearch/ReaderTableView.xib
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6751" systemVersion="14C1510" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6736"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="65" id="mQz-j9-EXq" customClass="HeaderTableViewCell">
<rect key="frame" x="0.0" y="0.0" width="320" height="65"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="mQz-j9-EXq" id="NOi-ni-UM7">
<autoresizingMask key="autoresizingMask"/>
<subviews>
<searchBar contentMode="redraw" ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="w0Y-bx-IU8">
<rect key="frame" x="0.0" y="20" width="320" height="44"/>
<textInputTraits key="textInputTraits"/>
</searchBar>
</subviews>
<constraints>
<constraint firstItem="w0Y-bx-IU8" firstAttribute="top" secondItem="NOi-ni-UM7" secondAttribute="topMargin" constant="12" id="mPc-2a-mTf"/>
</constraints>
</tableViewCellContentView>
<connections>
<outlet property="searchBar" destination="w0Y-bx-IU8" id="CEc-H5-Sdz"/>
</connections>
<point key="canvasLocation" x="506" y="507.5"/>
</tableViewCell>
</objects>
</document>
3 changes: 3 additions & 0 deletions iTunesSearch/TableViewCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tem muito mais informações do que isso para mostrar.

@property (weak, nonatomic) IBOutlet UILabel *pais;


@end
Loading