└── ZYDrawString
├── ZYDrawString
├── ZYAnimationLayer
│ ├── noun_project_347_2.png
│ ├── ZYAnimationLayer.h
│ └── ZYAnimationLayer.m
├── ZYMainViewController.h
├── ZYAppDelegate.h
├── main.m
├── Images.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── Info.plist
├── ZYAppDelegate.m
├── Base.lproj
│ └── LaunchScreen.xib
└── ZYMainViewController.m
├── ZYDrawString.xcodeproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ ├── xcuserdata
│ │ └── soufun.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ └── xcshareddata
│ │ └── ZYDrawString.xccheckout
├── xcuserdata
│ └── soufun.xcuserdatad
│ │ └── xcschemes
│ │ ├── xcschememanagement.plist
│ │ └── ZYDrawString.xcscheme
└── project.pbxproj
└── ZYDrawStringTests
├── Info.plist
└── ZYDrawStringTests.m
/ZYDrawString/ZYDrawString/ZYAnimationLayer/noun_project_347_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjzhangyang/ZYDrawString/HEAD/ZYDrawString/ZYDrawString/ZYAnimationLayer/noun_project_347_2.png
--------------------------------------------------------------------------------
/ZYDrawString/ZYDrawString.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ZYDrawString/ZYDrawString.xcodeproj/project.xcworkspace/xcuserdata/soufun.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bjzhangyang/ZYDrawString/HEAD/ZYDrawString/ZYDrawString.xcodeproj/project.xcworkspace/xcuserdata/soufun.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/ZYDrawString/ZYDrawString/ZYMainViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ZYMainViewController.h
3 | // ZYDrawString
4 | //
5 | // Created by soufun on 15-1-9.
6 | // Copyright (c) 2015年 ZY. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ZYMainViewController : UIViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/ZYDrawString/ZYDrawString/ZYAppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // ZYAppDelegate.h
3 | // ZYDrawString
4 | //
5 | // Created by soufun on 15-1-9.
6 | // Copyright (c) 2015年 ZY. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ZYAppDelegate : UIResponder
12 | @property (strong, nonatomic) UIWindow *window;
13 | @end
14 |
--------------------------------------------------------------------------------
/ZYDrawString/ZYDrawString/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // ZYDrawString
4 | //
5 | // Created by soufun on 15-1-9.
6 | // Copyright (c) 2015年 ZY. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "ZYAppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([ZYAppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/ZYDrawString/ZYDrawString/ZYAnimationLayer/ZYAnimationLayer.h:
--------------------------------------------------------------------------------
1 | //
2 | // ZYAnimationLayer.h
3 | // ZYDrawString
4 | //
5 | // Created by soufun on 15-1-9.
6 | // Copyright (c) 2015年 ZY. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 | #import
12 | @interface ZYAnimationLayer : CALayer
13 | /**
14 | * 字符串画线
15 | *
16 | * @param string 要画的字符串
17 | * @param rect 动画位置
18 | * @param view 动画所在视图
19 | * @param ui_font 动画字体
20 | * @param color 字体颜色
21 | */
22 | +(void)createAnimationLayerWithString:(NSString*)string andRect:(CGRect)rect andView:(UIView*)view andFont:(UIFont*)ui_font andStrokeColor:(UIColor*)color;
23 | @end
24 |
--------------------------------------------------------------------------------
/ZYDrawString/ZYDrawString.xcodeproj/xcuserdata/soufun.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | ZYDrawString.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 5A5F99111AC10C07000BE5B3
16 |
17 | primary
18 |
19 |
20 | 5A5F992A1AC10C07000BE5B3
21 |
22 | primary
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/ZYDrawString/ZYDrawStringTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | zy.$(PRODUCT_NAME:rfc1034identifier)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/ZYDrawString/ZYDrawStringTests/ZYDrawStringTests.m:
--------------------------------------------------------------------------------
1 | //
2 | // ZYDrawStringTests.m
3 | // ZYDrawStringTests
4 | //
5 | // Created by soufun on 15/3/24.
6 | // Copyright (c) 2015年 zy. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @interface ZYDrawStringTests : XCTestCase
13 |
14 | @end
15 |
16 | @implementation ZYDrawStringTests
17 |
18 | - (void)setUp {
19 | [super setUp];
20 | // Put setup code here. This method is called before the invocation of each test method in the class.
21 | }
22 |
23 | - (void)tearDown {
24 | // Put teardown code here. This method is called after the invocation of each test method in the class.
25 | [super tearDown];
26 | }
27 |
28 | - (void)testExample {
29 | // This is an example of a functional test case.
30 | XCTAssert(YES, @"Pass");
31 | }
32 |
33 | - (void)testPerformanceExample {
34 | // This is an example of a performance test case.
35 | [self measureBlock:^{
36 | // Put the code you want to measure the time of here.
37 | }];
38 | }
39 |
40 | @end
41 |
--------------------------------------------------------------------------------
/ZYDrawString/ZYDrawString/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "ipad",
35 | "size" : "29x29",
36 | "scale" : "1x"
37 | },
38 | {
39 | "idiom" : "ipad",
40 | "size" : "29x29",
41 | "scale" : "2x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "40x40",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "40x40",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "76x76",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "76x76",
61 | "scale" : "2x"
62 | }
63 | ],
64 | "info" : {
65 | "version" : 1,
66 | "author" : "xcode"
67 | }
68 | }
--------------------------------------------------------------------------------
/ZYDrawString/ZYDrawString/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | zy.$(PRODUCT_NAME:rfc1034identifier)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UISupportedInterfaceOrientations~ipad
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationPortraitUpsideDown
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/ZYDrawString/ZYDrawString.xcodeproj/project.xcworkspace/xcshareddata/ZYDrawString.xccheckout:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDESourceControlProjectFavoriteDictionaryKey
6 |
7 | IDESourceControlProjectIdentifier
8 | 7D639067-5550-422D-A896-D0B30E9BCD3C
9 | IDESourceControlProjectName
10 | ZYDrawString
11 | IDESourceControlProjectOriginsDictionary
12 |
13 | 2B213F5A99968543D2D24959E52D937A92C4F53F
14 | https://github.com/bjzhangyang/ZYDrawString.git
15 |
16 | IDESourceControlProjectPath
17 | ZYDrawString/ZYDrawString.xcodeproj
18 | IDESourceControlProjectRelativeInstallPathDictionary
19 |
20 | 2B213F5A99968543D2D24959E52D937A92C4F53F
21 | ../../..
22 |
23 | IDESourceControlProjectURL
24 | https://github.com/bjzhangyang/ZYDrawString.git
25 | IDESourceControlProjectVersion
26 | 111
27 | IDESourceControlProjectWCCIdentifier
28 | 2B213F5A99968543D2D24959E52D937A92C4F53F
29 | IDESourceControlProjectWCConfigurations
30 |
31 |
32 | IDESourceControlRepositoryExtensionIdentifierKey
33 | public.vcs.git
34 | IDESourceControlWCCIdentifierKey
35 | 2B213F5A99968543D2D24959E52D937A92C4F53F
36 | IDESourceControlWCCName
37 | ZYDrawString
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/ZYDrawString/ZYDrawString/ZYAppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // ZYAppDelegate.m
3 | // ZYDrawString
4 | //
5 | // Created by soufun on 15-1-9.
6 | // Copyright (c) 2015年 ZY. All rights reserved.
7 | //
8 |
9 | #import "ZYAppDelegate.h"
10 | #import "ZYMainViewController.h"
11 | @interface ZYAppDelegate()
12 |
13 | @end
14 |
15 | @implementation ZYAppDelegate
16 |
17 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
18 | self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
19 | self.window.backgroundColor =[UIColor whiteColor];
20 | ZYMainViewController * mainVC = [[ZYMainViewController alloc]init];
21 | UINavigationController * nav = [[UINavigationController alloc]initWithRootViewController:mainVC];
22 | self.window.rootViewController = nav;
23 | [self.window makeKeyAndVisible];
24 | return YES;
25 | }
26 |
27 | - (void)applicationWillResignActive:(UIApplication *)application {
28 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
29 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
30 | }
31 |
32 | - (void)applicationDidEnterBackground:(UIApplication *)application {
33 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
34 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
35 | }
36 |
37 | - (void)applicationWillEnterForeground:(UIApplication *)application {
38 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
39 | }
40 |
41 | - (void)applicationDidBecomeActive:(UIApplication *)application {
42 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
43 | }
44 |
45 | - (void)applicationWillTerminate:(UIApplication *)application {
46 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
47 | }
48 |
49 | @end
50 |
--------------------------------------------------------------------------------
/ZYDrawString/ZYDrawString/Base.lproj/LaunchScreen.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
20 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/ZYDrawString/ZYDrawString.xcodeproj/xcuserdata/soufun.xcuserdatad/xcschemes/ZYDrawString.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
38 |
39 |
44 |
45 |
47 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
65 |
66 |
76 |
78 |
84 |
85 |
86 |
87 |
88 |
89 |
95 |
97 |
103 |
104 |
105 |
106 |
108 |
109 |
112 |
113 |
114 |
--------------------------------------------------------------------------------
/ZYDrawString/ZYDrawString/ZYMainViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ZYMainViewController.m
3 | // ZYDrawString
4 | //
5 | // Created by soufun on 15-1-9.
6 | // Copyright (c) 2015年 ZY. All rights reserved.
7 | //
8 |
9 | #import "ZYMainViewController.h"
10 | #import "ZYAnimationLayer.h"
11 | #define kWidth [UIScreen mainScreen].bounds.size.width
12 | #define kHeight [UIScreen mainScreen].bounds.size.height
13 | @interface ZYMainViewController ()
14 | @property (nonatomic,strong)UIView * bgView;
15 | @property (nonatomic,strong)UITextField * myTextField;
16 | @property (nonatomic,strong)UIButton * sendButton;
17 | @property (nonatomic)CGRect oraginFrame;
18 | @end
19 |
20 | @implementation ZYMainViewController
21 |
22 | - (void)viewDidLoad {
23 | [super viewDidLoad];
24 | [self createUI];
25 | }
26 | #pragma -mark 主要方法,点击“开始画线”执行的方法
27 | -(void)startDraw:(UIButton*)sender
28 | {
29 | [_myTextField resignFirstResponder];
30 | for (id layer in self.view.layer.sublayers) {
31 | if([layer isKindOfClass:[ZYAnimationLayer class]])
32 | {
33 | [layer removeFromSuperlayer];
34 | }
35 | }
36 | [ZYAnimationLayer createAnimationLayerWithString:_myTextField.text andRect: CGRectMake(20.0f, -100.0f,
37 | CGRectGetWidth(self.view.layer.bounds) - 40.0f,
38 | CGRectGetHeight(self.view.layer.bounds) - 84.0f) andView:self.view andFont:[UIFont boldSystemFontOfSize:40] andStrokeColor:[UIColor colorWithRed:0 green:0.0 blue:0.0 alpha:1]];
39 | }
40 | #pragma -mark 自定义方法
41 | -(void)createUI
42 | {
43 | self.title = @"DrawString";
44 | [self addKeyboardObserve];
45 | [self createTextFieldAndButton];
46 | }
47 | -(void)addKeyboardObserve{
48 | //增加监听,当键盘出现或改变时收出消息
49 | [[NSNotificationCenter defaultCenter] addObserver:self
50 | selector:@selector(keyboardWillShow:)
51 | name:UIKeyboardWillShowNotification
52 | object:nil];
53 |
54 | //增加监听,当键退出时收出消息
55 | [[NSNotificationCenter defaultCenter] addObserver:self
56 | selector:@selector(keyboardWillHide:)
57 | name:UIKeyboardWillHideNotification
58 | object:nil];
59 | }
60 | -(void)createTextFieldAndButton
61 | {
62 | _bgView = [[UIView alloc]initWithFrame:CGRectMake(10, kHeight- 64 - 10, kWidth - 20, 44)];
63 | _myTextField = [[UITextField alloc]initWithFrame:CGRectMake(0, 0, kWidth - 100, 44)];
64 | _myTextField.layer.borderColor = [UIColor grayColor].CGColor;
65 | _myTextField.layer.borderWidth = .5;
66 | _myTextField.layer.cornerRadius = 10.0;
67 | _myTextField.layer.masksToBounds = YES;
68 | _myTextField.delegate = self;
69 | _myTextField.userInteractionEnabled = YES;
70 | _myTextField.placeholder = @"请输入要画的文字";
71 | _myTextField.textAlignment = NSTextAlignmentCenter;
72 |
73 | _sendButton = [UIButton buttonWithType:UIButtonTypeSystem];
74 | _sendButton.frame = CGRectMake(kWidth - 90, 0, 80, 44);
75 | [_sendButton setTitle:@"开始画线" forState:UIControlStateNormal];
76 | _sendButton.titleLabel.font = [UIFont systemFontOfSize:15];
77 | [_sendButton addTarget:self action:@selector(startDraw:) forControlEvents:UIControlEventTouchUpInside];
78 |
79 | [_bgView addSubview:_myTextField];
80 | [_bgView addSubview:_sendButton];
81 | [self.view addSubview:_bgView];
82 | _oraginFrame = _bgView.frame;
83 |
84 | }
85 |
86 | -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
87 | [_myTextField resignFirstResponder];
88 | }
89 |
90 |
91 | #pragma -mark 键盘监听
92 | - (void)keyboardWillShow:(NSNotification *)aNotification
93 | {
94 | //获取键盘的高度
95 | NSDictionary *userInfo = [aNotification userInfo];
96 | NSValue *aValue = [userInfo objectForKey:UIKeyboardFrameEndUserInfoKey];
97 | CGRect keyboardRect = [aValue CGRectValue];
98 | int height = keyboardRect.size.height;
99 | _bgView.frame = CGRectMake(_oraginFrame.origin.x, _oraginFrame.origin.y - height, _oraginFrame.size.width, _oraginFrame.size.height);
100 | }
101 |
102 | //当键退出时调用
103 | - (void)keyboardWillHide:(NSNotification *)aNotification
104 | {
105 | _bgView.frame = _oraginFrame;
106 | }
107 |
108 | - (void)didReceiveMemoryWarning {
109 | [super didReceiveMemoryWarning];
110 | // Dispose of any resources that can be recreated.
111 | }
112 |
113 | /*
114 | #pragma mark - Navigation
115 |
116 | // In a storyboard-based application, you will often want to do a little preparation before navigation
117 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
118 | // Get the new view controller using [segue destinationViewController].
119 | // Pass the selected object to the new view controller.
120 | }
121 | */
122 |
123 | @end
124 |
--------------------------------------------------------------------------------
/ZYDrawString/ZYDrawString/ZYAnimationLayer/ZYAnimationLayer.m:
--------------------------------------------------------------------------------
1 | //
2 | // ZYAnimationLayer.m
3 | // ZYDrawString
4 | //
5 | // Created by soufun on 15-1-9.
6 | // Copyright (c) 2015年 ZY. All rights reserved.
7 | //
8 |
9 | #import "ZYAnimationLayer.h"
10 |
11 | @interface ZYAnimationLayer()
12 | @property (nonatomic, retain) CAShapeLayer *pathLayer;
13 | @property (nonatomic, retain) CALayer *penLayer;
14 | @end
15 |
16 | @implementation ZYAnimationLayer
17 | +(void)createAnimationLayerWithString:(NSString*)string andRect:(CGRect)rect andView:(UIView *)view andFont:(UIFont*)ui_font andStrokeColor:(UIColor*)color
18 | {
19 | ZYAnimationLayer * animationLayer = [ZYAnimationLayer layer];
20 | animationLayer.frame = rect;
21 | [view.layer addSublayer:animationLayer];
22 |
23 | if (animationLayer.pathLayer != nil) {
24 | [animationLayer.penLayer removeFromSuperlayer];
25 | [animationLayer.pathLayer removeFromSuperlayer];
26 | animationLayer.pathLayer = nil;
27 | animationLayer.penLayer = nil;
28 | }
29 | CTFontRef font =CTFontCreateWithName((CFStringRef)ui_font.fontName,
30 | ui_font.pointSize,
31 | NULL);
32 | CGMutablePathRef letters = CGPathCreateMutable();
33 |
34 | //这里设置画线的字体和大小
35 | NSDictionary *attrs = [NSDictionary dictionaryWithObjectsAndKeys:
36 | (__bridge id)font, kCTFontAttributeName,
37 | nil];
38 | NSAttributedString *attrString = [[NSAttributedString alloc] initWithString:string
39 | attributes:attrs];
40 | CTLineRef line = CTLineCreateWithAttributedString((CFAttributedStringRef)attrString);
41 | CFArrayRef runArray = CTLineGetGlyphRuns(line);
42 |
43 | // for each RUN
44 | for (CFIndex runIndex = 0; runIndex < CFArrayGetCount(runArray); runIndex++)
45 | {
46 | // Get FONT for this run
47 | CTRunRef run = (CTRunRef)CFArrayGetValueAtIndex(runArray, runIndex);
48 | CTFontRef runFont = CFDictionaryGetValue(CTRunGetAttributes(run), kCTFontAttributeName);
49 |
50 | // for each GLYPH in run
51 | for (CFIndex runGlyphIndex = 0; runGlyphIndex < CTRunGetGlyphCount(run); runGlyphIndex++)
52 | {
53 | CFRange thisGlyphRange = CFRangeMake(runGlyphIndex, 1);
54 | CGGlyph glyph;
55 | CGPoint position;
56 | CTRunGetGlyphs(run, thisGlyphRange, &glyph);
57 | CTRunGetPositions(run, thisGlyphRange, &position);
58 |
59 | {
60 | CGPathRef letter = CTFontCreatePathForGlyph(runFont, glyph, NULL);
61 | CGAffineTransform t = CGAffineTransformMakeTranslation(position.x, position.y);
62 | CGPathAddPath(letters, &t, letter);
63 | CGPathRelease(letter);
64 | }
65 | }
66 | }
67 | CFRelease(line);
68 |
69 | UIBezierPath *path = [UIBezierPath bezierPath];
70 | [path moveToPoint:CGPointZero];
71 | [path appendPath:[UIBezierPath bezierPathWithCGPath:letters]];
72 |
73 | CGPathRelease(letters);
74 | CFRelease(font);
75 |
76 | CAShapeLayer *pathLayer = [CAShapeLayer layer];
77 | pathLayer.frame = animationLayer.bounds;
78 | pathLayer.bounds = CGPathGetBoundingBox(path.CGPath);
79 | pathLayer.geometryFlipped = YES;
80 | pathLayer.path = path.CGPath;
81 | pathLayer.strokeColor = [color CGColor];
82 | pathLayer.fillColor = nil;
83 | pathLayer.lineWidth = 1.0f;
84 | pathLayer.lineJoin = kCALineJoinBevel;
85 | [animationLayer addSublayer:pathLayer];
86 | animationLayer.pathLayer = pathLayer;
87 |
88 | UIImage *penImage = [UIImage imageNamed:@"noun_project_347_2.png"];
89 | CALayer *penLayer = [CALayer layer];
90 | penLayer.contents = (id)penImage.CGImage;
91 | penLayer.anchorPoint = CGPointZero;
92 | penLayer.frame = CGRectMake(0.0f, 0.0f, penImage.size.width, penImage.size.height);
93 | [pathLayer addSublayer:penLayer];
94 | animationLayer.penLayer = penLayer;
95 |
96 | [animationLayer.pathLayer removeAllAnimations];
97 | [animationLayer.penLayer removeAllAnimations];
98 |
99 | animationLayer.penLayer.hidden = NO;
100 |
101 | CABasicAnimation *pathAnimation = [CABasicAnimation animationWithKeyPath:@"strokeEnd"];
102 | pathAnimation.duration = 5.0;
103 | pathAnimation.fromValue = [NSNumber numberWithFloat:0.0f];
104 | pathAnimation.toValue = [NSNumber numberWithFloat:1.0f];
105 | [animationLayer.pathLayer addAnimation:pathAnimation forKey:@"strokeEnd"];
106 |
107 | CAKeyframeAnimation *penAnimation = [CAKeyframeAnimation animationWithKeyPath:@"position"];
108 | penAnimation.duration = 5.0;
109 | penAnimation.path = animationLayer.pathLayer.path;
110 | penAnimation.calculationMode = kCAAnimationPaced;
111 | penAnimation.delegate = animationLayer;
112 | [animationLayer.penLayer addAnimation:penAnimation forKey:@"position"];
113 | }
114 |
115 | - (void) animationDidStop:(CAAnimation *)anim finished:(BOOL)flag
116 | {
117 | self.penLayer.hidden = YES;
118 | }
119 | @end
120 |
--------------------------------------------------------------------------------
/ZYDrawString/ZYDrawString.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 5A5F99231AC10C07000BE5B3 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5A5F99221AC10C07000BE5B3 /* Images.xcassets */; };
11 | 5A5F99261AC10C07000BE5B3 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5A5F99241AC10C07000BE5B3 /* LaunchScreen.xib */; };
12 | 5A5F99321AC10C07000BE5B3 /* ZYDrawStringTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5A5F99311AC10C07000BE5B3 /* ZYDrawStringTests.m */; };
13 | 5A5F993C1AC10C24000BE5B3 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5A5F993B1AC10C24000BE5B3 /* CoreGraphics.framework */; };
14 | 5A5F99431AC10C4F000BE5B3 /* ZYAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 5A5F993E1AC10C4F000BE5B3 /* ZYAppDelegate.m */; };
15 | 5A5F99441AC10C4F000BE5B3 /* ZYMainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5A5F99401AC10C4F000BE5B3 /* ZYMainViewController.m */; };
16 | 5A5F99471AC10CA6000BE5B3 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 5A5F99461AC10CA6000BE5B3 /* main.m */; };
17 | 5ABD80B91B341262007F9BE3 /* noun_project_347_2.png in Resources */ = {isa = PBXBuildFile; fileRef = 5ABD80B61B341262007F9BE3 /* noun_project_347_2.png */; };
18 | 5ABD80BA1B341262007F9BE3 /* ZYAnimationLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 5ABD80B81B341262007F9BE3 /* ZYAnimationLayer.m */; };
19 | /* End PBXBuildFile section */
20 |
21 | /* Begin PBXContainerItemProxy section */
22 | 5A5F992C1AC10C07000BE5B3 /* PBXContainerItemProxy */ = {
23 | isa = PBXContainerItemProxy;
24 | containerPortal = 5A5F990A1AC10C07000BE5B3 /* Project object */;
25 | proxyType = 1;
26 | remoteGlobalIDString = 5A5F99111AC10C07000BE5B3;
27 | remoteInfo = ZYDrawString;
28 | };
29 | /* End PBXContainerItemProxy section */
30 |
31 | /* Begin PBXFileReference section */
32 | 5A5F99121AC10C07000BE5B3 /* ZYDrawString.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ZYDrawString.app; sourceTree = BUILT_PRODUCTS_DIR; };
33 | 5A5F99161AC10C07000BE5B3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
34 | 5A5F99221AC10C07000BE5B3 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
35 | 5A5F99251AC10C07000BE5B3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; };
36 | 5A5F992B1AC10C07000BE5B3 /* ZYDrawStringTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ZYDrawStringTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
37 | 5A5F99301AC10C07000BE5B3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
38 | 5A5F99311AC10C07000BE5B3 /* ZYDrawStringTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ZYDrawStringTests.m; sourceTree = ""; };
39 | 5A5F993B1AC10C24000BE5B3 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
40 | 5A5F993D1AC10C4F000BE5B3 /* ZYAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZYAppDelegate.h; sourceTree = ""; };
41 | 5A5F993E1AC10C4F000BE5B3 /* ZYAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZYAppDelegate.m; sourceTree = ""; };
42 | 5A5F993F1AC10C4F000BE5B3 /* ZYMainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZYMainViewController.h; sourceTree = ""; };
43 | 5A5F99401AC10C4F000BE5B3 /* ZYMainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZYMainViewController.m; sourceTree = ""; };
44 | 5A5F99461AC10CA6000BE5B3 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
45 | 5ABD80B61B341262007F9BE3 /* noun_project_347_2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = noun_project_347_2.png; sourceTree = ""; };
46 | 5ABD80B71B341262007F9BE3 /* ZYAnimationLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZYAnimationLayer.h; sourceTree = ""; };
47 | 5ABD80B81B341262007F9BE3 /* ZYAnimationLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZYAnimationLayer.m; sourceTree = ""; };
48 | /* End PBXFileReference section */
49 |
50 | /* Begin PBXFrameworksBuildPhase section */
51 | 5A5F990F1AC10C07000BE5B3 /* Frameworks */ = {
52 | isa = PBXFrameworksBuildPhase;
53 | buildActionMask = 2147483647;
54 | files = (
55 | 5A5F993C1AC10C24000BE5B3 /* CoreGraphics.framework in Frameworks */,
56 | );
57 | runOnlyForDeploymentPostprocessing = 0;
58 | };
59 | 5A5F99281AC10C07000BE5B3 /* Frameworks */ = {
60 | isa = PBXFrameworksBuildPhase;
61 | buildActionMask = 2147483647;
62 | files = (
63 | );
64 | runOnlyForDeploymentPostprocessing = 0;
65 | };
66 | /* End PBXFrameworksBuildPhase section */
67 |
68 | /* Begin PBXGroup section */
69 | 5A5F99091AC10C07000BE5B3 = {
70 | isa = PBXGroup;
71 | children = (
72 | 5ABD80B51B341262007F9BE3 /* ZYAnimationLayer */,
73 | 5A5F99141AC10C07000BE5B3 /* ZYDrawString */,
74 | 5A5F992E1AC10C07000BE5B3 /* ZYDrawStringTests */,
75 | 5A5F99131AC10C07000BE5B3 /* Products */,
76 | );
77 | sourceTree = "";
78 | };
79 | 5A5F99131AC10C07000BE5B3 /* Products */ = {
80 | isa = PBXGroup;
81 | children = (
82 | 5A5F99121AC10C07000BE5B3 /* ZYDrawString.app */,
83 | 5A5F992B1AC10C07000BE5B3 /* ZYDrawStringTests.xctest */,
84 | );
85 | name = Products;
86 | sourceTree = "";
87 | };
88 | 5A5F99141AC10C07000BE5B3 /* ZYDrawString */ = {
89 | isa = PBXGroup;
90 | children = (
91 | 5A5F993D1AC10C4F000BE5B3 /* ZYAppDelegate.h */,
92 | 5A5F993E1AC10C4F000BE5B3 /* ZYAppDelegate.m */,
93 | 5A5F993F1AC10C4F000BE5B3 /* ZYMainViewController.h */,
94 | 5A5F99401AC10C4F000BE5B3 /* ZYMainViewController.m */,
95 | 5A5F99221AC10C07000BE5B3 /* Images.xcassets */,
96 | 5A5F99241AC10C07000BE5B3 /* LaunchScreen.xib */,
97 | 5A5F99151AC10C07000BE5B3 /* Supporting Files */,
98 | );
99 | path = ZYDrawString;
100 | sourceTree = "";
101 | };
102 | 5A5F99151AC10C07000BE5B3 /* Supporting Files */ = {
103 | isa = PBXGroup;
104 | children = (
105 | 5A5F993B1AC10C24000BE5B3 /* CoreGraphics.framework */,
106 | 5A5F99161AC10C07000BE5B3 /* Info.plist */,
107 | 5A5F99461AC10CA6000BE5B3 /* main.m */,
108 | );
109 | name = "Supporting Files";
110 | sourceTree = "";
111 | };
112 | 5A5F992E1AC10C07000BE5B3 /* ZYDrawStringTests */ = {
113 | isa = PBXGroup;
114 | children = (
115 | 5A5F99311AC10C07000BE5B3 /* ZYDrawStringTests.m */,
116 | 5A5F992F1AC10C07000BE5B3 /* Supporting Files */,
117 | );
118 | path = ZYDrawStringTests;
119 | sourceTree = "";
120 | };
121 | 5A5F992F1AC10C07000BE5B3 /* Supporting Files */ = {
122 | isa = PBXGroup;
123 | children = (
124 | 5A5F99301AC10C07000BE5B3 /* Info.plist */,
125 | );
126 | name = "Supporting Files";
127 | sourceTree = "";
128 | };
129 | 5ABD80B51B341262007F9BE3 /* ZYAnimationLayer */ = {
130 | isa = PBXGroup;
131 | children = (
132 | 5ABD80B61B341262007F9BE3 /* noun_project_347_2.png */,
133 | 5ABD80B71B341262007F9BE3 /* ZYAnimationLayer.h */,
134 | 5ABD80B81B341262007F9BE3 /* ZYAnimationLayer.m */,
135 | );
136 | name = ZYAnimationLayer;
137 | path = ZYDrawString/ZYAnimationLayer;
138 | sourceTree = "";
139 | };
140 | /* End PBXGroup section */
141 |
142 | /* Begin PBXNativeTarget section */
143 | 5A5F99111AC10C07000BE5B3 /* ZYDrawString */ = {
144 | isa = PBXNativeTarget;
145 | buildConfigurationList = 5A5F99351AC10C07000BE5B3 /* Build configuration list for PBXNativeTarget "ZYDrawString" */;
146 | buildPhases = (
147 | 5A5F990E1AC10C07000BE5B3 /* Sources */,
148 | 5A5F990F1AC10C07000BE5B3 /* Frameworks */,
149 | 5A5F99101AC10C07000BE5B3 /* Resources */,
150 | );
151 | buildRules = (
152 | );
153 | dependencies = (
154 | );
155 | name = ZYDrawString;
156 | productName = ZYDrawString;
157 | productReference = 5A5F99121AC10C07000BE5B3 /* ZYDrawString.app */;
158 | productType = "com.apple.product-type.application";
159 | };
160 | 5A5F992A1AC10C07000BE5B3 /* ZYDrawStringTests */ = {
161 | isa = PBXNativeTarget;
162 | buildConfigurationList = 5A5F99381AC10C07000BE5B3 /* Build configuration list for PBXNativeTarget "ZYDrawStringTests" */;
163 | buildPhases = (
164 | 5A5F99271AC10C07000BE5B3 /* Sources */,
165 | 5A5F99281AC10C07000BE5B3 /* Frameworks */,
166 | 5A5F99291AC10C07000BE5B3 /* Resources */,
167 | );
168 | buildRules = (
169 | );
170 | dependencies = (
171 | 5A5F992D1AC10C07000BE5B3 /* PBXTargetDependency */,
172 | );
173 | name = ZYDrawStringTests;
174 | productName = ZYDrawStringTests;
175 | productReference = 5A5F992B1AC10C07000BE5B3 /* ZYDrawStringTests.xctest */;
176 | productType = "com.apple.product-type.bundle.unit-test";
177 | };
178 | /* End PBXNativeTarget section */
179 |
180 | /* Begin PBXProject section */
181 | 5A5F990A1AC10C07000BE5B3 /* Project object */ = {
182 | isa = PBXProject;
183 | attributes = {
184 | LastUpgradeCheck = 0620;
185 | ORGANIZATIONNAME = zy;
186 | TargetAttributes = {
187 | 5A5F99111AC10C07000BE5B3 = {
188 | CreatedOnToolsVersion = 6.2;
189 | };
190 | 5A5F992A1AC10C07000BE5B3 = {
191 | CreatedOnToolsVersion = 6.2;
192 | TestTargetID = 5A5F99111AC10C07000BE5B3;
193 | };
194 | };
195 | };
196 | buildConfigurationList = 5A5F990D1AC10C07000BE5B3 /* Build configuration list for PBXProject "ZYDrawString" */;
197 | compatibilityVersion = "Xcode 3.2";
198 | developmentRegion = English;
199 | hasScannedForEncodings = 0;
200 | knownRegions = (
201 | en,
202 | Base,
203 | );
204 | mainGroup = 5A5F99091AC10C07000BE5B3;
205 | productRefGroup = 5A5F99131AC10C07000BE5B3 /* Products */;
206 | projectDirPath = "";
207 | projectRoot = "";
208 | targets = (
209 | 5A5F99111AC10C07000BE5B3 /* ZYDrawString */,
210 | 5A5F992A1AC10C07000BE5B3 /* ZYDrawStringTests */,
211 | );
212 | };
213 | /* End PBXProject section */
214 |
215 | /* Begin PBXResourcesBuildPhase section */
216 | 5A5F99101AC10C07000BE5B3 /* Resources */ = {
217 | isa = PBXResourcesBuildPhase;
218 | buildActionMask = 2147483647;
219 | files = (
220 | 5ABD80B91B341262007F9BE3 /* noun_project_347_2.png in Resources */,
221 | 5A5F99261AC10C07000BE5B3 /* LaunchScreen.xib in Resources */,
222 | 5A5F99231AC10C07000BE5B3 /* Images.xcassets in Resources */,
223 | );
224 | runOnlyForDeploymentPostprocessing = 0;
225 | };
226 | 5A5F99291AC10C07000BE5B3 /* Resources */ = {
227 | isa = PBXResourcesBuildPhase;
228 | buildActionMask = 2147483647;
229 | files = (
230 | );
231 | runOnlyForDeploymentPostprocessing = 0;
232 | };
233 | /* End PBXResourcesBuildPhase section */
234 |
235 | /* Begin PBXSourcesBuildPhase section */
236 | 5A5F990E1AC10C07000BE5B3 /* Sources */ = {
237 | isa = PBXSourcesBuildPhase;
238 | buildActionMask = 2147483647;
239 | files = (
240 | 5A5F99431AC10C4F000BE5B3 /* ZYAppDelegate.m in Sources */,
241 | 5ABD80BA1B341262007F9BE3 /* ZYAnimationLayer.m in Sources */,
242 | 5A5F99441AC10C4F000BE5B3 /* ZYMainViewController.m in Sources */,
243 | 5A5F99471AC10CA6000BE5B3 /* main.m in Sources */,
244 | );
245 | runOnlyForDeploymentPostprocessing = 0;
246 | };
247 | 5A5F99271AC10C07000BE5B3 /* Sources */ = {
248 | isa = PBXSourcesBuildPhase;
249 | buildActionMask = 2147483647;
250 | files = (
251 | 5A5F99321AC10C07000BE5B3 /* ZYDrawStringTests.m in Sources */,
252 | );
253 | runOnlyForDeploymentPostprocessing = 0;
254 | };
255 | /* End PBXSourcesBuildPhase section */
256 |
257 | /* Begin PBXTargetDependency section */
258 | 5A5F992D1AC10C07000BE5B3 /* PBXTargetDependency */ = {
259 | isa = PBXTargetDependency;
260 | target = 5A5F99111AC10C07000BE5B3 /* ZYDrawString */;
261 | targetProxy = 5A5F992C1AC10C07000BE5B3 /* PBXContainerItemProxy */;
262 | };
263 | /* End PBXTargetDependency section */
264 |
265 | /* Begin PBXVariantGroup section */
266 | 5A5F99241AC10C07000BE5B3 /* LaunchScreen.xib */ = {
267 | isa = PBXVariantGroup;
268 | children = (
269 | 5A5F99251AC10C07000BE5B3 /* Base */,
270 | );
271 | name = LaunchScreen.xib;
272 | sourceTree = "";
273 | };
274 | /* End PBXVariantGroup section */
275 |
276 | /* Begin XCBuildConfiguration section */
277 | 5A5F99331AC10C07000BE5B3 /* Debug */ = {
278 | isa = XCBuildConfiguration;
279 | buildSettings = {
280 | ALWAYS_SEARCH_USER_PATHS = NO;
281 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
282 | CLANG_CXX_LIBRARY = "libc++";
283 | CLANG_ENABLE_MODULES = YES;
284 | CLANG_ENABLE_OBJC_ARC = YES;
285 | CLANG_WARN_BOOL_CONVERSION = YES;
286 | CLANG_WARN_CONSTANT_CONVERSION = YES;
287 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
288 | CLANG_WARN_EMPTY_BODY = YES;
289 | CLANG_WARN_ENUM_CONVERSION = YES;
290 | CLANG_WARN_INT_CONVERSION = YES;
291 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
292 | CLANG_WARN_UNREACHABLE_CODE = YES;
293 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
294 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
295 | COPY_PHASE_STRIP = NO;
296 | ENABLE_STRICT_OBJC_MSGSEND = YES;
297 | GCC_C_LANGUAGE_STANDARD = gnu99;
298 | GCC_DYNAMIC_NO_PIC = NO;
299 | GCC_OPTIMIZATION_LEVEL = 0;
300 | GCC_PREPROCESSOR_DEFINITIONS = (
301 | "DEBUG=1",
302 | "$(inherited)",
303 | );
304 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
305 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
306 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
307 | GCC_WARN_UNDECLARED_SELECTOR = YES;
308 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
309 | GCC_WARN_UNUSED_FUNCTION = YES;
310 | GCC_WARN_UNUSED_VARIABLE = YES;
311 | IPHONEOS_DEPLOYMENT_TARGET = 8.2;
312 | MTL_ENABLE_DEBUG_INFO = YES;
313 | ONLY_ACTIVE_ARCH = YES;
314 | SDKROOT = iphoneos;
315 | TARGETED_DEVICE_FAMILY = "1,2";
316 | };
317 | name = Debug;
318 | };
319 | 5A5F99341AC10C07000BE5B3 /* Release */ = {
320 | isa = XCBuildConfiguration;
321 | buildSettings = {
322 | ALWAYS_SEARCH_USER_PATHS = NO;
323 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
324 | CLANG_CXX_LIBRARY = "libc++";
325 | CLANG_ENABLE_MODULES = YES;
326 | CLANG_ENABLE_OBJC_ARC = YES;
327 | CLANG_WARN_BOOL_CONVERSION = YES;
328 | CLANG_WARN_CONSTANT_CONVERSION = YES;
329 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
330 | CLANG_WARN_EMPTY_BODY = YES;
331 | CLANG_WARN_ENUM_CONVERSION = YES;
332 | CLANG_WARN_INT_CONVERSION = YES;
333 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
334 | CLANG_WARN_UNREACHABLE_CODE = YES;
335 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
336 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
337 | COPY_PHASE_STRIP = NO;
338 | ENABLE_NS_ASSERTIONS = NO;
339 | ENABLE_STRICT_OBJC_MSGSEND = YES;
340 | GCC_C_LANGUAGE_STANDARD = gnu99;
341 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
342 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
343 | GCC_WARN_UNDECLARED_SELECTOR = YES;
344 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
345 | GCC_WARN_UNUSED_FUNCTION = YES;
346 | GCC_WARN_UNUSED_VARIABLE = YES;
347 | IPHONEOS_DEPLOYMENT_TARGET = 8.2;
348 | MTL_ENABLE_DEBUG_INFO = NO;
349 | SDKROOT = iphoneos;
350 | TARGETED_DEVICE_FAMILY = "1,2";
351 | VALIDATE_PRODUCT = YES;
352 | };
353 | name = Release;
354 | };
355 | 5A5F99361AC10C07000BE5B3 /* Debug */ = {
356 | isa = XCBuildConfiguration;
357 | buildSettings = {
358 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
359 | INFOPLIST_FILE = ZYDrawString/Info.plist;
360 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
361 | PRODUCT_NAME = "$(TARGET_NAME)";
362 | };
363 | name = Debug;
364 | };
365 | 5A5F99371AC10C07000BE5B3 /* Release */ = {
366 | isa = XCBuildConfiguration;
367 | buildSettings = {
368 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
369 | INFOPLIST_FILE = ZYDrawString/Info.plist;
370 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
371 | PRODUCT_NAME = "$(TARGET_NAME)";
372 | };
373 | name = Release;
374 | };
375 | 5A5F99391AC10C07000BE5B3 /* Debug */ = {
376 | isa = XCBuildConfiguration;
377 | buildSettings = {
378 | BUNDLE_LOADER = "$(TEST_HOST)";
379 | FRAMEWORK_SEARCH_PATHS = (
380 | "$(SDKROOT)/Developer/Library/Frameworks",
381 | "$(inherited)",
382 | );
383 | GCC_PREPROCESSOR_DEFINITIONS = (
384 | "DEBUG=1",
385 | "$(inherited)",
386 | );
387 | INFOPLIST_FILE = ZYDrawStringTests/Info.plist;
388 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
389 | PRODUCT_NAME = "$(TARGET_NAME)";
390 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ZYDrawString.app/ZYDrawString";
391 | };
392 | name = Debug;
393 | };
394 | 5A5F993A1AC10C07000BE5B3 /* Release */ = {
395 | isa = XCBuildConfiguration;
396 | buildSettings = {
397 | BUNDLE_LOADER = "$(TEST_HOST)";
398 | FRAMEWORK_SEARCH_PATHS = (
399 | "$(SDKROOT)/Developer/Library/Frameworks",
400 | "$(inherited)",
401 | );
402 | INFOPLIST_FILE = ZYDrawStringTests/Info.plist;
403 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
404 | PRODUCT_NAME = "$(TARGET_NAME)";
405 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ZYDrawString.app/ZYDrawString";
406 | };
407 | name = Release;
408 | };
409 | /* End XCBuildConfiguration section */
410 |
411 | /* Begin XCConfigurationList section */
412 | 5A5F990D1AC10C07000BE5B3 /* Build configuration list for PBXProject "ZYDrawString" */ = {
413 | isa = XCConfigurationList;
414 | buildConfigurations = (
415 | 5A5F99331AC10C07000BE5B3 /* Debug */,
416 | 5A5F99341AC10C07000BE5B3 /* Release */,
417 | );
418 | defaultConfigurationIsVisible = 0;
419 | defaultConfigurationName = Release;
420 | };
421 | 5A5F99351AC10C07000BE5B3 /* Build configuration list for PBXNativeTarget "ZYDrawString" */ = {
422 | isa = XCConfigurationList;
423 | buildConfigurations = (
424 | 5A5F99361AC10C07000BE5B3 /* Debug */,
425 | 5A5F99371AC10C07000BE5B3 /* Release */,
426 | );
427 | defaultConfigurationIsVisible = 0;
428 | defaultConfigurationName = Release;
429 | };
430 | 5A5F99381AC10C07000BE5B3 /* Build configuration list for PBXNativeTarget "ZYDrawStringTests" */ = {
431 | isa = XCConfigurationList;
432 | buildConfigurations = (
433 | 5A5F99391AC10C07000BE5B3 /* Debug */,
434 | 5A5F993A1AC10C07000BE5B3 /* Release */,
435 | );
436 | defaultConfigurationIsVisible = 0;
437 | defaultConfigurationName = Release;
438 | };
439 | /* End XCConfigurationList section */
440 | };
441 | rootObject = 5A5F990A1AC10C07000BE5B3 /* Project object */;
442 | }
443 |
--------------------------------------------------------------------------------