- Create a UIView subclass for the pin callout view.
- Create a subclass of MKAnnotationView for your map pins.
- Add an instance of the callout view subclass to your MKAnnotationView subclass.
- Add a property to toggle the callout view to your MKAnnotationView subclass. This example fades in/out:
- (void)setShowCustomCallout:(BOOL)showCustomCallout { [self setShowCustomCallout:showCustomCallout animated:NO]; }
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
The future is no longer a synonym for "progress." |
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
CG_INLINE CGRect CGRectIntegralCenteredInRect(CGRect innerRect, CGRect outerRect) | |
{ | |
CGFloat originX = floorf((outerRect.size.width - innerRect.size.width) * 0.5f); | |
CGFloat originY = floorf((outerRect.size.height - innerRect.size.height) * 0.5f); | |
return CGRectMake(originX, originY, innerRect.size.width, innerRect.size.height); | |
} |
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
- (void)imagePickerController:(UIImagePickerController *)picker | |
didFinishPickingMediaWithInfo:(NSDictionary *)info | |
{ | |
NSURL *assetURL = info[UIImagePickerControllerReferenceURL]; | |
ALAssetsLibrary *assetLibrary = [[ALAssetsLibrary alloc] init]; | |
[assetLibrary assetForURL:assetURL resultBlock:^(ALAsset *asset) { | |
ALAssetRepresentation *representation = [asset defaultRepresentation]; | |
Byte *buffer = (Byte *)malloc(representation.size); |
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
// | |
// BHInsetLabel.h | |
// Created by Bryan Hansen on 5/7/13. | |
// | |
#import <UIKit/UIKit.h> | |
@interface BHInsetLabel : UILabel | |
@property (nonatomic, assign) UIEdgeInsets contentInsets; |
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
######################### | |
# .gitignore file for Xcode4 / OS X Source projects | |
# | |
# Version 2.0 | |
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects | |
# | |
# 2013 updates: | |
# - fixed the broken "save personal Schemes" | |
# | |
# NB: if you are storing "built" products, this WILL NOT WORK, |