This file contains hidden or 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
| #!/bin/sh | |
| # Script for managing build and version numbers using git and agvtool. | |
| # Change log: | |
| # v1.0 18-Jul-11 First public release. | |
| # v1.1 29-Sep-12 Launch git, agvtool via xcrun. | |
| version() { |
This file contains hidden or 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
| -(UIScrollView *)defaultScrollView | |
| { | |
| if (_defaultScrollView == nil) { | |
| UIScrollView *scrollView = nil; | |
| for (UIView *subview in [self subviews]) { | |
| if ([subview isKindOfClass:[UIScrollView class]]) { | |
| scrollView = (UIScrollView *)subview; | |
| } | |
| } | |
| if (scrollView == nil) { |
This file contains hidden or 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
| -(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch { | |
| NSLog(@"TAPPED"); | |
| //Touch gestures below top bar should not make the page turn. | |
| //EDITED Check for only Tap here instead. | |
| if ([gestureRecognizer isKindOfClass:[UITapGestureRecognizer class]]) { | |
| CGPoint touchPoint = [touch locationInView:self.view]; | |
| if(self.interfaceOrientation==UIInterfaceOrientationPortrait||self.interfaceOrientation==UIInterfaceOrientationPortraitUpsideDown) { | |
| NSString *imgURL = [NSString stringWithFormat:@"document.elementFromPoint(%f, %f).src", touchPoint.x, touchPoint.y]; | |
| NSString *urlToSave = [webV stringByEvaluatingJavaScriptFromString:imgURL]; |
This file contains hidden or 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 specific | |
| build/* | |
| *.pbxuser | |
| *.mode1v3 | |
| *.mode2v3 | |
| *.perspective | |
| *.perspectivev3 | |
| # xcode 4 | |
| xcuserdata | |
| project.xcworkspace |
This file contains hidden or 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
| *.pbxproj -crlf -diff -merge |
This file contains hidden or 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 <sys/utsname.h> | |
| enum { | |
| MODEL_IPHONE_SIMULATOR, | |
| MODEL_IPOD_TOUCH, | |
| MODEL_IPHONE, | |
| MODEL_IPHONE_3G | |
| }; | |
| @interface DeviceDetection : NSObject |
This file contains hidden or 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
| - (UIImage *)convertImageToGrayScale:(UIImage *)image | |
| { | |
| // Create image rectangle with current image width/height | |
| CGRect imageRect = CGRectMake(0, 0, image.size.width, image.size.height); | |
| // Grayscale color space | |
| CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceGray(); | |
| // Create bitmap content with current image size and grayscale colorspace | |
| CGContextRef context = CGBitmapContextCreate(nil, image.size.width, image.size.height, 8, 0, colorSpace, kCGImageAlphaNone); |
This file contains hidden or 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
| KEYWORDS="TODO|FIXME|\?\?\?:|\!\!\!:" | |
| find ${SRCROOT} \( -name "*.h" -or -name "*.m" \) -print0 | \ | |
| xargs -0 egrep --with-filename --line-number --only-matching "($KEYWORDS).*\$" | \ | |
| perl -p -e "s/($KEYWORDS)/ warning: \$1/" |
This file contains hidden or 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
| Here are some regex script use in vim to help you translate objc code to cpp version.It is not perfect since it just could translate nearly 80% code correctly. | |
| how to use it : | |
| 1.open mac terminal | |
| 2.run vim open the objec-code file | |
| 3.copy the regex below | |
| 4.click the edit->paste on the terminal menu | |
| 5.prees enter key | |
| 6.repeat step 4 - 5 seviral times | |
| 7.done |
This file contains hidden or 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
| function OnGUI() { | |
| var screenScale: float = Screen.width / 480.0; | |
| var scaledMatrix: Matrix4x4 = Matrix4x4.identity.Scale(Vector3(screenScale,screenScale,screenScale)); | |
| GUI.matrix = scaledMatrix; | |
| // then do the rest of your GUI as per normal, using the 480x320 screen size you had for your standard res iPhone app | |
| } |