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 <UIKit/UIKit.h> | |
| #import <UIKit/UIGestureRecognizerSubclass.h> | |
| typedef enum { | |
| DirectionPangestureRecognizerVertical, | |
| DirectionPanGestureRecognizerHorizontal | |
| } DirectionPangestureRecognizerDirection; | |
| @interface DirectionPanGestureRecognizer : UIPanGestureRecognizer |
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+zoomToCenterWithScale.h | |
| // locationme | |
| // | |
| // Created by 金燕赖 on 14-6-22. | |
| // Copyright (c) 2014年 ljy. All rights reserved. | |
| // | |
| #import <UIKit/UIKit.h> |
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
| - (NSMutableAttributedString*)fixLastLineMissBugWhenDrawWithCoreText:(NSMutableAttributedString*)content | |
| { | |
| //段落 | |
| //line break | |
| CTParagraphStyleSetting lineBreakMode; | |
| CTLineBreakMode lineBreak = kCTLineBreakByCharWrapping; //换行模式 | |
| lineBreakMode.spec = kCTParagraphStyleSpecifierLineBreakMode; | |
| lineBreakMode.value = &lineBreak; | |
| lineBreakMode.valueSize = sizeof(CTLineBreakMode); |
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
| @interface ViewController () | |
| @property (nonatomic) UITextView *textField; | |
| @property (nonatomic) UIView *textFieldContainer; | |
| @end | |
| @implementation ViewController | |
| - (void)viewDidLoad { |
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
| - (void)showEmail:(NSString*)file { | |
| NSString *emailTitle = @"Great Photo and Doc"; | |
| NSString *messageBody = @"Hey, check this out!"; | |
| NSArray *toRecipents = [NSArray arrayWithObject:@"support@appcoda.com"]; | |
| MFMailComposeViewController *mc = [[MFMailComposeViewController alloc] init]; | |
| mc.mailComposeDelegate = self; | |
| [mc setSubject:emailTitle]; | |
| [mc setMessageBody:messageBody isHTML:NO]; |
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
| - (void)resizeToFitSubviews:(UIView *)view | |
| { | |
| float w, h; | |
| for (UIView *v in view.subviews) { | |
| float fw = v.frame.origin.x + v.frame.size.width; | |
| float fh = v.frame.origin.y + v.frame.size.height; | |
| w = MAX(fw, w); | |
| h = MAX(fh, h); | |
| } |
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
| + (NSString *)contentTypeForImageData:(NSData *)data { | |
| uint8_t c; | |
| [data getBytes:&c length:1]; | |
| switch (c) { | |
| case 0xFF: | |
| return @"image/jpeg"; | |
| case 0x89: | |
| return @"image/png"; | |
| case 0x47: |
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
| + (NSString *)downloadUrlWithUserEmail:(NSString *)email, ... { | |
| NSMutableArray *argsArr = [@[] mutableCopy]; | |
| va_list params; | |
| va_start(params, email); | |
| id arg; | |
| if (email) { |
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
| self.title = LocStr(@"本地"); | |
| self.automaticallyAdjustsScrollViewInsets = YES; | |
| self.edgesForExtendedLayout = UIRectEdgeNone; |
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
| #ifndef yahame_Prefix_h | |
| #define yahame_Prefix_h | |
| #if !defined(DEBUG) | |
| //#define NSLog(...) ; | |
| #endif | |
| #define NS_USERDEFAULT [NSUserDefaults standardUserDefaults] |