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: 190d39feb0
  • 3 commits
  • 5 files changed
  • 0 commit comments
  • 1 contributor
Commits on Sep 04, 2011
@btjones btjones a little code style cleanup 54e5d42
@btjones btjones changed the callout button button action to fire on the UIControlEven…
…tTouchDown event instead of UIControlEventTouchUpInside for older devices which seemed to be delayed in responding
fda87ca
@btjones btjones incremented bundle version 190d39f
View
4 src/ArtAround/ArtAround-Info-Example.plist
@@ -21,9 +21,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleVersion</key>
- <string>0.2</string>
+ <string>0.3</string>
<key>CFBundleShortVersionString</key>
- <string>0.2</string>
+ <string>0.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
View
1  src/ArtAround/Classes/Utilities/Utilities.h
@@ -32,5 +32,6 @@ typedef enum {
- (void)setFilters:(NSArray *)filters forFilterType:(FilterType)filterType;
- (void)startActivity;
- (void)stopActivity;
++ (BOOL)isNewHardware;
@end
View
24 src/ArtAround/Classes/Utilities/Utilities.m
@@ -162,4 +162,28 @@ - (void)stopActivity {
}
}
+#pragma mark - device methods
+
+//determines if this is a newer device based on the screen scale and if this is an ipad or not
+//UIScreen scale is only available in ios 4+ and will be larger than 1.0 for retina devices
++ (BOOL)isNewHardware {
+
+ //is this an ipad
+ //not using UI_USER_INTERFACE_IDIOM because that returns NO when running an iPhone interface on an iPad
+ if (NSClassFromString(@"UIPopoverController")) {
+ return YES;
+ }
+
+ //is this a retina display device
+ UIScreen *screen = [UIScreen mainScreen];
+ if ([screen respondsToSelector:@selector(scale)]) {
+ if (screen.scale > 1.0f) {
+ return YES;
+ }
+ }
+
+ //default to no
+ return NO;
+}
+
@end
View
6 src/ArtAround/Classes/Views&Controllers/MapView.m
@@ -26,9 +26,9 @@ - (id)initWithFrame:(CGRect)frame
[aMap release];
//setup the map view
- [[self map] setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight];
- [[self map] setShowsUserLocation:YES];
- [self addSubview:[self map]];
+ [self.map setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight];
+ [self.map setShowsUserLocation:YES];
+ [self addSubview:self.map];
//initialize the share button
UIButton *aShareButton = [UIButton buttonWithType:UIButtonTypeCustom];
View
13 src/ArtAround/Classes/Views&Controllers/MapViewController.m
@@ -398,13 +398,22 @@ - (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *
//create the callout if it doesn't exist yet
if (!self.callout) {
+
+ //setup the callout view
CalloutAnnotationView *aCallout = [[CalloutAnnotationView alloc] initWithCoordinate:[(ArtAnnotation *)view.annotation coordinate] frame:CGRectMake(0.0f, 0.0f, 320.0f, 335.0f)];
- [aCallout setMapView:self.mapView.map];
- [aCallout.button addTarget:self action:@selector(calloutTapped) forControlEvents:UIControlEventTouchUpInside];
+ [aCallout setMapView:self.mapView.map];
[self setCallout:aCallout];
[aCallout release];
+
+ //newer devices respond bettern to the preferred UIControlEventTouchUpInside
+ //older devices seem delayed so use UIControlEventTouchDown
+ [aCallout.button addTarget:self action:@selector(calloutTapped) forControlEvents:([Utilities isNewHardware]) ? UIControlEventTouchUpInside : UIControlEventTouchDown];
+
} else {
+
+ //update the coordinate
[self.callout setCoordinate:[(ArtAnnotation *)view.annotation coordinate]];
+
}
//first move the annotation, set the new art, then add it to the map

No commit comments for this range

Something went wrong with that request. Please try again.