- 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
// clang -W -Wall -Wno-unused-parameter -framework Foundation -fobjc-arc test.m | |
#import <Foundation/Foundation.h> | |
#define IDARRAY(...) ((id[]){ __VA_ARGS__ }) | |
#define IDCOUNT(...) (sizeof(IDARRAY(__VA_ARGS__)) / sizeof(id)) | |
typedef id (^Tuple)(int); |
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
TARGET="$PROJECT_DIR/project/Info.plist" | |
echo $TARGET | |
if [ ! -f "$TARGET" ]; then | |
echo "missing file $TARGET" | |
exit 1; | |
fi | |
# the perl regex splits out the last part of a build number (ie: 1.1.1) and increments it by one | |
# if you have a build number that is more than 3 components, add a '\.\d+' into the first part of the regex. |
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
#import <Foundation/Foundation.h> | |
#import <objc/runtime.h> | |
@interface NSNotificationCenter (AllObservers) | |
- (NSSet *) my_observersForNotificationName:(NSString *)notificationName; | |
@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
# xcode-build-bump.sh | |
# @desc Auto-increment the build number every time the project is run. | |
# @usage | |
# 1. Select: your Target in Xcode | |
# 2. Select: Build Phases Tab | |
# 3. Select: Add Build Phase -> Add Run Script | |
# 4. Paste code below in to new "Run Script" section | |
# 5. Drag the "Run Script" below "Link Binaries With Libraries" | |
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0) |
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
// | |
// CellBackgroundView.h | |
// | |
// | |
#import <UIKit/UIKit.h> | |
typedef enum { | |
CellPositionTop, | |
CellPositionMiddle, |
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
- ( id ) methodWithOneParam:( id ) theParam { | |
// Do amazing stuff | |
return @"Srsly, Amazing!"; | |
} | |
- ( id ) methodWithFirst:( id ) firstParam | |
andSecond:( id ) secondParam | |
{ | |
// Do doubly amazing stuff |
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
// | |
// AVAsset+VideoOrientation.h | |
// | |
// Created by Luca Bernardi on 19/09/12. | |
// Copyright (c) 2012 Luca Bernardi. All rights reserved. | |
// | |
#import <AVFoundation/AVFoundation.h> | |
typedef enum { | |
LBVideoOrientationUp, //Device starts recording in Portrait |
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
#import <UIKit/UIKit.h> | |
@interface DrawView : UIView | |
@property (nonatomic) CGMutablePathRef drawingPath; | |
@property (nonatomic) CGPoint lastPoint; | |
@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
require 'rss/2.0' | |
require 'cgi' | |
require 'net/http' | |
host = Net::HTTP.new('bash.im', 443) | |
host.use_ssl = true | |
resp = host.get('https://bash.im/rss/') | |
data = resp.body | |
parsed = RSS::Parser.parse(data.gsub(/\<hr\>/, '<hr/>'), false) | |
parsed.items.each { |x| puts CGI::unescapeHTML(x.description.gsub("\n", "").gsub("<br>", "\n")); puts "%\n" } |
OlderNewer