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
// アスペクト比は固定 | |
self.imageCropViewController.cropMode = YMNImageCropModeFixedAspect; | |
// アスペクト比の値は1.f | |
self.imageCropViewController.cropRectAspectRatio = 1.f; |
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
/// クロップの枠の拡縮の仕方 | |
typedef NS_ENUM(NSUInteger, YMNImageCropMode) { | |
/// 枠のアスペクト比は自由 | |
YMNImageCropModeFlexible, | |
/// 枠のアスペクト比は固定 | |
YMNImageCropModeFixedAspect | |
}; |
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)imageCropViewController:(UIViewController* )controller didFinishCroppingImage:(UIImage *)image | |
{ | |
//ここでimageを受け取る | |
} |
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
self.imageCropViewController = [[YMNImageCropViewController alloc] initWithImage:image]; | |
self.imageCropViewController.delegate = self; | |
[self presentViewController:self.imageCropViewController animated:NO completion:nil]; |
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 "YMNViewController.h" | |
NSString *const Text = @"The iOS Developer Program provides a complete and integrated process for developing and distributing iOS apps on the App Store. Learn more"; | |
NSString *const LinkText = @"Learn more"; | |
@interface YMNViewController () | |
@property (nonatomic, strong) UITextView *textView; | |
@property (nonatomic, strong) UITapGestureRecognizer *tapGesture; |
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 "YMNCoreTextView.h" | |
#import <CoreText/CoreText.h> | |
#import <QuartzCore/QuartzCore.h> | |
@interface YMNCoreTextView() | |
@property (nonatomic, strong) NSMutableAttributedString *attributedString; | |
@property (nonatomic, assign) CTFrameRef drawingFrame; | |
@property (nonatomic, assign) NSRange linkableWordRange; |
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 "YMNCoreTextView.h" | |
#import <CoreText/CoreText.h> | |
#import <QuartzCore/QuartzCore.h> | |
@interface YMNCoreTextView() | |
@property (nonatomic, strong) NSMutableAttributedString *attributedString; | |
@property (nonatomic, assign) CTFrameRef drawingFrame; | |
@property (nonatomic, assign) NSRange linkableWordRange; |
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 "YMNCoreTextView.h" | |
#import <CoreText/CoreText.h> | |
#import <QuartzCore/QuartzCore.h> | |
@interface YMNCoreTextView() | |
@property (nonatomic, strong) NSMutableAttributedString *attributedString; | |
@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
#import "YMNCoreTextView.h" | |
#import <CoreText/CoreText.h> | |
#import <QuartzCore/QuartzCore.h> | |
@interface YMNCoreTextView() | |
@property (nonatomic, strong) NSMutableAttributedString *attributedString; | |
@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
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); | |
NSString *filePath = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"places.plist"]; | |
NSArray *array = [NSArray arrayWithContentsOfFile:filePath]; | |
for (NSData *data in [YSPlaceDataManager loadFromPropertyList]) { | |
// プリパティリストから取り出したNSData型のデータをCustomObject型に再変換 | |
CustomObject *customObj = [NSKeyedUnarchiver unarchiveObjectWithData:data]; | |
NSLog(@"%@", customObj); | |
} |