├── CATextLayerTest.gif ├── CATextLayerTest.xcodeproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── project.pbxproj ├── CATextLayerTest ├── AppDelegate.h ├── ViewController.h ├── main.m ├── Images.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Info.plist ├── AppDelegate.m ├── Base.lproj │ ├── Main.storyboard │ └── LaunchScreen.xib └── ViewController.m ├── README.md ├── CATextLayerTestTests ├── Info.plist └── CATextLayerTestTests.m └── .gitignore /CATextLayerTest.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/joeshang/CATextLayerTest/HEAD/CATextLayerTest.gif -------------------------------------------------------------------------------- /CATextLayerTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CATextLayerTest/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // CATextLayerTest 4 | // 5 | // Created by Joe Shang on 7/14/15. 6 | // Copyright (c) 2015 Shang Chuanren. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /CATextLayerTest/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // CATextLayerTest 4 | // 5 | // Created by Joe Shang on 7/14/15. 6 | // Copyright (c) 2015 Shang Chuanren. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController { 12 | NSString *_test; 13 | } 14 | 15 | @property (nonatomic, strong) NSString *test; 16 | 17 | 18 | @end 19 | 20 | -------------------------------------------------------------------------------- /CATextLayerTest/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // CATextLayerTest 4 | // 5 | // Created by Joe Shang on 7/14/15. 6 | // Copyright (c) 2015 Shang Chuanren. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CATextLayerTest 2 | 3 | 最近对网易新闻首页顶部标题栏与 UC 浏览器阅读器顶部标题栏的实现效果很好奇,于是尝试实现。字体变色比较好做,CATextLayer 本身就包含了 animated 的 `fontColor`,区域变色就有些麻烦。以前读过王轲的[《基于Core Animation的KTV歌词视图的平滑实现》](http://www.iwangke.me/2014/10/06/how-to-implement-a-core-animation-based-60-fps-ktv-lyrics-view/),提供一种使用 mask 实现区域变色的思路,很棒,自己按着这个思路尝试使用的时候,发现两个 Label 的字体不能完全重合,总有毛边,一直找不到原因。后来自己想到的一个新的思路,不使用两个 Label,而是将文字作为 mask:先创建一个 CALayer 类型的 baseLayer,背景颜色为白色,再创建一个 CALayer 类型的 subLayer,背景颜色为绿色,subLayer 作为 baseLayer 的子 layer。然后创建 CATextLayer,写上字,将这个 textLayer 作为 baseLayer 的 mask,变化过程中改变 subLayer 的 frame 就可以了。 4 | 5 | 效果如下: 6 | 7 | ![](./CATextLayerTest.gif) 8 | -------------------------------------------------------------------------------- /CATextLayerTestTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.joeshang.$(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 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata 19 | 20 | ## Other 21 | *.xccheckout 22 | *.moved-aside 23 | *.xcuserstate 24 | *.xcscmblueprint 25 | 26 | ## Obj-C/Swift specific 27 | *.hmap 28 | *.ipa 29 | 30 | # CocoaPods 31 | # 32 | # We recommend against adding the Pods directory to your .gitignore. However 33 | # you should judge for yourself, the pros and cons are mentioned at: 34 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 35 | # 36 | #Pods/ 37 | 38 | # Carthage 39 | # 40 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 41 | # Carthage/Checkouts 42 | 43 | Carthage/Build 44 | -------------------------------------------------------------------------------- /CATextLayerTestTests/CATextLayerTestTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // CATextLayerTestTests.m 3 | // CATextLayerTestTests 4 | // 5 | // Created by Joe Shang on 7/14/15. 6 | // Copyright (c) 2015 Shang Chuanren. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface CATextLayerTestTests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation CATextLayerTestTests 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 | -------------------------------------------------------------------------------- /CATextLayerTest/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 | } -------------------------------------------------------------------------------- /CATextLayerTest/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.joeshang.$(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 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /CATextLayerTest/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // CATextLayerTest 4 | // 5 | // Created by Joe Shang on 7/14/15. 6 | // Copyright (c) 2015 Shang Chuanren. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // 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. 25 | // 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. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // 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. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // 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. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /CATextLayerTest/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /CATextLayerTest/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 | -------------------------------------------------------------------------------- /CATextLayerTest/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // CATextLayerTest 4 | // 5 | // Created by Joe Shang on 7/14/15. 6 | // Copyright (c) 2015 Shang Chuanren. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | static CGFloat const kTextLayerFontSize = 29.0f; 12 | static CGFloat const kTextLayerSelectedFontSize = 35.0f; 13 | static CGFloat const kLayerWidth = 300.0f; 14 | static CGFloat const kLayerHeight = 40.0f; 15 | static CGFloat const kAnimationDuration = 5.0f; 16 | 17 | @interface ViewController () 18 | 19 | @property (nonatomic, strong) CATextLayer *colorTextLayer; 20 | @property (nonatomic, strong) CATextLayer *maskTextLayer; 21 | @property (nonatomic, strong) CALayer *topLayer; 22 | @property (nonatomic, strong) CALayer *bottomLayer; 23 | 24 | @end 25 | 26 | @implementation ViewController 27 | 28 | #pragma mark - Life Cycle 29 | 30 | - (void)viewDidLoad { 31 | [super viewDidLoad]; 32 | 33 | [self setupLayers]; 34 | } 35 | 36 | - (void)viewDidLayoutSubviews { 37 | [super viewDidLayoutSubviews]; 38 | 39 | CGPoint center = CGPointMake(roundf(self.view.bounds.size.width / 2), roundf(self.view.bounds.size.height / 4)); 40 | self.colorTextLayer.position = center; 41 | 42 | center.y += roundf(self.view.bounds.size.height / 2); 43 | self.bottomLayer.position = center; 44 | } 45 | 46 | #pragma mark - Setup Method 47 | 48 | - (void)setupLayers { 49 | [self.view.layer addSublayer:self.colorTextLayer]; 50 | 51 | self.bottomLayer.mask = self.maskTextLayer; 52 | [self.bottomLayer addSublayer:self.topLayer]; 53 | [self.view.layer addSublayer:self.bottomLayer]; 54 | 55 | CABasicAnimation *colorAnimation = [CABasicAnimation 56 | animationWithKeyPath:@"foregroundColor"]; 57 | colorAnimation.duration = kAnimationDuration; 58 | colorAnimation.fillMode = kCAFillModeForwards; 59 | colorAnimation.removedOnCompletion = NO; 60 | colorAnimation.fromValue = (id)[UIColor blackColor].CGColor; 61 | colorAnimation.toValue = (id)[UIColor redColor].CGColor; 62 | colorAnimation.timingFunction = [CAMediaTimingFunction 63 | functionWithName:kCAMediaTimingFunctionLinear]; 64 | CABasicAnimation *scaleAnimation = [CABasicAnimation 65 | animationWithKeyPath:@"fontSize"]; 66 | scaleAnimation.duration = kAnimationDuration; 67 | scaleAnimation.fillMode = kCAFillModeForwards; 68 | scaleAnimation.removedOnCompletion = NO; 69 | scaleAnimation.fromValue = @(kTextLayerFontSize); 70 | scaleAnimation.toValue = @(kTextLayerSelectedFontSize); 71 | scaleAnimation.timingFunction = [CAMediaTimingFunction 72 | functionWithName:kCAMediaTimingFunctionLinear]; 73 | CAAnimationGroup *animationGroup = [CAAnimationGroup animation]; 74 | animationGroup.duration = kAnimationDuration; 75 | animationGroup.timingFunction = [CAMediaTimingFunction 76 | functionWithName:kCAMediaTimingFunctionLinear]; 77 | animationGroup.fillMode = kCAFillModeForwards; 78 | animationGroup.removedOnCompletion = NO; 79 | animationGroup.animations = @[colorAnimation, scaleAnimation]; 80 | 81 | self.colorTextLayer.speed = 0.0f; 82 | [self.colorTextLayer addAnimation:animationGroup forKey:@"animateColorAndFontSize"]; 83 | 84 | self.maskTextLayer.speed = 0.0f; 85 | [self.maskTextLayer addAnimation:scaleAnimation forKey:@"animateFontSize"]; 86 | } 87 | 88 | #pragma mark - Target Action 89 | 90 | - (IBAction)onSliderValueChanged:(id)sender { 91 | UISlider *slider = (UISlider *)sender; 92 | 93 | self.colorTextLayer.timeOffset = slider.value; 94 | self.maskTextLayer.timeOffset = slider.value; 95 | 96 | [CATransaction begin]; 97 | [CATransaction setDisableActions:YES]; 98 | CGRect rect = self.topLayer.frame; 99 | rect.size.width = roundf(self.bottomLayer.frame.size.width * slider.value / kAnimationDuration); 100 | self.topLayer.frame = rect; 101 | [CATransaction commit]; 102 | } 103 | 104 | #pragma mark - Getters 105 | 106 | - (CATextLayer *)colorTextLayer { 107 | if (!_colorTextLayer) { 108 | _colorTextLayer = [CATextLayer layer]; 109 | _colorTextLayer.string = @"我会整体变色哦"; 110 | _colorTextLayer.foregroundColor = [UIColor blackColor].CGColor; 111 | _colorTextLayer.fontSize = kTextLayerFontSize; 112 | _colorTextLayer.contentsScale = [[UIScreen mainScreen] scale]; 113 | _colorTextLayer.alignmentMode = kCAAlignmentCenter; 114 | _colorTextLayer.frame = CGRectMake(0, 0, kLayerWidth, kLayerHeight); 115 | } 116 | return _colorTextLayer; 117 | } 118 | 119 | - (CATextLayer *)maskTextLayer { 120 | if (!_maskTextLayer) { 121 | _maskTextLayer = [CATextLayer layer]; 122 | _maskTextLayer.string = @"我会区域变色哦"; 123 | _maskTextLayer.foregroundColor = [UIColor whiteColor].CGColor; 124 | _maskTextLayer.fontSize = kTextLayerFontSize; 125 | _maskTextLayer.contentsScale = [[UIScreen mainScreen] scale]; 126 | _maskTextLayer.alignmentMode = kCAAlignmentCenter; 127 | _maskTextLayer.frame = CGRectMake(0, 0, kLayerWidth, kLayerHeight); 128 | } 129 | return _maskTextLayer; 130 | } 131 | 132 | - (CALayer *)topLayer { 133 | if (!_topLayer) { 134 | _topLayer = [CALayer layer]; 135 | _topLayer.backgroundColor = [UIColor blueColor].CGColor; 136 | _topLayer.frame = CGRectMake(0, 0, 0, kLayerHeight); 137 | } 138 | return _topLayer; 139 | } 140 | 141 | - (CALayer *)bottomLayer { 142 | if (!_bottomLayer) { 143 | _bottomLayer = [CALayer layer]; 144 | _bottomLayer.backgroundColor = [UIColor blackColor].CGColor; 145 | _bottomLayer.bounds = CGRectMake(0, 0, kLayerWidth, kLayerHeight); 146 | } 147 | return _bottomLayer; 148 | } 149 | @end 150 | -------------------------------------------------------------------------------- /CATextLayerTest.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | D242182A1B54D8010056D513 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = D24218291B54D8000056D513 /* main.m */; }; 11 | D242182D1B54D8010056D513 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D242182C1B54D8010056D513 /* AppDelegate.m */; }; 12 | D24218301B54D8010056D513 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D242182F1B54D8010056D513 /* ViewController.m */; }; 13 | D24218331B54D8010056D513 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D24218311B54D8010056D513 /* Main.storyboard */; }; 14 | D24218351B54D8010056D513 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D24218341B54D8010056D513 /* Images.xcassets */; }; 15 | D24218381B54D8010056D513 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = D24218361B54D8010056D513 /* LaunchScreen.xib */; }; 16 | D24218441B54D8010056D513 /* CATextLayerTestTests.m in Sources */ = {isa = PBXBuildFile; fileRef = D24218431B54D8010056D513 /* CATextLayerTestTests.m */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXContainerItemProxy section */ 20 | D242183E1B54D8010056D513 /* PBXContainerItemProxy */ = { 21 | isa = PBXContainerItemProxy; 22 | containerPortal = D242181C1B54D8000056D513 /* Project object */; 23 | proxyType = 1; 24 | remoteGlobalIDString = D24218231B54D8000056D513; 25 | remoteInfo = CATextLayerTest; 26 | }; 27 | /* End PBXContainerItemProxy section */ 28 | 29 | /* Begin PBXFileReference section */ 30 | D24218241B54D8000056D513 /* CATextLayerTest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CATextLayerTest.app; sourceTree = BUILT_PRODUCTS_DIR; }; 31 | D24218281B54D8000056D513 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 32 | D24218291B54D8000056D513 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 33 | D242182B1B54D8010056D513 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 34 | D242182C1B54D8010056D513 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 35 | D242182E1B54D8010056D513 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 36 | D242182F1B54D8010056D513 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 37 | D24218321B54D8010056D513 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 38 | D24218341B54D8010056D513 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 39 | D24218371B54D8010056D513 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 40 | D242183D1B54D8010056D513 /* CATextLayerTestTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CATextLayerTestTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | D24218421B54D8010056D513 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 42 | D24218431B54D8010056D513 /* CATextLayerTestTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CATextLayerTestTests.m; sourceTree = ""; }; 43 | /* End PBXFileReference section */ 44 | 45 | /* Begin PBXFrameworksBuildPhase section */ 46 | D24218211B54D8000056D513 /* Frameworks */ = { 47 | isa = PBXFrameworksBuildPhase; 48 | buildActionMask = 2147483647; 49 | files = ( 50 | ); 51 | runOnlyForDeploymentPostprocessing = 0; 52 | }; 53 | D242183A1B54D8010056D513 /* Frameworks */ = { 54 | isa = PBXFrameworksBuildPhase; 55 | buildActionMask = 2147483647; 56 | files = ( 57 | ); 58 | runOnlyForDeploymentPostprocessing = 0; 59 | }; 60 | /* End PBXFrameworksBuildPhase section */ 61 | 62 | /* Begin PBXGroup section */ 63 | D242181B1B54D8000056D513 = { 64 | isa = PBXGroup; 65 | children = ( 66 | D24218261B54D8000056D513 /* CATextLayerTest */, 67 | D24218401B54D8010056D513 /* CATextLayerTestTests */, 68 | D24218251B54D8000056D513 /* Products */, 69 | ); 70 | sourceTree = ""; 71 | }; 72 | D24218251B54D8000056D513 /* Products */ = { 73 | isa = PBXGroup; 74 | children = ( 75 | D24218241B54D8000056D513 /* CATextLayerTest.app */, 76 | D242183D1B54D8010056D513 /* CATextLayerTestTests.xctest */, 77 | ); 78 | name = Products; 79 | sourceTree = ""; 80 | }; 81 | D24218261B54D8000056D513 /* CATextLayerTest */ = { 82 | isa = PBXGroup; 83 | children = ( 84 | D242182B1B54D8010056D513 /* AppDelegate.h */, 85 | D242182C1B54D8010056D513 /* AppDelegate.m */, 86 | D242182E1B54D8010056D513 /* ViewController.h */, 87 | D242182F1B54D8010056D513 /* ViewController.m */, 88 | D24218311B54D8010056D513 /* Main.storyboard */, 89 | D24218341B54D8010056D513 /* Images.xcassets */, 90 | D24218361B54D8010056D513 /* LaunchScreen.xib */, 91 | D24218271B54D8000056D513 /* Supporting Files */, 92 | ); 93 | path = CATextLayerTest; 94 | sourceTree = ""; 95 | }; 96 | D24218271B54D8000056D513 /* Supporting Files */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | D24218281B54D8000056D513 /* Info.plist */, 100 | D24218291B54D8000056D513 /* main.m */, 101 | ); 102 | name = "Supporting Files"; 103 | sourceTree = ""; 104 | }; 105 | D24218401B54D8010056D513 /* CATextLayerTestTests */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | D24218431B54D8010056D513 /* CATextLayerTestTests.m */, 109 | D24218411B54D8010056D513 /* Supporting Files */, 110 | ); 111 | path = CATextLayerTestTests; 112 | sourceTree = ""; 113 | }; 114 | D24218411B54D8010056D513 /* Supporting Files */ = { 115 | isa = PBXGroup; 116 | children = ( 117 | D24218421B54D8010056D513 /* Info.plist */, 118 | ); 119 | name = "Supporting Files"; 120 | sourceTree = ""; 121 | }; 122 | /* End PBXGroup section */ 123 | 124 | /* Begin PBXNativeTarget section */ 125 | D24218231B54D8000056D513 /* CATextLayerTest */ = { 126 | isa = PBXNativeTarget; 127 | buildConfigurationList = D24218471B54D8010056D513 /* Build configuration list for PBXNativeTarget "CATextLayerTest" */; 128 | buildPhases = ( 129 | D24218201B54D8000056D513 /* Sources */, 130 | D24218211B54D8000056D513 /* Frameworks */, 131 | D24218221B54D8000056D513 /* Resources */, 132 | ); 133 | buildRules = ( 134 | ); 135 | dependencies = ( 136 | ); 137 | name = CATextLayerTest; 138 | productName = CATextLayerTest; 139 | productReference = D24218241B54D8000056D513 /* CATextLayerTest.app */; 140 | productType = "com.apple.product-type.application"; 141 | }; 142 | D242183C1B54D8010056D513 /* CATextLayerTestTests */ = { 143 | isa = PBXNativeTarget; 144 | buildConfigurationList = D242184A1B54D8010056D513 /* Build configuration list for PBXNativeTarget "CATextLayerTestTests" */; 145 | buildPhases = ( 146 | D24218391B54D8010056D513 /* Sources */, 147 | D242183A1B54D8010056D513 /* Frameworks */, 148 | D242183B1B54D8010056D513 /* Resources */, 149 | ); 150 | buildRules = ( 151 | ); 152 | dependencies = ( 153 | D242183F1B54D8010056D513 /* PBXTargetDependency */, 154 | ); 155 | name = CATextLayerTestTests; 156 | productName = CATextLayerTestTests; 157 | productReference = D242183D1B54D8010056D513 /* CATextLayerTestTests.xctest */; 158 | productType = "com.apple.product-type.bundle.unit-test"; 159 | }; 160 | /* End PBXNativeTarget section */ 161 | 162 | /* Begin PBXProject section */ 163 | D242181C1B54D8000056D513 /* Project object */ = { 164 | isa = PBXProject; 165 | attributes = { 166 | LastUpgradeCheck = 0630; 167 | ORGANIZATIONNAME = "Shang Chuanren"; 168 | TargetAttributes = { 169 | D24218231B54D8000056D513 = { 170 | CreatedOnToolsVersion = 6.3.2; 171 | }; 172 | D242183C1B54D8010056D513 = { 173 | CreatedOnToolsVersion = 6.3.2; 174 | TestTargetID = D24218231B54D8000056D513; 175 | }; 176 | }; 177 | }; 178 | buildConfigurationList = D242181F1B54D8000056D513 /* Build configuration list for PBXProject "CATextLayerTest" */; 179 | compatibilityVersion = "Xcode 3.2"; 180 | developmentRegion = English; 181 | hasScannedForEncodings = 0; 182 | knownRegions = ( 183 | en, 184 | Base, 185 | ); 186 | mainGroup = D242181B1B54D8000056D513; 187 | productRefGroup = D24218251B54D8000056D513 /* Products */; 188 | projectDirPath = ""; 189 | projectRoot = ""; 190 | targets = ( 191 | D24218231B54D8000056D513 /* CATextLayerTest */, 192 | D242183C1B54D8010056D513 /* CATextLayerTestTests */, 193 | ); 194 | }; 195 | /* End PBXProject section */ 196 | 197 | /* Begin PBXResourcesBuildPhase section */ 198 | D24218221B54D8000056D513 /* Resources */ = { 199 | isa = PBXResourcesBuildPhase; 200 | buildActionMask = 2147483647; 201 | files = ( 202 | D24218331B54D8010056D513 /* Main.storyboard in Resources */, 203 | D24218381B54D8010056D513 /* LaunchScreen.xib in Resources */, 204 | D24218351B54D8010056D513 /* Images.xcassets in Resources */, 205 | ); 206 | runOnlyForDeploymentPostprocessing = 0; 207 | }; 208 | D242183B1B54D8010056D513 /* Resources */ = { 209 | isa = PBXResourcesBuildPhase; 210 | buildActionMask = 2147483647; 211 | files = ( 212 | ); 213 | runOnlyForDeploymentPostprocessing = 0; 214 | }; 215 | /* End PBXResourcesBuildPhase section */ 216 | 217 | /* Begin PBXSourcesBuildPhase section */ 218 | D24218201B54D8000056D513 /* Sources */ = { 219 | isa = PBXSourcesBuildPhase; 220 | buildActionMask = 2147483647; 221 | files = ( 222 | D24218301B54D8010056D513 /* ViewController.m in Sources */, 223 | D242182D1B54D8010056D513 /* AppDelegate.m in Sources */, 224 | D242182A1B54D8010056D513 /* main.m in Sources */, 225 | ); 226 | runOnlyForDeploymentPostprocessing = 0; 227 | }; 228 | D24218391B54D8010056D513 /* Sources */ = { 229 | isa = PBXSourcesBuildPhase; 230 | buildActionMask = 2147483647; 231 | files = ( 232 | D24218441B54D8010056D513 /* CATextLayerTestTests.m in Sources */, 233 | ); 234 | runOnlyForDeploymentPostprocessing = 0; 235 | }; 236 | /* End PBXSourcesBuildPhase section */ 237 | 238 | /* Begin PBXTargetDependency section */ 239 | D242183F1B54D8010056D513 /* PBXTargetDependency */ = { 240 | isa = PBXTargetDependency; 241 | target = D24218231B54D8000056D513 /* CATextLayerTest */; 242 | targetProxy = D242183E1B54D8010056D513 /* PBXContainerItemProxy */; 243 | }; 244 | /* End PBXTargetDependency section */ 245 | 246 | /* Begin PBXVariantGroup section */ 247 | D24218311B54D8010056D513 /* Main.storyboard */ = { 248 | isa = PBXVariantGroup; 249 | children = ( 250 | D24218321B54D8010056D513 /* Base */, 251 | ); 252 | name = Main.storyboard; 253 | sourceTree = ""; 254 | }; 255 | D24218361B54D8010056D513 /* LaunchScreen.xib */ = { 256 | isa = PBXVariantGroup; 257 | children = ( 258 | D24218371B54D8010056D513 /* Base */, 259 | ); 260 | name = LaunchScreen.xib; 261 | sourceTree = ""; 262 | }; 263 | /* End PBXVariantGroup section */ 264 | 265 | /* Begin XCBuildConfiguration section */ 266 | D24218451B54D8010056D513 /* Debug */ = { 267 | isa = XCBuildConfiguration; 268 | buildSettings = { 269 | ALWAYS_SEARCH_USER_PATHS = NO; 270 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 271 | CLANG_CXX_LIBRARY = "libc++"; 272 | CLANG_ENABLE_MODULES = YES; 273 | CLANG_ENABLE_OBJC_ARC = YES; 274 | CLANG_WARN_BOOL_CONVERSION = YES; 275 | CLANG_WARN_CONSTANT_CONVERSION = YES; 276 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 277 | CLANG_WARN_EMPTY_BODY = YES; 278 | CLANG_WARN_ENUM_CONVERSION = YES; 279 | CLANG_WARN_INT_CONVERSION = YES; 280 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 281 | CLANG_WARN_UNREACHABLE_CODE = YES; 282 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 283 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 284 | COPY_PHASE_STRIP = NO; 285 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 286 | ENABLE_STRICT_OBJC_MSGSEND = YES; 287 | GCC_C_LANGUAGE_STANDARD = gnu99; 288 | GCC_DYNAMIC_NO_PIC = NO; 289 | GCC_NO_COMMON_BLOCKS = YES; 290 | GCC_OPTIMIZATION_LEVEL = 0; 291 | GCC_PREPROCESSOR_DEFINITIONS = ( 292 | "DEBUG=1", 293 | "$(inherited)", 294 | ); 295 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 296 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 297 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 298 | GCC_WARN_UNDECLARED_SELECTOR = YES; 299 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 300 | GCC_WARN_UNUSED_FUNCTION = YES; 301 | GCC_WARN_UNUSED_VARIABLE = YES; 302 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 303 | MTL_ENABLE_DEBUG_INFO = YES; 304 | ONLY_ACTIVE_ARCH = YES; 305 | SDKROOT = iphoneos; 306 | TARGETED_DEVICE_FAMILY = "1,2"; 307 | }; 308 | name = Debug; 309 | }; 310 | D24218461B54D8010056D513 /* Release */ = { 311 | isa = XCBuildConfiguration; 312 | buildSettings = { 313 | ALWAYS_SEARCH_USER_PATHS = NO; 314 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 315 | CLANG_CXX_LIBRARY = "libc++"; 316 | CLANG_ENABLE_MODULES = YES; 317 | CLANG_ENABLE_OBJC_ARC = YES; 318 | CLANG_WARN_BOOL_CONVERSION = YES; 319 | CLANG_WARN_CONSTANT_CONVERSION = YES; 320 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 321 | CLANG_WARN_EMPTY_BODY = YES; 322 | CLANG_WARN_ENUM_CONVERSION = YES; 323 | CLANG_WARN_INT_CONVERSION = YES; 324 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 325 | CLANG_WARN_UNREACHABLE_CODE = YES; 326 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 327 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 328 | COPY_PHASE_STRIP = NO; 329 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 330 | ENABLE_NS_ASSERTIONS = NO; 331 | ENABLE_STRICT_OBJC_MSGSEND = YES; 332 | GCC_C_LANGUAGE_STANDARD = gnu99; 333 | GCC_NO_COMMON_BLOCKS = YES; 334 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 335 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 336 | GCC_WARN_UNDECLARED_SELECTOR = YES; 337 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 338 | GCC_WARN_UNUSED_FUNCTION = YES; 339 | GCC_WARN_UNUSED_VARIABLE = YES; 340 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 341 | MTL_ENABLE_DEBUG_INFO = NO; 342 | SDKROOT = iphoneos; 343 | TARGETED_DEVICE_FAMILY = "1,2"; 344 | VALIDATE_PRODUCT = YES; 345 | }; 346 | name = Release; 347 | }; 348 | D24218481B54D8010056D513 /* Debug */ = { 349 | isa = XCBuildConfiguration; 350 | buildSettings = { 351 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 352 | INFOPLIST_FILE = CATextLayerTest/Info.plist; 353 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 354 | PRODUCT_NAME = "$(TARGET_NAME)"; 355 | }; 356 | name = Debug; 357 | }; 358 | D24218491B54D8010056D513 /* Release */ = { 359 | isa = XCBuildConfiguration; 360 | buildSettings = { 361 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 362 | INFOPLIST_FILE = CATextLayerTest/Info.plist; 363 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 364 | PRODUCT_NAME = "$(TARGET_NAME)"; 365 | }; 366 | name = Release; 367 | }; 368 | D242184B1B54D8010056D513 /* Debug */ = { 369 | isa = XCBuildConfiguration; 370 | buildSettings = { 371 | BUNDLE_LOADER = "$(TEST_HOST)"; 372 | FRAMEWORK_SEARCH_PATHS = ( 373 | "$(SDKROOT)/Developer/Library/Frameworks", 374 | "$(inherited)", 375 | ); 376 | GCC_PREPROCESSOR_DEFINITIONS = ( 377 | "DEBUG=1", 378 | "$(inherited)", 379 | ); 380 | INFOPLIST_FILE = CATextLayerTestTests/Info.plist; 381 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 382 | PRODUCT_NAME = "$(TARGET_NAME)"; 383 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CATextLayerTest.app/CATextLayerTest"; 384 | }; 385 | name = Debug; 386 | }; 387 | D242184C1B54D8010056D513 /* Release */ = { 388 | isa = XCBuildConfiguration; 389 | buildSettings = { 390 | BUNDLE_LOADER = "$(TEST_HOST)"; 391 | FRAMEWORK_SEARCH_PATHS = ( 392 | "$(SDKROOT)/Developer/Library/Frameworks", 393 | "$(inherited)", 394 | ); 395 | INFOPLIST_FILE = CATextLayerTestTests/Info.plist; 396 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 397 | PRODUCT_NAME = "$(TARGET_NAME)"; 398 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CATextLayerTest.app/CATextLayerTest"; 399 | }; 400 | name = Release; 401 | }; 402 | /* End XCBuildConfiguration section */ 403 | 404 | /* Begin XCConfigurationList section */ 405 | D242181F1B54D8000056D513 /* Build configuration list for PBXProject "CATextLayerTest" */ = { 406 | isa = XCConfigurationList; 407 | buildConfigurations = ( 408 | D24218451B54D8010056D513 /* Debug */, 409 | D24218461B54D8010056D513 /* Release */, 410 | ); 411 | defaultConfigurationIsVisible = 0; 412 | defaultConfigurationName = Release; 413 | }; 414 | D24218471B54D8010056D513 /* Build configuration list for PBXNativeTarget "CATextLayerTest" */ = { 415 | isa = XCConfigurationList; 416 | buildConfigurations = ( 417 | D24218481B54D8010056D513 /* Debug */, 418 | D24218491B54D8010056D513 /* Release */, 419 | ); 420 | defaultConfigurationIsVisible = 0; 421 | }; 422 | D242184A1B54D8010056D513 /* Build configuration list for PBXNativeTarget "CATextLayerTestTests" */ = { 423 | isa = XCConfigurationList; 424 | buildConfigurations = ( 425 | D242184B1B54D8010056D513 /* Debug */, 426 | D242184C1B54D8010056D513 /* Release */, 427 | ); 428 | defaultConfigurationIsVisible = 0; 429 | }; 430 | /* End XCConfigurationList section */ 431 | }; 432 | rootObject = D242181C1B54D8000056D513 /* Project object */; 433 | } 434 | --------------------------------------------------------------------------------