Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: ArtAround/artaround-ios
...
head fork: ArtAround/artaround-ios
compare: 05f1dc5d4f
Checking mergeability… Don't worry, you can still create the pull request.
  • 3 commits
  • 25 files changed
  • 0 commit comments
  • 1 contributor
Commits on Jan 24, 2012
@briancsinger briancsinger added image picker delegate to detail view 8f8d6c2
Commits on Jan 29, 2012
@briancsinger briancsinger 1/29 Commit
-Favorites - functionally complete.
-Added New Art Screen
-Added bar to bottom of Edit/Add Screen so the user can always see
Edit/Commit Button
9856efd
Commits on Jan 30, 2012
@briancsinger briancsinger able to submit art
- added art submission
- began work on image upload
05f1dc5
Showing with 412 additions and 51 deletions.
  1. +26 −3 src/ArtAround.xcodeproj/project.pbxproj
  2. +1 −1  src/ArtAround/ArtAround.xcdatamodeld/.xccurrentversion
  3. +1 −1  src/ArtAround/ArtAround.xcdatamodeld/ArtAround.xcdatamodel/contents
  4. +66 −0 src/ArtAround/ArtAround.xcdatamodeld/ArtAround2.xcdatamodel/contents
  5. +3 −1 src/ArtAround/Classes/AppDelegate/ArtAroundAppDelegate.m
  6. +3 −0  src/ArtAround/Classes/DataManagement/AAAPIManager.h
  7. +66 −3 src/ArtAround/Classes/DataManagement/AAAPIManager.m
  8. +15 −4 src/ArtAround/Classes/DataManagement/ArtParser.m
  9. +18 −0 src/ArtAround/Classes/DataManagement/FlickrAPIManager.m
  10. +3 −0  src/ArtAround/Classes/Models/Art.h
  11. +1 −0  src/ArtAround/Classes/Models/Art.m
  12. +5 −4 src/ArtAround/Classes/Utilities/Utilities.h
  13. +3 −9 src/ArtAround/Classes/Views&Controllers/AddDetailView.html
  14. +2 −0  src/ArtAround/Classes/Views&Controllers/AddDetailViewController.h
  15. +87 −5 src/ArtAround/Classes/Views&Controllers/AddDetailViewController.m
  16. +16 −0 src/ArtAround/Classes/Views&Controllers/DetailView.css
  17. +6 −5 src/ArtAround/Classes/Views&Controllers/DetailView.html
  18. +2 −1  src/ArtAround/Classes/Views&Controllers/DetailViewController.h
  19. +70 −8 src/ArtAround/Classes/Views&Controllers/DetailViewController.m
  20. +3 −3 src/ArtAround/Classes/Views&Controllers/FilterViewController.m
  21. +15 −3 src/ArtAround/Classes/Views&Controllers/MapViewController.m
  22. BIN  src/ArtAround/Images/FavoriteButton.png
  23. BIN  src/ArtAround/Images/FavoriteButton@2x.png
  24. BIN  src/ArtAround/Images/FavoriteButtonSelected.png
  25. BIN  src/ArtAround/Images/FavoriteButtonSelected@2x.png
View
29 src/ArtAround.xcodeproj/project.pbxproj
@@ -7,8 +7,13 @@
objects = {
/* Begin PBXBuildFile section */
+ C91B24B814CF624B000B342F /* FavoriteButtonSelected@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = C91B24B414CF624B000B342F /* FavoriteButtonSelected@2x.png */; };
+ C91B24B914CF624B000B342F /* FavoriteButton@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = C91B24B514CF624B000B342F /* FavoriteButton@2x.png */; };
+ C91B24BA14CF624B000B342F /* FavoriteButton.png in Resources */ = {isa = PBXBuildFile; fileRef = C91B24B614CF624B000B342F /* FavoriteButton.png */; };
+ C91B24BB14CF624B000B342F /* FavoriteButtonSelected.png in Resources */ = {isa = PBXBuildFile; fileRef = C91B24B714CF624B000B342F /* FavoriteButtonSelected.png */; };
C9722EB314CD116E00FC42E9 /* AddDetailView.html in Resources */ = {isa = PBXBuildFile; fileRef = C9722EB014CD116E00FC42E9 /* AddDetailView.html */; };
C9722EB414CD116E00FC42E9 /* AddDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C9722EB214CD116E00FC42E9 /* AddDetailViewController.m */; };
+ C9722EBA14CD19D600FC42E9 /* libz.1.2.5.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = C9722EB914CD19D600FC42E9 /* libz.1.2.5.dylib */; };
CA00943A1409509B00E5001E /* ArtAroundAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CA0093F01409509A00E5001E /* ArtAroundAppDelegate.m */; };
CA00943B1409509B00E5001E /* AAAPIManager.m in Sources */ = {isa = PBXBuildFile; fileRef = CA0093F31409509A00E5001E /* AAAPIManager.m */; };
CA00943C1409509B00E5001E /* AAManagedObjectContext.m in Sources */ = {isa = PBXBuildFile; fileRef = CA0093F51409509A00E5001E /* AAManagedObjectContext.m */; };
@@ -102,7 +107,6 @@
CAECF77914073D9100CD9A95 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CAECF77814073D9100CD9A95 /* CFNetwork.framework */; };
CAECF77B14073D9D00CD9A95 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CAECF77A14073D9D00CD9A95 /* SystemConfiguration.framework */; };
CAECF77D14073DA500CD9A95 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CAECF77C14073DA500CD9A95 /* MobileCoreServices.framework */; };
- CAECF77F14073DCA00CD9A95 /* libz.1.2.3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = CAECF77E14073DCA00CD9A95 /* libz.1.2.3.dylib */; };
CAFD5B1914107DCB0078D7B6 /* Facebook.m in Sources */ = {isa = PBXBuildFile; fileRef = CAFD5B0214107DCB0078D7B6 /* Facebook.m */; };
CAFD5B1A14107DCB0078D7B6 /* FBDialog.bundle in Resources */ = {isa = PBXBuildFile; fileRef = CAFD5B0414107DCB0078D7B6 /* FBDialog.bundle */; };
CAFD5B1B14107DCB0078D7B6 /* FBDialog.m in Sources */ = {isa = PBXBuildFile; fileRef = CAFD5B0614107DCB0078D7B6 /* FBDialog.m */; };
@@ -125,9 +129,15 @@
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
+ C91B24B414CF624B000B342F /* FavoriteButtonSelected@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "FavoriteButtonSelected@2x.png"; sourceTree = "<group>"; };
+ C91B24B514CF624B000B342F /* FavoriteButton@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "FavoriteButton@2x.png"; sourceTree = "<group>"; };
+ C91B24B614CF624B000B342F /* FavoriteButton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = FavoriteButton.png; sourceTree = "<group>"; };
+ C91B24B714CF624B000B342F /* FavoriteButtonSelected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = FavoriteButtonSelected.png; sourceTree = "<group>"; };
+ C922E11D14CF45F200DB6DBD /* ArtAround2.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = ArtAround2.xcdatamodel; sourceTree = "<group>"; };
C9722EB014CD116E00FC42E9 /* AddDetailView.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = AddDetailView.html; sourceTree = "<group>"; };
C9722EB114CD116E00FC42E9 /* AddDetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddDetailViewController.h; sourceTree = "<group>"; };
C9722EB214CD116E00FC42E9 /* AddDetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AddDetailViewController.m; sourceTree = "<group>"; };
+ C9722EB914CD19D600FC42E9 /* libz.1.2.5.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.1.2.5.dylib; path = usr/lib/libz.1.2.5.dylib; sourceTree = SDKROOT; };
CA0093EF1409509A00E5001E /* ArtAroundAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArtAroundAppDelegate.h; sourceTree = "<group>"; };
CA0093F01409509A00E5001E /* ArtAroundAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ArtAroundAppDelegate.m; sourceTree = "<group>"; };
CA0093F21409509A00E5001E /* AAAPIManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AAAPIManager.h; sourceTree = "<group>"; };
@@ -306,8 +316,8 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ C9722EBA14CD19D600FC42E9 /* libz.1.2.5.dylib in Frameworks */,
CA81FB3A1408AE40004BA05D /* libsqlite3.0.dylib in Frameworks */,
- CAECF77F14073DCA00CD9A95 /* libz.1.2.3.dylib in Frameworks */,
CA2A10EB14109BBE009001A2 /* MessageUI.framework in Frameworks */,
CAECF77D14073DA500CD9A95 /* MobileCoreServices.framework in Frameworks */,
CAECF77B14073D9D00CD9A95 /* SystemConfiguration.framework in Frameworks */,
@@ -449,6 +459,10 @@
CAEA5CFA140CA39D009345FD /* Default@2x.png */,
CA0F4924140F2D2B0064F072 /* DetailBackground.jpg */,
CA0F4925140F2D2C0064F072 /* DetailBackground@2x.jpg */,
+ C91B24B414CF624B000B342F /* FavoriteButtonSelected@2x.png */,
+ C91B24B514CF624B000B342F /* FavoriteButton@2x.png */,
+ C91B24B614CF624B000B342F /* FavoriteButton.png */,
+ C91B24B714CF624B000B342F /* FavoriteButtonSelected.png */,
CA1AE9DA140C906200C56C4D /* Filter.png */,
CA1AE9DB140C906200C56C4D /* Filter@2x.png */,
CAC02B83140DBFE10032C4E5 /* FilterBackground.png */,
@@ -588,6 +602,7 @@
isa = PBXGroup;
children = (
CA81FB391408AE40004BA05D /* libsqlite3.0.dylib */,
+ C9722EB914CD19D600FC42E9 /* libz.1.2.5.dylib */,
CAECF77E14073DCA00CD9A95 /* libz.1.2.3.dylib */,
CA2A10EA14109BBE009001A2 /* MessageUI.framework */,
CAECF77C14073DA500CD9A95 /* MobileCoreServices.framework */,
@@ -837,6 +852,10 @@
CAFD5B1A14107DCB0078D7B6 /* FBDialog.bundle in Resources */,
CAD47C1A1410AA5D0059C69A /* ArtAround-Info-Example.plist in Resources */,
C9722EB314CD116E00FC42E9 /* AddDetailView.html in Resources */,
+ C91B24B814CF624B000B342F /* FavoriteButtonSelected@2x.png in Resources */,
+ C91B24B914CF624B000B342F /* FavoriteButton@2x.png in Resources */,
+ C91B24BA14CF624B000B342F /* FavoriteButton.png in Resources */,
+ C91B24BB14CF624B000B342F /* FavoriteButtonSelected.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -941,6 +960,7 @@
buildSettings = {
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "ArtAround/ArtAround-Prefix.pch";
+ HEADER_SEARCH_PATHS = "";
INFOPLIST_FILE = "ArtAround/ArtAround-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
@@ -973,6 +993,7 @@
buildSettings = {
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "ArtAround/ArtAround-Prefix.pch";
+ HEADER_SEARCH_PATHS = "";
INFOPLIST_FILE = "ArtAround/ArtAround-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
@@ -1010,6 +1031,7 @@
buildSettings = {
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "ArtAround/ArtAround-Prefix.pch";
+ HEADER_SEARCH_PATHS = "";
INFOPLIST_FILE = "ArtAround/ArtAround-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
@@ -1045,9 +1067,10 @@
CA5E10E31405F0520075DAB8 /* ArtAround.xcdatamodeld */ = {
isa = XCVersionGroup;
children = (
+ C922E11D14CF45F200DB6DBD /* ArtAround2.xcdatamodel */,
CA5E10E41405F0520075DAB8 /* ArtAround.xcdatamodel */,
);
- currentVersion = CA5E10E41405F0520075DAB8 /* ArtAround.xcdatamodel */;
+ currentVersion = C922E11D14CF45F200DB6DBD /* ArtAround2.xcdatamodel */;
path = ArtAround.xcdatamodeld;
sourceTree = "<group>";
versionGroupType = wrapper.xcdatamodel;
View
2  src/ArtAround/ArtAround.xcdatamodeld/.xccurrentversion
@@ -3,6 +3,6 @@
<plist version="1.0">
<dict>
<key>_XCCurrentVersionName</key>
- <string>ArtAround.xcdatamodel</string>
+ <string>ArtAround2.xcdatamodel</string>
</dict>
</plist>
View
2  src/ArtAround/ArtAround.xcdatamodeld/ArtAround.xcdatamodel/contents
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<model name="" userDefinedModelVersionIdentifier="" type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="562" systemVersion="11B26" minimumToolsVersion="Automatic" macOSVersion="Automatic" iOSVersion="Automatic">
+<model name="" userDefinedModelVersionIdentifier="" type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="872" systemVersion="11C74" minimumToolsVersion="Automatic" macOSVersion="Automatic" iOSVersion="Automatic">
<entity name="Art" representedClassName="Art">
<attribute name="artist" optional="YES" attributeType="String"/>
<attribute name="createdAt" optional="YES" attributeType="Date"/>
View
66 src/ArtAround/ArtAround.xcdatamodeld/ArtAround2.xcdatamodel/contents
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<model name="" userDefinedModelVersionIdentifier="" type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="872" systemVersion="11C74" minimumToolsVersion="Automatic" macOSVersion="Automatic" iOSVersion="Automatic">
+ <entity name="Art" representedClassName="Art">
+ <attribute name="artist" optional="YES" attributeType="String"/>
+ <attribute name="createdAt" optional="YES" attributeType="Date"/>
+ <attribute name="favorite" attributeType="Boolean" defaultValueString="NO" syncable="YES"/>
+ <attribute name="latitude" optional="YES" attributeType="Decimal" defaultValueString="0.0"/>
+ <attribute name="locationDescription" optional="YES" attributeType="String"/>
+ <attribute name="longitude" optional="YES" attributeType="Decimal" defaultValueString="0.0"/>
+ <attribute name="slug" optional="YES" attributeType="String"/>
+ <attribute name="title" optional="YES" attributeType="String"/>
+ <attribute name="ward" optional="YES" attributeType="Integer 32"/>
+ <attribute name="year" optional="YES" attributeType="Integer 32"/>
+ <relationship name="category" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="Category" inverseName="arts" inverseEntity="Category"/>
+ <relationship name="comments" optional="YES" toMany="YES" deletionRule="Nullify" destinationEntity="Comment" inverseName="art" inverseEntity="Comment"/>
+ <relationship name="neighborhood" optional="YES" minCount="1" maxCount="1" deletionRule="Nullify" destinationEntity="Neighborhood" inverseName="arts" inverseEntity="Neighborhood"/>
+ <relationship name="photos" optional="YES" toMany="YES" deletionRule="Nullify" destinationEntity="Photo" inverseName="art" inverseEntity="Photo"/>
+ </entity>
+ <entity name="Category" representedClassName="Category">
+ <attribute name="title" optional="YES" attributeType="String"/>
+ <relationship name="arts" optional="YES" toMany="YES" deletionRule="Nullify" destinationEntity="Art" inverseName="category" inverseEntity="Art"/>
+ </entity>
+ <entity name="Comment" representedClassName="Comment">
+ <attribute name="approved" optional="YES" attributeType="Boolean"/>
+ <attribute name="createdAt" optional="YES" attributeType="Date"/>
+ <attribute name="name" optional="YES" attributeType="String"/>
+ <attribute name="text" optional="YES" attributeType="String"/>
+ <attribute name="url" optional="YES" attributeType="String"/>
+ <relationship name="art" optional="YES" minCount="1" maxCount="1" deletionRule="Nullify" destinationEntity="Art" inverseName="comments" inverseEntity="Art"/>
+ </entity>
+ <entity name="Neighborhood" representedClassName="Neighborhood">
+ <attribute name="title" optional="YES" attributeType="String"/>
+ <relationship name="arts" optional="YES" toMany="YES" deletionRule="Nullify" destinationEntity="Art" inverseName="neighborhood" inverseEntity="Art"/>
+ </entity>
+ <entity name="Photo" representedClassName="Photo">
+ <attribute name="flickrID" optional="YES" attributeType="Integer 64" defaultValueString="0"/>
+ <attribute name="mediumHeight" optional="YES" attributeType="Integer 32"/>
+ <attribute name="mediumSource" optional="YES" attributeType="String"/>
+ <attribute name="mediumURL" optional="YES" attributeType="String"/>
+ <attribute name="mediumWidth" optional="YES" attributeType="Integer 32"/>
+ <attribute name="originalHeight" optional="YES" attributeType="Integer 32"/>
+ <attribute name="originalSource" optional="YES" attributeType="String"/>
+ <attribute name="originalURL" optional="YES" attributeType="String"/>
+ <attribute name="originalWidth" optional="YES" attributeType="Integer 32"/>
+ <attribute name="smallHeight" optional="YES" attributeType="Integer 32"/>
+ <attribute name="smallSource" optional="YES" attributeType="String"/>
+ <attribute name="smallURL" optional="YES" attributeType="String"/>
+ <attribute name="smallWidth" optional="YES" attributeType="Integer 32"/>
+ <attribute name="squareHeight" optional="YES" attributeType="Integer 32"/>
+ <attribute name="squareSource" optional="YES" attributeType="String"/>
+ <attribute name="squareURL" optional="YES" attributeType="String"/>
+ <attribute name="squareWidth" optional="YES" attributeType="Integer 32"/>
+ <attribute name="thumbnailHeight" optional="YES" attributeType="Integer 32"/>
+ <attribute name="thumbnailSource" optional="YES" attributeType="String"/>
+ <attribute name="thumbnailURL" optional="YES" attributeType="String"/>
+ <attribute name="thumbnailWidth" optional="YES" attributeType="Integer 32"/>
+ <relationship name="art" optional="YES" minCount="1" maxCount="1" deletionRule="Nullify" destinationEntity="Art" inverseName="photos" inverseEntity="Art"/>
+ </entity>
+ <elements>
+ <element name="Art" positionX="-297" positionY="63" width="128" height="255"/>
+ <element name="Category" positionX="-486" positionY="108" width="128" height="75"/>
+ <element name="Comment" positionX="-110" positionY="63" width="128" height="135"/>
+ <element name="Neighborhood" positionX="-488" positionY="213" width="128" height="75"/>
+ <element name="Photo" positionX="-108" positionY="213" width="128" height="375"/>
+ </elements>
+</model>
View
4 src/ArtAround/Classes/AppDelegate/ArtAroundAppDelegate.m
@@ -205,9 +205,11 @@ - (NSPersistentStoreCoordinator *)persistentStoreCoordinator
NSURL *storeURL = [NSURL fileURLWithPath:[(NSString *)[self applicationDocumentsDirectory] stringByAppendingPathComponent: @"ArtAround.sqlite"]];
+ NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], NSMigratePersistentStoresAutomaticallyOption, [NSNumber numberWithBool:YES], NSInferMappingModelAutomaticallyOption, nil];
+
NSError *error = nil;
__persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]];
- if (![__persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:nil error:&error])
+ if (![__persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:options error:&error])
{
/*
Replace this implementation with code to handle the error appropriately.
View
3  src/ArtAround/Classes/DataManagement/AAAPIManager.h
@@ -8,11 +8,14 @@
#import <Foundation/Foundation.h>
+
@interface AAAPIManager : NSObject
//instance methods
- (void)downloadAllArtWithTarget:(id)target callback:(SEL)callback;
- (void)downloadConfigWithTarget:(id)target callback:(SEL)callback;
+- (void)submitArt:(NSDictionary*)art withTarget:(id)target callback:(SEL)callback;
+- (void)uploadImage:(UIImage*)image withTarget:(id)target callback:(SEL)callback;
- (NSArray *)categories;
- (NSArray *)neighborhoods;
- (NSArray *)titles;
View
69 src/ArtAround/Classes/DataManagement/AAAPIManager.m
@@ -10,6 +10,7 @@
#import <CoreData/CoreData.h>
#import <sqlite3.h>
#import "ASIHTTPRequest.h"
+#import "ASIFormDataRequest.h"
#import "ArtAroundAppDelegate.h"
#import "Art.h"
#import "Category.h"
@@ -20,7 +21,7 @@
#import "Utilities.h"
static AAAPIManager *_sharedInstance = nil;
-static const NSString *_kAPIRoot = @"http://theartaround.us/api/v1/";
+static const NSString *_kAPIRoot = @"http://staging.theartaround.us/api/v1/";
static const NSString *_kAPIFormat = @"json";
static const NSString *_kTargetKey = @"target";
static const NSString *_kCallbackKey = @"callback";
@@ -222,6 +223,10 @@ - (void)downloadAllArtWithTarget:(id)target callback:(SEL)callback
- (void)artRequestCompleted:(ASIHTTPRequest *)request
{
+
+ NSMutableString *responseData = [[NSMutableString alloc] initWithData:[request responseData] encoding:NSUTF8StringEncoding];
+ NSString *body = [[NSString alloc] initWithData:[request postBody] encoding:NSUTF8StringEncoding];
+
//parse the art in the background
[self performSelectorInBackground:@selector(parseArtRequest:) withObject:request];
}
@@ -251,6 +256,57 @@ - (void)artRequestFailed:(ASIHTTPRequest *)request
[[Utilities instance] stopActivity];
}
+#pragma mark - Art Upload Methods
+- (void)submitArt:(NSDictionary*)art withTarget:(id)target callback:(SEL)callback {
+
+ //setup the art's paramters
+ NSMutableDictionary *params = [[NSMutableDictionary alloc] initWithDictionary:art];
+ [params setObject:@"put" forKey:@"_method"];
+
+ //get the art upload url
+ NSURL *artUploadURL = [AAAPIManager apiURLForMethod:@"arts" parameters:params];
+
+ //start network activity indicator
+ [[Utilities instance] startActivity];
+
+ //pass along target and selector in userInfo
+ NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:target, _kTargetKey, [NSValue valueWithPointer:callback], _kCallbackKey, nil];
+
+ //setup and start the request
+ ASIHTTPRequest *request = [self requestWithURL:artUploadURL userInfo:userInfo];
+ [request setRequestMethod:@"POST"];
+ [request setDidFinishSelector:@selector(artRequestCompleted:)];
+ [request setDidFailSelector:@selector(artRequestFailed:)];
+ [request startAsynchronous];
+
+}
+
+
+#warning in progress
+- (void)uploadImage:(UIImage*)image withTarget:(id)target callback:(SEL)callback {
+
+ //get the photo upload url
+ NSURL *photoUploadURL = [AAAPIManager apiURLForMethod:@"arts/this-is-on-staging/photos"];
+
+ //start network activity indicator
+ [[Utilities instance] startActivity];
+
+ //pass along target and selector in userInfo
+ NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:target, _kTargetKey, [NSValue valueWithPointer:callback], _kCallbackKey, nil];
+
+ //setup and start the request
+ ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:photoUploadURL];
+ [request setUserInfo:userInfo];
+ [request setData:UIImageJPEGRepresentation(image, 1) forKey:@"file"];
+ //[request addData:UIImageJPEGRepresentation(image, 1) withFileName:@"myPhoto.jpg" andContentType:@"image/jpg" forKey:@"file"];
+ [request setDidFinishSelector:@selector(artRequestCompleted:)];
+ [request setDidFailSelector:@selector(artRequestFailed:)];
+ [request setTimeOutSeconds:60];
+ [request startAsynchronous];
+
+}
+
+
#pragma mark - Helper Methods
- (ASIHTTPRequest *)requestWithURL:(NSURL *)url userInfo:(NSDictionary *)userInfo
@@ -340,8 +396,15 @@ + (NSURL *)apiURLForMethod:(NSString *)method parameters:(NSDictionary *)paramet
//add each parameter passed
BOOL first = YES;
for (NSString* key in parametersDict) {
- NSString *value = [parametersDict objectForKey:key];
- urlString = [urlString stringByAppendingFormat:@"%@%@=%@", (first) ? @"?" : @"&", key, value];
+ //if the key is location[] then split the lat/long out of the coordinate
+ if ([key isEqualToString:@"location[]"]) {
+ urlString = [urlString stringByAppendingFormat:@"%@%@=%f&%@=%f", (first) ? @"?" : @"&", key, [(CLLocation*)[parametersDict objectForKey:key] coordinate].latitude, key, [(CLLocation*)[parametersDict objectForKey:key] coordinate].longitude];
+ }
+ else {
+ NSString *value = [parametersDict objectForKey:key];
+ urlString = [urlString stringByAppendingFormat:@"%@%@=%@", (first) ? @"?" : @"&", key, value];
+ }
+
first = NO;
}
View
19 src/ArtAround/Classes/DataManagement/ArtParser.m
@@ -83,6 +83,7 @@ + (Art *)artForDict:(NSDictionary *)artDict inContext:(NSManagedObjectContext *)
art.neighborhood = [NeighborhoodParser neighborhoodForTitle:[artDict objectForKey:@"neighborhood"] inContext:context];
art.photos = [PhotoParser setForFlickrIDs:[artDict objectForKey:@"flickr_ids"] inContext:context];
+
//make sure we don't have empty artist
if (art.artist) {
art.artist = [art.artist stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
@@ -93,14 +94,24 @@ + (Art *)artForDict:(NSDictionary *)artDict inContext:(NSManagedObjectContext *)
art.artist = @"Unknown";
}
+
//location
NSArray *location = [artDict objectForKey:@"location"];
if ([location count] >= 2) {
- art.latitude = [AAAPIManager clean:[location objectAtIndex:0]];
- art.longitude = [AAAPIManager clean:[location objectAtIndex:1]];
+ //check to see if this object is a string or number
+ if ([[location objectAtIndex:0] isKindOfClass:[NSString class]])
+ art.latitude = [NSDecimalNumber decimalNumberWithString:[AAAPIManager clean:[location objectAtIndex:0]]];
+ else
+ art.latitude = [AAAPIManager clean:[location objectAtIndex:0]];
+
+ //check to see if this object is a string or number
+ if ([[location objectAtIndex:0] isKindOfClass:[NSString class]])
+ art.longitude = [NSDecimalNumber decimalNumberWithString:[AAAPIManager clean:[location objectAtIndex:1]]];
+ else
+ art.longitude = [AAAPIManager clean:[location objectAtIndex:1]];
+
}
-
- //todo: comments
+
return art;
}
View
18 src/ArtAround/Classes/DataManagement/FlickrAPIManager.m
@@ -13,6 +13,7 @@
static FlickrAPIManager *_sharedInstance = nil;
static const NSString *_kAPIRoot = @"http://api.flickr.com/services/rest/";
+static const NSString *_kAPIUpladRoot = @"http://api.flickr.com/services/upload/";
static const NSString *_kAPIFormat = @"json";
static const NSString *_kTargetKey = @"target";
static const NSString *_kCallbackKey = @"callback";
@@ -45,6 +46,23 @@ + (const NSString *)flickrIDKey
return _kFlickrIDKey;
}
+#pragma mark - Flickr Upload Methods
+- (void)uploadPhotoWithImage:(UIImage *)image target:(id)target callback:(SEL)callback
+{
+ //start network activity indicator
+ [[Utilities instance] startActivity];
+
+ //pass along target and selector in userInfo
+ NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:target, _kTargetKey, [NSValue valueWithPointer:callback], _kCallbackKey, nil];
+
+ //setup and start the request
+ NSDictionary *params = [NSDictionary dictionaryWithObject:UIImagePNGRepresentation(image) forKey:@"photo"];
+ ASIHTTPRequest *request = [self requestWithURL:[self apiURLForMethod:@"flickr.photos.getSizes" parameters:params] userInfo:userInfo];
+ [request setDidFinishSelector:@selector(photoRequestCompleted:)];
+ [request setDidFailSelector:@selector(photoRequestFailed:)];
+ [request startAsynchronous];
+}
+
#pragma mark - Flickr Download Methods
- (void)downloadPhotoWithID:(NSNumber *)flickrID target:(id)target callback:(SEL)callback
View
3  src/ArtAround/Classes/Models/Art.h
@@ -27,6 +27,9 @@
@property (nonatomic, retain) NSSet *comments;
@property (nonatomic, retain) Neighborhood *neighborhood;
@property (nonatomic, retain) NSSet *photos;
+
+//new v2 props
+@property (nonatomic, retain) NSNumber * favorite;
@end
@interface Art (CoreDataGeneratedAccessors)
View
1  src/ArtAround/Classes/Models/Art.m
@@ -27,5 +27,6 @@ @implementation Art
@dynamic comments;
@dynamic neighborhood;
@dynamic photos;
+@dynamic favorite;
@end
View
9 src/ArtAround/Classes/Utilities/Utilities.h
@@ -11,10 +11,11 @@
typedef enum {
FilterTypeNone = 0,
- FilterTypeCategory = 1,
- FilterTypeNeighborhood = 2,
- FilterTypeTitle = 3,
- FilterTypeArtist = 4,
+ FilterTypeFavorites = 1,
+ FilterTypeCategory = 2,
+ FilterTypeNeighborhood = 3,
+ FilterTypeTitle = 4,
+ FilterTypeArtist = 5,
} FilterType;
@interface Utilities : NSObject
View
12 src/ArtAround/Classes/Views&Controllers/AddDetailView.html
@@ -51,10 +51,7 @@
Artist: <input type="text" id="artistInput" name="artistInput" selectBoxOptions="Canada;Denmark;Finland;Germany;Mexico;Norway;Sweden;United Kingdom;United States"> <br>
Date: <input type="month" id="yearInput"/>
Category: <select id="categoryInput">
- <option value="volvo">Volvo</option>
- <option value="saab">Saab</option>
- <option value="fiat">Fiat</option>
- <option value="audi">Audi</option>
+ %@
</select> <br>
</div>
@@ -63,17 +60,14 @@
<div id="location" class="section light">
Area: <select id="areaInput">
- <option value="volvo">Volvo</option>
- <option value="saab">Saab</option>
- <option value="fiat">Fiat</option>
- <option value="audi">Audi</option>
+ %@
</select>
Ward: <input type="text" id="wardInput"/> <br>
<input type="text" id="areaDescription" placeholder="Enter a description of the location..." /> <br>
</div>
<div id "location">
- <h2>Your coordinates: XXX, XXX</h2>
+ <h2>Your coordinates: %@, %@</h2>
</div>
<div id="map" class="section dark">
View
2  src/ArtAround/Classes/Views&Controllers/AddDetailViewController.h
@@ -10,4 +10,6 @@
@interface AddDetailViewController : DetailViewController <UIActionSheetDelegate>
+@property (nonatomic, retain) CLLocation *currentLocation;
+
@end
View
92 src/ArtAround/Classes/Views&Controllers/AddDetailViewController.m
@@ -8,16 +8,24 @@
#import "AddDetailViewController.h"
#import "DetailView.h"
+#import "Art.h"
+#import "Category.h"
+#import "Neighborhood.h"
+#import "AAAPIManager.h"
+#import "ItemParser.h"
@interface AddDetailViewController (private)
- (NSString *)yearString;
- (NSString *)category;
- (NSString *)artName;
- (NSString *)artistName;
+- (BOOL)validateFieldsReadyToSubmit;
@end
@implementation AddDetailViewController
+@synthesize currentLocation;
+
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
@@ -35,23 +43,97 @@ - (void)didReceiveMemoryWarning
// Release any cached data, images, etc that aren't in use.
}
+
+//return YES if title & category have been filled in; no otherwise
+- (BOOL)validateFieldsReadyToSubmit
+{
+ //make sure the title and category have been selected
+ if ([[self category] length] > 0 && [[self artName] length] > 0)
+ return YES;
+ else
+ return NO;
+}
+
+//Submit button tapped
- (void)bottomToolbarButtonTapped
{
-
- UIAlertView *todoAlert = [[UIAlertView alloc] initWithTitle:@"Submit TODO" message:@"" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
- [todoAlert show];
+ //validate title/category field
+ if (![self validateFieldsReadyToSubmit]) {
+ UIAlertView *todoAlert = [[UIAlertView alloc] initWithTitle:@"Need More Info" message:@"You must enter a title and category to submit art." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
+ [todoAlert show];
+ return;
+ }
+
+ //get the title & cat
+ NSString *aTitle = [self artName];
+ NSString *aCat = [self category];
+
+ //create the art parameters dictionary
+ NSMutableDictionary *params = [[NSMutableDictionary alloc] initWithObjectsAndKeys:aTitle, @"title", aCat, @"category", self.currentLocation, @"location[]", nil];
+
+ //get the year if it exists
+ if ([self yearString] && [[self yearString] length] > 0)
+ [params setObject:[self yearString] forKey:@"year"];
+
+ //get the artist if it exists
+ if ([self artistName] && [[self artistName] length] > 0)
+ [params setObject:[self artistName] forKey:@"artist"];
+
+
+ //call the submit request
+ [[AAAPIManager instance] submitArt:params withTarget:self callback:nil];
}
+
+//override the buildHTMLString method for Add view
+- (NSString*)buildHTMLString
+{
+
+ //setup the template
+ NSString *templatePath = [[NSBundle mainBundle] pathForResource:@"AddDetailView" ofType:@"html"];
+ NSString *template = [NSString stringWithContentsOfFile:templatePath encoding:NSUTF8StringEncoding error:NULL];
+
+ //get the categories
+ NSMutableArray *catsArray = [[NSMutableArray alloc] initWithArray:[[[AAAPIManager instance] categories] copy]];
+
+ //don't include the "all" category
+ [catsArray removeObject:@"All"];
+
+ //setup categories
+ NSString *categoriesString = @"";
+ for (NSString *cat in catsArray) {
+ categoriesString = [NSString stringWithFormat:@"%@<option value=\"%@\">%@</option>", categoriesString, cat, cat, nil];
+ }
+
+ //get the neighborhoods
+ NSMutableArray *neighborhoodsArray = [[NSMutableArray alloc] initWithArray:[[[AAAPIManager instance] neighborhoods] copy]];
+
+ //don't include the "all" category
+ [neighborhoodsArray removeObject:@""];
+ [neighborhoodsArray removeObject:@"All"];
+
+ //setup categories
+ NSString *neighborhoodsString = @"";
+ for (NSString *n in neighborhoodsArray) {
+ neighborhoodsString = [NSString stringWithFormat:@"%@<option value=\"%@\">%@</option>", neighborhoodsString, n, n, nil];
+ }
+
+
+ NSString *html = [NSString stringWithFormat:template, categoriesString, neighborhoodsString, [NSString stringWithFormat:@"%f",self.currentLocation.coordinate.latitude], [NSString stringWithFormat:@"%f",self.currentLocation.coordinate.longitude], nil];
+
+ return html;
+}
+
#pragma mark - ArtInfo
- (NSString *)yearString
{
- return [self.detailView.webView stringByEvaluatingJavaScriptFromString:@"getCategory();"];
+ return [self.detailView.webView stringByEvaluatingJavaScriptFromString:@"getYear();"];
}
- (NSString *)category
{
- return [self.detailView.webView stringByEvaluatingJavaScriptFromString:@"getYear();"];
+ return [self.detailView.webView stringByEvaluatingJavaScriptFromString:@"getCategory();"];
}
- (NSString *)artName
View
16 src/ArtAround/Classes/Views&Controllers/DetailView.css
@@ -29,6 +29,7 @@ h2 {
border-color: #524a4b;
border-style: solid;
border-width: 9px 0;
+
}
.dark {
@@ -38,17 +39,21 @@ h2 {
.section {
}
+
+
#artist {
}
#artist_info {
margin: 1px 0 3px 0;
+ max-width: 70%;
}
#category {
font-family: 'Helvetica-Bold', serif;
font-size: 9px;
text-transform: uppercase;
+ max-width: 70%;
}
#details {
@@ -56,8 +61,18 @@ h2 {
background-color: #f1eee9;
background-image: url('DetailBackground.jpg');
background-position: center;
+
}
+#favoriteButton {
+ margin: 1px 0 3px 0;
+ max-width: 30%;
+ position:absolute;
+ right:5px;
+}
+
+
+
#location {
padding: 8px 12px;
}
@@ -86,6 +101,7 @@ h2 {
}
#title {
+ max-width: 70%;
}
#ward {
View
11 src/ArtAround/Classes/Views&Controllers/DetailView.html
@@ -31,11 +31,12 @@
<body>
<div id="details" class="section light">
- <h1 id="title">%@</h1>
- <div id="artist_info">
- <span id="artist">%@</span> - <span id="year">%@</span>
- </div>
- <span id="category">%@<span>
+ <img id="favoriteButton" ONCLICK="window.location.href='artaround://favoriteButtonTapped'" src="%@" />
+ <h1 id="title">%@</h1>
+ <div id="artist_info">
+ <span id="artist">%@</span> - <span id="year">%@</span>
+ </div>
+ <span id="category">%@<span>
</div>
<div id="photos" class="section dark">
View
3  src/ArtAround/Classes/Views&Controllers/DetailViewController.h
@@ -20,7 +20,7 @@ typedef enum AAShareType {
AAShareTypeFacebook = 2
} AAShareType;
-@interface DetailViewController : UIViewController <UIWebViewDelegate, MKMapViewDelegate, UIActionSheetDelegate, FBDialogDelegate, FBSessionDelegate, MFMailComposeViewControllerDelegate>
+@interface DetailViewController : UIViewController <UIWebViewDelegate, MKMapViewDelegate, UIActionSheetDelegate, FBDialogDelegate, FBSessionDelegate, MFMailComposeViewControllerDelegate, UIImagePickerControllerDelegate>
{
ArtAroundAppDelegate *_appDelegate;
Facebook *_facebook;
@@ -28,6 +28,7 @@ typedef enum AAShareType {
- (void)setArt:(Art *)art withTemplate:(NSString*)templateFileName;
- (void)bottomToolbarButtonTapped;
+- (NSString*)buildHTMLString;
@property (nonatomic, retain) DetailView *detailView;
@property (nonatomic, assign) Art *art;
View
78 src/ArtAround/Classes/Views&Controllers/DetailViewController.m
@@ -17,6 +17,7 @@
#import "Photo.h"
#import "EGOImageView.h"
#import <QuartzCore/QuartzCore.h>
+#import "AAAPIManager.h"
@interface DetailViewController (private)
- (void)updateNativeFrames;
@@ -28,6 +29,7 @@ - (void)shareViaEmail;
- (NSString *)shareMessage;
- (NSString *)shareURL;
- (void)addImageButtonTapped;
+- (void)favoriteButtonTapped;
@end
#define _kAddImageActionSheet 100
@@ -79,16 +81,11 @@ - (void)setArt:(Art *)art withTemplate:(NSString*)templateFileName
//assign the art
_art = art;
- //don't show "0" year
- NSString *year = (_art.year && [_art.year intValue] != 0) ? [_art.year stringValue] : @"Unknown";
-
//setup the template
- NSString *templatePath = [[NSBundle mainBundle] pathForResource:(templateFileName) ? templateFileName : @"DetailView" ofType:@"html"];
- NSString *template = [NSString stringWithContentsOfFile:templatePath encoding:NSUTF8StringEncoding error:NULL];
- NSString *html = [NSString stringWithFormat:template, _art.title, _art.artist, year, _art.category.title, _art.neighborhood.title, [_art.ward stringValue], _art.locationDescription];
-
+ NSString *htmlString = [self buildHTMLString];
+
//load the html
- [self.detailView.webView loadHTMLString:html baseURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]]];
+ [self.detailView.webView loadHTMLString:htmlString baseURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]]];
//load images that we already have a source for
[self setupImages];
@@ -290,6 +287,40 @@ - (void)bottomToolbarButtonTapped
}
+- (void)favoriteButtonTapped {
+
+ //switch the art's favorite property
+ _art.favorite = [NSNumber numberWithBool:![_art.favorite boolValue]];
+
+ //if the filter type is favorites then refresh the mapview so that the updated favorites are showing
+ if ([Utilities instance].selectedFilterType == FilterTypeFavorites) {
+ ArtAroundAppDelegate *appDelegate = (id)[[UIApplication sharedApplication] delegate];
+ [appDelegate saveContext];
+ [appDelegate.mapViewController updateArt];
+ }
+
+ //reload the webview --
+ //setup the template
+ NSString *htmlString = [self buildHTMLString];
+
+ //load the html
+ [self.detailView.webView loadHTMLString:htmlString baseURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]]];
+}
+
+- (NSString*)buildHTMLString
+{
+ //don't show "0" year
+ NSString *year = (_art.year && [_art.year intValue] != 0) ? [_art.year stringValue] : @"Unknown";
+
+ //setup the template
+ NSString *templatePath = [[NSBundle mainBundle] pathForResource:@"DetailView" ofType:@"html"];
+ NSString *template = [NSString stringWithContentsOfFile:templatePath encoding:NSUTF8StringEncoding error:NULL];
+ NSString *favButtonImageSrc = ([_art.favorite boolValue]) ? @"FavoriteButtonSelected.png" : @"FavoriteButton.png";
+ NSString *html = [NSString stringWithFormat:template, favButtonImageSrc, _art.title, _art.artist, year, _art.category.title, _art.neighborhood.title, [_art.ward stringValue], _art.locationDescription];
+
+ return html;
+}
+
#pragma mark - View lifecycle
- (void)viewDidLoad
@@ -342,6 +373,15 @@ - (void)webViewDidFinishLoad:(UIWebView *)webView
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
+ //url location
+ NSString *url = [[request URL] absoluteString];
+
+ //video play link
+ if ([url rangeOfString:@"artaround://favoriteButtonTapped"].location != NSNotFound) {
+ [self favoriteButtonTapped];
+ return NO;
+ }
+
return YES;
}
@@ -503,6 +543,7 @@ - (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSIn
case 0:
{
UIImagePickerController *imgPicker = [[UIImagePickerController alloc] init];
+ imgPicker.delegate = self;
imgPicker.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentModalViewController:imgPicker animated:YES];
break;
@@ -511,6 +552,7 @@ - (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSIn
{
UIImagePickerController *imgPicker = [[UIImagePickerController alloc] init];
imgPicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
+ imgPicker.delegate = self;
[self presentModalViewController:imgPicker animated:YES];
break;
}
@@ -563,5 +605,25 @@ - (void)mailComposeController:(MFMailComposeViewController*)controller didFinish
[self dismissModalViewControllerAnimated:YES];
}
+#pragma mark - UIImagePickerControllerDelegate
+
+- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo {
+
+ [[AAAPIManager instance] uploadImage:image withTarget:self callback:nil];
+
+ [self dismissModalViewControllerAnimated:YES];
+}
+
+- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
+{
+ [[AAAPIManager instance] uploadImage:[info objectForKey:UIImagePickerControllerOriginalImage] withTarget:self callback:nil];
+
+ [self dismissModalViewControllerAnimated:YES];
+}
+
+- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker
+{
+ [self dismissModalViewControllerAnimated:YES];
+}
@end
View
6 src/ArtAround/Classes/Views&Controllers/FilterViewController.m
@@ -20,7 +20,7 @@ @implementation FilterViewController
+ (NSArray *)filterTypeTitles
{
if (!_kFilterTypes) {
- _kFilterTypes = [[NSArray alloc] initWithObjects:@"Don't Filter", @"Category", @"Neighborhood", @"Title", @"Artist", nil];
+ _kFilterTypes = [[NSArray alloc] initWithObjects:@"Don't Filter", @"Favorites", @"Category", @"Neighborhood", @"Title", @"Artist", nil];
}
return _kFilterTypes;
}
@@ -169,7 +169,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
if (indexPath.row == [[Utilities instance] selectedFilterType]) {
cell.accessoryType = UITableViewCellAccessoryCheckmark;
} else {
- if (indexPath.row == 0) {
+ if (indexPath.row <= 1) {
cell.accessoryType = UITableViewCellAccessoryNone;
} else {
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
@@ -249,7 +249,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
}
//if this is the top level?
- if (_isTopLevel && indexPath.row != 0) {
+ if (_isTopLevel && indexPath.row > 1) {
//dig deeper based on the filter type selected
FilterViewController *filterController = [[FilterViewController alloc] initWithFilterType:indexPath.row];
View
18 src/ArtAround/Classes/Views&Controllers/MapViewController.m
@@ -73,7 +73,8 @@ - (void)loadView
centerDC.latitude = 38.895;
centerDC.longitude = -77.022;
[self.mapView.map setRegion:[self.mapView.map regionThatFits:MKCoordinateRegionMake(centerDC, spanDC)]];
-
+ [self.mapView.map setShowsUserLocation:YES];
+
//setup button actions
[self.mapView.shareButton addTarget:self action:@selector(shareButtonTapped) forControlEvents:UIControlEventTouchUpInside];
[self.mapView.filterButton addTarget:self action:@selector(filterButtonTapped) forControlEvents:UIControlEventTouchUpInside];
@@ -148,9 +149,16 @@ - (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSIn
-(void)addButtonTapped
{
+ //create the add controller
AddDetailViewController *detailController = [[AddDetailViewController alloc] init];
+
+ //set the location coord to the user's location
+ detailController.currentLocation = self.mapView.map.userLocation.location;
+
+ //push add controller onto nav
[self.navigationController pushViewController:detailController animated:YES];
- //[detailController setArt:selectedArt];
+
+ //set the art for the controller & release
[detailController setArt:nil withTemplate:@"AddDetailView"];
[detailController release];
}
@@ -248,7 +256,11 @@ - (void)updateArt
//setup the proper delegate for the selected filter
switch ([Utilities instance].selectedFilterType) {
- case FilterTypeArtist: {
+ case FilterTypeFavorites: {
+ [fetchRequest setPredicate:[NSPredicate predicateWithFormat:@"favorite == TRUE", nil]];
+ break;
+ }
+ case FilterTypeArtist: {
NSArray *artists = [[Utilities instance] getFiltersForFilterType:FilterTypeArtist];
if (artists) {
[fetchRequest setPredicate:[NSPredicate predicateWithFormat:@"artist IN %@", artists]];
View
BIN  src/ArtAround/Images/FavoriteButton.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  src/ArtAround/Images/FavoriteButton@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  src/ArtAround/Images/FavoriteButtonSelected.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  src/ArtAround/Images/FavoriteButtonSelected@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

No commit comments for this range

Something went wrong with that request. Please try again.