Skip to content

Commit

Permalink
etiqueta de categoría seleccionada
Browse files Browse the repository at this point in the history
  • Loading branch information
rockarloz committed Dec 6, 2014
1 parent 5ee9edb commit 7cf1a34
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -584,11 +584,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "DejateCaer/NuevoInicioViewController.m"
timestampString = "438284292.877217"
timestampString = "439517508.84077"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "1211"
endingLineNumber = "1211"
startingLineNumber = "1213"
endingLineNumber = "1213"
landmarkName = "-filtrar:"
landmarkType = "5">
</BreakpointContent>
Expand All @@ -600,11 +600,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "DejateCaer/NuevoInicioViewController.m"
timestampString = "438284292.877217"
timestampString = "439517508.84077"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "1207"
endingLineNumber = "1207"
startingLineNumber = "1209"
endingLineNumber = "1209"
landmarkName = "-filtrar:"
landmarkType = "5">
</BreakpointContent>
Expand All @@ -616,11 +616,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "DejateCaer/NuevoInicioViewController.m"
timestampString = "438284292.877217"
timestampString = "439517508.84077"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "1205"
endingLineNumber = "1205"
startingLineNumber = "1207"
endingLineNumber = "1207"
landmarkName = "-filtrar:"
landmarkType = "5">
</BreakpointContent>
Expand Down Expand Up @@ -664,11 +664,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "DejateCaer/NuevoInicioViewController.m"
timestampString = "438284292.877217"
timestampString = "439517508.84077"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "1188"
endingLineNumber = "1188"
startingLineNumber = "1190"
endingLineNumber = "1190"
landmarkName = "-filtrar:"
landmarkType = "5">
</BreakpointContent>
Expand All @@ -680,11 +680,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "DejateCaer/NuevoInicioViewController.m"
timestampString = "438284292.877217"
timestampString = "439517508.84077"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "1349"
endingLineNumber = "1349"
startingLineNumber = "1351"
endingLineNumber = "1351"
landmarkName = "-filtrar:"
landmarkType = "5">
</BreakpointContent>
Expand Down Expand Up @@ -712,11 +712,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "DejateCaer/NuevoInicioViewController.m"
timestampString = "438284292.877217"
timestampString = "439517508.84077"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "1361"
endingLineNumber = "1361"
startingLineNumber = "1363"
endingLineNumber = "1363"
landmarkName = "-filtrar:"
landmarkType = "5">
</BreakpointContent>
Expand Down
15 changes: 12 additions & 3 deletions DejateCaer/Base.lproj/Main_iPhone.storyboard
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6245" systemVersion="14A389" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="ZVH-mO-vRS">
<dependencies>
<deployment defaultVersion="1792" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6238"/>
</dependencies>
<customFonts key="customFonts">
Expand Down Expand Up @@ -359,7 +358,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" ambiguous="YES" misplaced="YES" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="PGc-Zy-QV2">
<rect key="frame" x="0.0" y="329" width="320" height="190"/>
<rect key="frame" x="0.0" y="357" width="320" height="162"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</tableView>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="WWp-RF-oLP">
Expand All @@ -379,17 +378,27 @@
<rect key="frame" x="0.0" y="0.0" width="320" height="20"/>
<color key="backgroundColor" red="0.050980392159999999" green="0.30196078430000001" blue="0.92549019610000005" alpha="1" colorSpace="calibratedRGB"/>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" ambiguous="YES" misplaced="YES" text="Todos" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="swL-WD-Zk8">
<rect key="frame" x="0.0" y="329" width="320" height="28"/>
<color key="backgroundColor" red="0.70984135839999996" green="0.70984135839999996" blue="0.70984135839999996" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="OXt-hx-DcN" firstAttribute="top" secondItem="FUS-Pj-lKY" secondAttribute="bottom" id="26A-cW-kiy"/>
<constraint firstItem="WWp-RF-oLP" firstAttribute="top" secondItem="swL-WD-Zk8" secondAttribute="top" constant="-44" id="BhE-PG-xFj"/>
<constraint firstAttribute="width" secondItem="swL-WD-Zk8" secondAttribute="width" id="K0I-r7-Odm"/>
<constraint firstItem="1Vm-N0-Acj" firstAttribute="top" secondItem="PGc-Zy-QV2" secondAttribute="bottom" constant="1" id="MHW-dH-dLU"/>
<constraint firstItem="WWp-RF-oLP" firstAttribute="top" secondItem="OXt-hx-DcN" secondAttribute="bottom" constant="-2" id="Z1r-Mp-wlg"/>
<constraint firstItem="PGc-Zy-QV2" firstAttribute="top" secondItem="WWp-RF-oLP" secondAttribute="bottom" constant="-1" id="goG-SC-bYy"/>
<constraint firstItem="swL-WD-Zk8" firstAttribute="top" secondItem="PGc-Zy-QV2" secondAttribute="top" constant="-28" id="v2R-sL-tPR"/>
</constraints>
</view>
<tabBarItem key="tabBarItem" title="" image="aquiTab.png" id="neZ-RC-WGy"/>
<connections>
<outlet property="categories" destination="swL-WD-Zk8" id="NJs-xH-Onu"/>
<outlet property="mapa" destination="OXt-hx-DcN" id="HI0-fB-nZj"/>
<outlet property="scroll" destination="WWp-RF-oLP" id="exr-gP-c1Y"/>
<outlet property="tableView" destination="PGc-Zy-QV2" id="7ES-C0-Wpk"/>
Expand Down
1 change: 1 addition & 0 deletions DejateCaer/NuevoInicioViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
@property (nonatomic, retain) IBOutlet MKMapView *mapa;
@property (nonatomic, retain) IBOutlet UITableView *tableView;
@property (nonatomic,strong) NSArray *eventos;
@property (weak, nonatomic) IBOutlet UILabel *categories;
@property (nonatomic,strong) NSArray *original;


Expand Down
22 changes: 12 additions & 10 deletions DejateCaer/NuevoInicioViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ - (void)viewDidLoad
[buscame setImage:[UIImage imageNamed:@"flecha.png"] forState:UIControlStateNormal];
buscame.frame = CGRectMake(mapa.frame.size.width-30, mapa.frame.size.height-30, 30, 30);
buscame.backgroundColor=[UIColor clearColor];

[mapa setShowsPointsOfInterest:FALSE];
[mapa addSubview:buscame];

UIButton *todos = [UIButton buttonWithType:UIButtonTypeRoundedRect];
Expand Down Expand Up @@ -1054,9 +1054,11 @@ -(IBAction)filtrar:(id)sender{
if ([eventos count]==0) {
UIAlertView *alerta=[[UIAlertView alloc]initWithTitle:@"Mensaje" message:@"No encontramos eventos cercanos a ti, intenta ampliando el radio de búsqueda" delegate:nil cancelButtonTitle:@"Aceptar" otherButtonTitles:nil, nil];
[alerta show];
_categories.text=@"Sin Eventos";
}
else{
[self.tableView reloadData];
_categories.text=@"Todos";
//hay que actualizae el mapa tambien falta pasar lo parametros de donde hará zoom el usuario
[self getMapa:posicionAux.latitude Y :posicionAux.longitude];
}
Expand All @@ -1071,7 +1073,7 @@ -(IBAction)filtrar:(id)sender{
// buscamos en todo el array de eventos la categoria para ir filtrantodolos

if ([ [[eventos objectAtIndex:i] objectForKey:@"categoria"] isEqualToString:@"Cine"] ) {

_categories.text=[[eventos objectAtIndex:i] objectForKey:@"categoria"];
[filtrados addObject:[eventos objectAtIndex:i]];
}

Expand Down Expand Up @@ -1107,7 +1109,7 @@ -(IBAction)filtrar:(id)sender{
// buscamos en todo el array de eventos la categoria para ir filtrantodolos

if ([ [[eventos objectAtIndex:i] objectForKey:@"categoria"] isEqualToString:@"Teatro"] ) {

_categories.text=[[eventos objectAtIndex:i] objectForKey:@"categoria"];
[filtrados addObject:[eventos objectAtIndex:i]];
}

Expand Down Expand Up @@ -1142,7 +1144,7 @@ -(IBAction)filtrar:(id)sender{
// buscamos en todo el array de eventos la categoria para ir filtrantodolos

if ([ [[eventos objectAtIndex:i] objectForKey:@"categoria"] isEqualToString:@"Infantiles"] ) {

_categories.text=[[eventos objectAtIndex:i] objectForKey:@"categoria"];
[filtrados addObject:[eventos objectAtIndex:i]];
}

Expand Down Expand Up @@ -1178,7 +1180,7 @@ -(IBAction)filtrar:(id)sender{
// buscamos en todo el array de eventos la categoria para ir filtrantodolos

if ([ [[eventos objectAtIndex:i] objectForKey:@"categoria"] isEqualToString:@"Cultura"] ) {

_categories.text=[[eventos objectAtIndex:i] objectForKey:@"categoria"];
[filtrados addObject:[eventos objectAtIndex:i]];
}

Expand Down Expand Up @@ -1213,7 +1215,7 @@ -(IBAction)filtrar:(id)sender{
// buscamos en todo el array de eventos la categoria para ir filtrantodolos

if ([ [[eventos objectAtIndex:i] objectForKey:@"categoria"] isEqualToString:@"Música"] ) {

_categories.text=[[eventos objectAtIndex:i] objectForKey:@"categoria"];
[filtrados addObject:[eventos objectAtIndex:i]];
}

Expand Down Expand Up @@ -1247,7 +1249,7 @@ -(IBAction)filtrar:(id)sender{
// buscamos en todo el array de eventos la categoria para ir filtrantodolos

if ([ [[eventos objectAtIndex:i] objectForKey:@"categoria"] isEqualToString:@"Aprendizaje"] ) {

_categories.text=[[eventos objectAtIndex:i] objectForKey:@"categoria"];
[filtrados addObject:[eventos objectAtIndex:i]];
}

Expand Down Expand Up @@ -1282,7 +1284,7 @@ -(IBAction)filtrar:(id)sender{
// buscamos en todo el array de eventos la categoria para ir filtrantodolos

if ([ [[eventos objectAtIndex:i] objectForKey:@"categoria"] isEqualToString:@"Tecnología"] ) {

_categories.text=[[eventos objectAtIndex:i] objectForKey:@"categoria"];
[filtrados addObject:[eventos objectAtIndex:i]];
}

Expand Down Expand Up @@ -1317,7 +1319,7 @@ -(IBAction)filtrar:(id)sender{
// buscamos en todo el array de eventos la categoria para ir filtrantodolos

if ([ [[eventos objectAtIndex:i] objectForKey:@"categoria"] isEqualToString:@"Exposiciones"] ) {

_categories.text=[[eventos objectAtIndex:i] objectForKey:@"categoria"];
[filtrados addObject:[eventos objectAtIndex:i]];
}

Expand Down Expand Up @@ -1353,7 +1355,7 @@ -(IBAction)filtrar:(id)sender{
// buscamos en todo el array de eventos la categoria para ir filtrantodolos

if ([ [[eventos objectAtIndex:i] objectForKey:@"categoria"] isEqualToString:@"Deportivo"] ) {

_categories.text=[[eventos objectAtIndex:i] objectForKey:@"categoria"];
[filtrados addObject:[eventos objectAtIndex:i]];
}

Expand Down

0 comments on commit 7cf1a34

Please sign in to comment.