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
// | |
// MNDocumentController.h | |
// MindNodeTouch | |
// | |
// Created by Markus Müller on 22.12.08. | |
// Copyright 2008 Markus Müller. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
@class MNDocumentReference; |
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 DrawInsetBeveledRoundedRect( CGContextRef context, CGRect rect, CGFloat radius, UIColor *fillColor ) | |
{ | |
//contract the bounds of the rectangle in to account for the stroke | |
CGRect drawRect = CGRectInset(rect, 1.0f, 1.0f); | |
//contract the height by 1 to account for the white bevel at the bottom | |
drawRect.size.height -= 1.0f; | |
//Save the current state so we don't persist anything beyond this operation | |
CGContextSaveGState(context); |
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
git=`sh /etc/profile; which git` | |
version=`$git describe --tags --always` | |
count=`$git rev-list --all |wc -l` | |
echo -e "#define GIT_VERSION $version\n#define GIT_COMMIT_COUNT $count" > InfoPlist.h |
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
<key>CFBundleShortVersionString</key> | |
<string>GIT_VERSION</string> | |
<key>CFBundleVersion</key> | |
<string>GIT_COMMIT_COUNT</string> |
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
echo InfoPlist.h >> .gitignore | |
# Note: With Xcode 4.3, it's no problem if the file doesn't exist before compilation. | |
# On Xcode 4.2, the file needs to be there. Either manually call "touch InfoPlist.h" | |
# or make an aggregate target that your main target depends on, adding the touch code there. |
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
# postprocess Info.plist to include the git hash | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion `git rev-list --all |wc -l`" "${INSTALL_DIR}/Versions/${FMK_VERSION}/Resources/Info.plist" | |
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString `git describe --tags`" "${INSTALL_DIR}/Versions/${FMK_VERSION}/Resources/Info.plist" |
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) dealloc | |
{ | |
// dealloc can trigger in background thread when the queued block is | |
// our last owner, and releases us on completion. | |
// Send the dealloc back to the main thread so we don't mess up UIKit. | |
if (dispatch_get_current_queue() != dispatch_get_main_queue()) { | |
__block id block_self = self; // don't auto-retain self! | |
dispatch_async(dispatch_get_main_queue(), ^{ [block_self dealloc]; }); | |
} else { | |
[imageView release]; |
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
// simple example how to re-color the link annotations | |
- (void)pdfViewController:(PSPDFViewController *)pdfController willShowAnnotationView:(UIView <PSPDFAnnotationView> *)annotationView onPageView:(PSPDFPageView *)pageView { | |
if ([annotationView isKindOfClass:[PSPDFLinkAnnotationView class]]) { | |
PSPDFLinkAnnotationView *linkAnnotation = (PSPDFLinkAnnotationView *)annotationView; | |
linkAnnotation.borderColor = [[UIColor blueColor] colorWithAlphaComponent:0.7f]; | |
} | |
} |
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
//// Bezier Drawing | |
UIBezierPath* bezierPath = [UIBezierPath bezierPath]; | |
[bezierPath moveToPoint: CGPointMake(31, 30.5)]; | |
[bezierPath addLineToPoint: CGPointMake(41, 22.5)]; | |
[bezierPath addLineToPoint: CGPointMake(41, 36.5)]; | |
[bezierPath addLineToPoint: CGPointMake(31, 30.5)]; | |
[bezierPath closePath]; | |
[[UIColor blackColor] setFill]; |
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
// Do I miss something obvious or is this the best way to detect if UIDocumentInteractionController is still open or not? | |
// (BOOL _isShowingOpenInMenu is in the class) | |
- (void)openInAction:(id)sender { | |
// do we need to dismiss a popover? | |
if ([self checkAndDismissPopoverForViewControllerClass:[UIDocumentInteractionController class] animated:YES]) { | |
return; | |
} | |