-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from GusGA/develop
Primera versión estable
- Loading branch information
Showing
17 changed files
with
1,377 additions
and
518 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/Pods | ||
Podfile.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
platform :osx, '10.9' | ||
|
||
pod 'AFNetworking', '~> 2.0' |
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
...tatus-bar.xcworkspace/xcuserdata/Gustavo.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Bucket | ||
type = "0" | ||
version = "2.0"> | ||
</Bucket> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// GGLechuga.h | ||
// lechuga-status-bar | ||
// | ||
// Created by Gustavo Gimenez on 7/25/14. | ||
// Copyright (c) 2014 Gustavo Gimenez. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
#import "AFHTTPSessionManager.h" | ||
|
||
@interface GGLechuga : NSObject | ||
|
||
@property (nonatomic, strong) NSDictionary *usdData; | ||
@property (nonatomic, strong) NSDictionary *euroData; | ||
|
||
- (void) jsonRequest; | ||
- (void) updateRates; | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// | ||
// GGLechuga.m | ||
// lechuga-status-bar | ||
// | ||
// Created by Gustavo Gimenez on 7/25/14. | ||
// Copyright (c) 2014 Gustavo Gimenez. All rights reserved. | ||
// | ||
|
||
#import "GGLechuga.h" | ||
#import "AFHTTPRequestOperation.h" | ||
|
||
@interface GGLechuga () | ||
|
||
@property (nonatomic, strong) NSMutableDictionary *fullData; | ||
|
||
@end | ||
|
||
@implementation GGLechuga | ||
|
||
#pragma mark - init | ||
|
||
- (id) init { | ||
self = [super init]; | ||
if (self){ | ||
[self updateRates]; | ||
} | ||
return self; | ||
} | ||
|
||
|
||
|
||
- (void) updateRates { | ||
[self jsonRequest]; | ||
[self performSelector:@selector(setCurrenciesDictionaries) withObject:nil afterDelay:2.0]; | ||
} | ||
- (void) jsonRequest { | ||
NSURL *url = [NSURL URLWithString:@"https://lechuga.herokuapp.com/"]; | ||
AFHTTPRequestOperation *requestOperation = [[AFHTTPRequestOperation alloc]initWithRequest:[NSURLRequest | ||
requestWithURL:url]]; | ||
|
||
[requestOperation setResponseSerializer:[AFHTTPResponseSerializer serializer]]; | ||
|
||
[requestOperation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) { | ||
NSError *err; | ||
self.fullData = [[NSMutableDictionary alloc] initWithDictionary:[NSJSONSerialization JSONObjectWithData:responseObject options:0 error:&err]]; | ||
|
||
} failure:^(AFHTTPRequestOperation *operation, NSError *error){ | ||
NSLog(@"Oops, something went wrong: %@", [error localizedDescription]); | ||
}]; | ||
|
||
[requestOperation start]; | ||
} | ||
|
||
|
||
- (void)setCurrenciesDictionaries { | ||
|
||
self.usdData = [NSDictionary dictionaryWithDictionary:[self.fullData objectForKey:@"USD"]]; | ||
self.euroData = [NSDictionary dictionaryWithDictionary:[self.fullData objectForKey:@"EUR"]]; | ||
} | ||
|
||
@end |
13 changes: 13 additions & 0 deletions
13
lechuga-status-bar/Images.xcassets/dollar.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x", | ||
"filename" : "dollar@2x.png" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions
17
lechuga-status-bar/Images.xcassets/dollar_highligth.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x", | ||
"filename" : "dollar_highligth@2x.png" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Binary file added
BIN
+558 Bytes
...ga-status-bar/Images.xcassets/dollar_highligth.imageset/dollar_highligth@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,15 @@ | ||
{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} | ||
{\rtf1\ansi\ansicpg1252\cocoartf1265\cocoasubrtf210 | ||
{\fonttbl\f0\fswiss\fcharset0 Helvetica;} | ||
{\colortbl;\red255\green255\blue255;} | ||
\paperw9840\paperh8400 | ||
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural | ||
\vieww9600\viewh8400\viewkind0 | ||
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720 | ||
|
||
\f0\b\fs24 \cf0 Engineering: | ||
\b0 \ | ||
Some people\ | ||
\ | ||
|
||
\b Human Interface Design: | ||
\b0 \ | ||
Some other people\ | ||
\ | ||
|
||
\b Testing: | ||
\b0 \ | ||
Hopefully not nobody\ | ||
\ | ||
|
||
\b Documentation: | ||
\b0 \ | ||
Whoever\ | ||
Gustavo Gim\'e9nez\ | ||
\ | ||
|
||
\b With special thanks to: | ||
\b0 \ | ||
Mom\ | ||
} | ||
Dolar Today\ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
|
||
// | ||
// main.m | ||
// lechuga-status-bar | ||
|