├── screenshots
├── half001.png
└── half002.png
├── OrgHalfLineLabel
├── Assets.xcassets
│ ├── Contents.json
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── ViewController.h
├── AppDelegate.h
├── main.m
├── OrgHalfLineLabel.h
├── Info.plist
├── Base.lproj
│ ├── Main.storyboard
│ └── LaunchScreen.storyboard
├── AppDelegate.m
├── ViewController.m
└── OrgHalfLineLabel.m
├── OrgHalfLineLabel.xcodeproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ ├── xcuserdata
│ │ └── 66-admin.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
├── xcuserdata
│ └── 66-admin.xcuserdatad
│ │ └── xcschemes
│ │ └── xcschememanagement.plist
└── project.pbxproj
├── README.md
├── OrgHalfLineLabelTests
├── Info.plist
└── OrgHalfLineLabelTests.m
└── OrgHalfLineLabelUITests
├── Info.plist
└── OrgHalfLineLabelUITests.m
/screenshots/half001.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Axk520/OrgHalfLineLabel/HEAD/screenshots/half001.png
--------------------------------------------------------------------------------
/screenshots/half002.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Axk520/OrgHalfLineLabel/HEAD/screenshots/half002.png
--------------------------------------------------------------------------------
/OrgHalfLineLabel/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/OrgHalfLineLabel.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/OrgHalfLineLabel.xcodeproj/project.xcworkspace/xcuserdata/66-admin.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Axk520/OrgHalfLineLabel/HEAD/OrgHalfLineLabel.xcodeproj/project.xcworkspace/xcuserdata/66-admin.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/OrgHalfLineLabel/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // OrgHalfLineLabel
4 | //
5 | // Created by 66-admin on 2018/5/3.
6 | // Copyright © 2018年 66-admin. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/OrgHalfLineLabel.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/OrgHalfLineLabel/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // OrgHalfLineLabel
4 | //
5 | // Created by 66-admin on 2018/5/3.
6 | // Copyright © 2018年 66-admin. 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 |
--------------------------------------------------------------------------------
/OrgHalfLineLabel/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // OrgHalfLineLabel
4 | //
5 | // Created by 66-admin on 2018/5/3.
6 | // Copyright © 2018年 66-admin. 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 | # OrgHalfLineLabel
2 | ### 【iOS】UILabel最后一行中间截断显示缩略符 并追加更多显示
3 | ### 【iOS】UILabel居上居中居下对齐方式
4 |
5 |
6 | ------
7 | > * 
8 |
9 | ###
10 | ------
11 | > * 
12 |
13 | ###
14 | ### [个人简书地址](https://www.jianshu.com/u/af3ffbc03930)
15 | ###
16 | ### [本文简书地址](https://www.jianshu.com/p/6abb8fb53827)
17 |
--------------------------------------------------------------------------------
/OrgHalfLineLabel.xcodeproj/xcuserdata/66-admin.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | OrgHalfLineLabel.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/OrgHalfLineLabelTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/OrgHalfLineLabelUITests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/OrgHalfLineLabelTests/OrgHalfLineLabelTests.m:
--------------------------------------------------------------------------------
1 | //
2 | // OrgHalfLineLabelTests.m
3 | // OrgHalfLineLabelTests
4 | //
5 | // Created by 66-admin on 2018/5/3.
6 | // Copyright © 2018年 66-admin. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface OrgHalfLineLabelTests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation OrgHalfLineLabelTests
16 |
17 | - (void)setUp {
18 | [super setUp];
19 | // Put setup code here. This method is called before the invocation of each test method in the class.
20 | }
21 |
22 | - (void)tearDown {
23 | // Put teardown code here. This method is called after the invocation of each test method in the class.
24 | [super tearDown];
25 | }
26 |
27 | - (void)testExample {
28 | // This is an example of a functional test case.
29 | // Use XCTAssert and related functions to verify your tests produce the correct results.
30 | }
31 |
32 | - (void)testPerformanceExample {
33 | // This is an example of a performance test case.
34 | [self measureBlock:^{
35 | // Put the code you want to measure the time of here.
36 | }];
37 | }
38 |
39 | @end
40 |
--------------------------------------------------------------------------------
/OrgHalfLineLabel/OrgHalfLineLabel.h:
--------------------------------------------------------------------------------
1 | //
2 | // OrgHalfLineLabel.h
3 | // Unity-iPhone
4 | //
5 | // Created by 66-admin on 2018/4/24.
6 | //
7 |
8 | #import
9 |
10 | typedef NS_ENUM(NSInteger, OrgHLVerticalTextAlignment) {
11 | OrgHLVerticalTextAlignmentTop,
12 | OrgHLVerticalTextAlignmentMiddle,
13 | OrgHLVerticalTextAlignmentBottom
14 | };
15 |
16 | @interface OrgHalfLineLabel : UILabel
17 |
18 | /**
19 | 上下对齐方式
20 | */
21 | @property (nonatomic, assign) OrgHLVerticalTextAlignment orgVerticalTextAlignment;
22 |
23 | /**
24 | 行间距
25 | */
26 | @property (nonatomic, assign) CGFloat orgLineSpacing;
27 |
28 | /**
29 | 字间距
30 | */
31 | @property (nonatomic, assign) CGFloat orgCharSpacing;
32 |
33 | /**
34 | 边距
35 | */
36 | @property (nonatomic, assign) UIEdgeInsets orgMargin;
37 |
38 | /**
39 | 尾行右缩进
40 | */
41 | @property (nonatomic, assign) CGFloat orgLastLineRightIndent;
42 |
43 | /**
44 | 尾行结束字符串
45 | */
46 | @property (nonatomic, copy) NSAttributedString * orgTruncationEndAttributedString;
47 |
48 | /**
49 | 实际绘制的行数,当 numberOfLines == 0 时
50 | */
51 | @property (nonatomic, assign, readonly) NSInteger orgDrawOfLines;
52 |
53 | @end
54 |
55 |
--------------------------------------------------------------------------------
/OrgHalfLineLabelUITests/OrgHalfLineLabelUITests.m:
--------------------------------------------------------------------------------
1 | //
2 | // OrgHalfLineLabelUITests.m
3 | // OrgHalfLineLabelUITests
4 | //
5 | // Created by 66-admin on 2018/5/3.
6 | // Copyright © 2018年 66-admin. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface OrgHalfLineLabelUITests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation OrgHalfLineLabelUITests
16 |
17 | - (void)setUp {
18 | [super setUp];
19 |
20 | // Put setup code here. This method is called before the invocation of each test method in the class.
21 |
22 | // In UI tests it is usually best to stop immediately when a failure occurs.
23 | self.continueAfterFailure = NO;
24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.
25 | [[[XCUIApplication alloc] init] launch];
26 |
27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
28 | }
29 |
30 | - (void)tearDown {
31 | // Put teardown code here. This method is called after the invocation of each test method in the class.
32 | [super tearDown];
33 | }
34 |
35 | - (void)testExample {
36 | // Use recording to get started writing UI tests.
37 | // Use XCTAssert and related functions to verify your tests produce the correct results.
38 | }
39 |
40 | @end
41 |
--------------------------------------------------------------------------------
/OrgHalfLineLabel/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIMainStoryboardFile
26 | Main
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 |
--------------------------------------------------------------------------------
/OrgHalfLineLabel/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 |
--------------------------------------------------------------------------------
/OrgHalfLineLabel/Base.lproj/LaunchScreen.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 |
--------------------------------------------------------------------------------
/OrgHalfLineLabel/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "20x20",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "20x20",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "29x29",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "29x29",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "40x40",
66 | "scale" : "1x"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "size" : "40x40",
71 | "scale" : "2x"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "size" : "76x76",
76 | "scale" : "1x"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "size" : "76x76",
81 | "scale" : "2x"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "size" : "83.5x83.5",
86 | "scale" : "2x"
87 | },
88 | {
89 | "idiom" : "ios-marketing",
90 | "size" : "1024x1024",
91 | "scale" : "1x"
92 | }
93 | ],
94 | "info" : {
95 | "version" : 1,
96 | "author" : "xcode"
97 | }
98 | }
--------------------------------------------------------------------------------
/OrgHalfLineLabel/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // OrgHalfLineLabel
4 | //
5 | // Created by 66-admin on 2018/5/3.
6 | // Copyright © 2018年 66-admin. 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 |
24 | - (void)applicationWillResignActive:(UIApplication *)application {
25 | // 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.
26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
27 | }
28 |
29 |
30 | - (void)applicationDidEnterBackground:(UIApplication *)application {
31 | // 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.
32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
33 | }
34 |
35 |
36 | - (void)applicationWillEnterForeground:(UIApplication *)application {
37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
38 | }
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 |
46 | - (void)applicationWillTerminate:(UIApplication *)application {
47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
48 | }
49 |
50 |
51 | @end
52 |
--------------------------------------------------------------------------------
/OrgHalfLineLabel/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // OrgHalfLineLabel
4 | //
5 | // Created by 66-admin on 2018/5/3.
6 | // Copyright © 2018年 66-admin. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 | #import "OrgHalfLineLabel.h"
11 |
12 | @interface ViewController ()
13 |
14 | @end
15 |
16 | @implementation ViewController
17 |
18 | - (void)viewDidLoad {
19 | [super viewDidLoad];
20 | // Do any additional setup after loading the view, typically from a nib.
21 |
22 | NSString * halfStr = @"我志愿加入中国共产党,拥护党的纲领,遵守党的章程,履行党员义务,执行党的决定,严守党的纪律,保守党的秘密,对党忠诚,积极工作,为共产主义奋斗终身,随时准备为党和人民牺牲一切,永不叛党。";
23 |
24 | //NSString * halfStr = @"I volunteered to join the Communist Party of China, adhered to the party's programme, adhered to the party's statute, fulfilled the party's obligations, carried out the party's decisions, strictly adhered to the party's discipline, conserved the secret of the party, worked hard for the party, worked hard for the Communist Party, and was ready to sacrifice the party and the people at any time and never rebel.";
25 |
26 | OrgHalfLineLabel * label1 = [[OrgHalfLineLabel alloc] initWithFrame:CGRectMake(10.f, 40.f, self.view.frame.size.width - 20.f, 100.f)];
27 | label1.backgroundColor = [UIColor lightGrayColor];
28 | label1.numberOfLines = 0;
29 | label1.orgLineSpacing = 5.f;
30 | label1.orgCharSpacing = 0.5;
31 | label1.orgLastLineRightIndent = 150.f;
32 | label1.orgTruncationEndAttributedString = [self orgSetAttributedStringStyle:@" 更多"];
33 | label1.text = halfStr;
34 | [self.view addSubview:label1];
35 |
36 | OrgHalfLineLabel * label4 = [[OrgHalfLineLabel alloc] initWithFrame:CGRectMake(10.f, CGRectGetMaxY(label1.frame) + 10.f, label1.frame.size.width, label1.frame.size.height)];
37 | label4.backgroundColor = [UIColor lightGrayColor];
38 | label4.numberOfLines = 0;
39 | label4.lineBreakMode = NSLineBreakByCharWrapping;
40 | label4.orgLineSpacing = 5.f;
41 | label4.orgCharSpacing = 0.5;
42 | label4.orgTruncationEndAttributedString = [self orgSetAttributedStringStyle:@" 更多"];
43 | label4.text = halfStr;
44 | [self.view addSubview:label4];
45 |
46 | OrgHalfLineLabel * label2 = [[OrgHalfLineLabel alloc] initWithFrame:CGRectMake(10.f, CGRectGetMaxY(label4.frame) + 10.f, label1.frame.size.width, 180.f)];
47 | label2.backgroundColor = [UIColor lightGrayColor];
48 | label2.numberOfLines = 0;
49 | label2.orgLineSpacing = 5.f;
50 | label2.orgCharSpacing = 0.5;
51 | label2.text = halfStr;
52 | [self.view addSubview:label2];
53 |
54 | OrgHalfLineLabel * label3 = [[OrgHalfLineLabel alloc] initWithFrame:CGRectMake(10.f, CGRectGetMaxY(label2.frame) + 10.f, label1.frame.size.width, label2.frame.size.height)];
55 | label3.backgroundColor = [UIColor lightGrayColor];
56 | label3.numberOfLines = 0;
57 | label3.orgLineSpacing = 5.f;
58 | label3.orgCharSpacing = 0.5;
59 | label3.orgVerticalTextAlignment = OrgHLVerticalTextAlignmentBottom;
60 | label3.text = halfStr;
61 | [self.view addSubview:label3];
62 | }
63 |
64 | - (NSMutableAttributedString *)orgSetAttributedStringStyle:(NSString *)string {
65 |
66 | if (!string) {
67 | return nil;
68 | }
69 |
70 | NSMutableParagraphStyle * style = [[NSMutableParagraphStyle alloc] init];
71 | style.paragraphSpacing = 0;
72 |
73 | NSMutableAttributedString * attributedString = [[NSMutableAttributedString alloc] initWithString:string];
74 | NSDictionary * attributes = @{NSForegroundColorAttributeName : [UIColor redColor],
75 | NSFontAttributeName : [UIFont systemFontOfSize:16],
76 | NSKernAttributeName : @(0.5)};
77 | [attributedString addAttributes:attributes range:NSMakeRange(0, [attributedString length])];
78 |
79 | return attributedString;
80 | }
81 |
82 | - (void)didReceiveMemoryWarning {
83 | [super didReceiveMemoryWarning];
84 | // Dispose of any resources that can be recreated.
85 | }
86 |
87 |
88 | @end
89 |
--------------------------------------------------------------------------------
/OrgHalfLineLabel/OrgHalfLineLabel.m:
--------------------------------------------------------------------------------
1 | //
2 | // OrgHalfLineLabel.m
3 | // Unity-iPhone
4 | //
5 | // Created by 66-admin on 2018/4/24.
6 | //
7 |
8 | #import "OrgHalfLineLabel.h"
9 | #import
10 |
11 | @interface OrgHalfLineLabel()
12 |
13 | @property (nonatomic, copy) NSMutableAttributedString * attributedString;
14 | @property (nonatomic, assign) BOOL isDisplay;
15 | @property (nonatomic, assign) BOOL isText;
16 |
17 | @end
18 |
19 | @implementation OrgHalfLineLabel
20 |
21 | - (id)initWithFrame:(CGRect)frame {
22 |
23 | self = [super initWithFrame:frame];
24 | if (self) {
25 | _orgMargin = UIEdgeInsetsZero;
26 | _isDisplay = YES;
27 | _orgVerticalTextAlignment = OrgHLVerticalTextAlignmentTop;
28 | }
29 | return self;
30 | }
31 |
32 | - (id)initWithCoder:(NSCoder *)aDecoder {
33 |
34 | self = [super initWithCoder:aDecoder];
35 | if (self) {
36 | _orgMargin = UIEdgeInsetsZero;
37 | _isDisplay = YES;
38 | _orgVerticalTextAlignment = OrgHLVerticalTextAlignmentTop;
39 | }
40 | return self;
41 | }
42 |
43 | - (void)dealloc {
44 |
45 | _attributedString = nil;
46 | _orgTruncationEndAttributedString = nil;
47 | }
48 |
49 | - (void)drawTextInRect:(CGRect)rect {
50 |
51 | if (self.text.length == 0 && self.attributedText == nil) {
52 | return;
53 | }
54 |
55 | if (_isDisplay) {
56 | if (_isText) {
57 | self.attributedString = [self orgSetAttributedStringStyle:self.text];
58 | } else {
59 | self.attributedString = [[NSMutableAttributedString alloc] initWithAttributedString:self.attributedText];
60 | }
61 | _isDisplay = NO;
62 | }
63 |
64 | if (!_attributedString) {
65 | return;
66 | }
67 |
68 | CGRect drawRect = CGRectMake(_orgMargin.left, _orgMargin.top, self.bounds.size.width - _orgMargin.left - _orgMargin.right, self.bounds.size.height - _orgMargin.top - _orgMargin.bottom);
69 | CTFramesetterRef framesetter = CTFramesetterCreateWithAttributedString((CFAttributedStringRef)_attributedString);
70 | CGMutablePathRef forecastPath = CGPathCreateMutable();
71 | CGPathAddRect(forecastPath, NULL, drawRect);
72 | CTFrameRef forecastFrame = CTFramesetterCreateFrame(framesetter, CFRangeMake(0, 0), forecastPath, NULL);
73 | CFArrayRef forecastLines = CTFrameGetLines(forecastFrame);
74 | long forecastMaxLineNumber = (long)CFArrayGetCount(forecastLines);
75 |
76 | CGRect drawingRect = CGRectMake(drawRect.origin.x, drawRect.origin.y, drawRect.size.width, CGFLOAT_MAX);
77 | CGMutablePathRef textpath = CGPathCreateMutable();
78 | CGPathAddRect(textpath, NULL, drawingRect);
79 | CTFrameRef textFrame = CTFramesetterCreateFrame(framesetter, CFRangeMake(0, 0), textpath, NULL);
80 | CFArrayRef textlines = CTFrameGetLines(textFrame);
81 | long textMaxLineNumber = (long)CFArrayGetCount(textlines);
82 |
83 | long minLinesNumber = MIN(forecastMaxLineNumber, textMaxLineNumber);
84 | _orgDrawOfLines = (int)(self.numberOfLines == 0 ? minLinesNumber : MIN(minLinesNumber, self.numberOfLines));
85 |
86 | CGContextRef context = UIGraphicsGetCurrentContext();
87 | CGContextSetTextMatrix(context, CGAffineTransformIdentity);
88 | CGContextTranslateCTM(context, 0, self.bounds.size.height);
89 | CGContextScaleCTM(context, 1.0, - 1.0);
90 |
91 | CGPoint lineOrigins[_orgDrawOfLines];
92 | CTFrameGetLineOrigins(forecastFrame, CFRangeMake(0, _orgDrawOfLines), lineOrigins);
93 |
94 | for (int lineIndex = 0; lineIndex < _orgDrawOfLines; lineIndex ++) {
95 | CTLineRef line = CFArrayGetValueAtIndex(forecastLines, lineIndex);
96 | CGPoint lineOrigin;
97 | if (forecastMaxLineNumber >= _orgDrawOfLines && _orgVerticalTextAlignment != OrgHLVerticalTextAlignmentTop) {
98 | if (_orgVerticalTextAlignment == OrgHLVerticalTextAlignmentMiddle) {
99 | float topMargin = lineOrigins[_orgDrawOfLines - 1].y / 2.0;
100 | lineOrigin = lineOrigins[lineIndex];
101 | lineOrigin = CGPointMake(lineOrigin.x, lineOrigin.y - floorf(topMargin));
102 | } else if (_orgVerticalTextAlignment == OrgHLVerticalTextAlignmentBottom) {
103 | CGFloat ascent;
104 | CGFloat descent;
105 | CGFloat leading;
106 | CTLineGetTypographicBounds(line, &ascent, &descent, &leading);
107 | lineOrigin = lineOrigins[_orgDrawOfLines - 1 - lineIndex];
108 | lineOrigin = CGPointMake(lineOrigin.x, (self.bounds.size.height - floorf(lineOrigin.y + ascent - descent)));
109 | }
110 | } else {
111 | lineOrigin = lineOrigins[lineIndex];
112 | }
113 |
114 | CTLineRef lastLine = nil;
115 | if (_orgDrawOfLines < textMaxLineNumber) {
116 | if (lineIndex == _orgDrawOfLines - 1) {
117 | CFRange range = CTLineGetStringRange(line);
118 | NSDictionary * attributes = [_attributedString attributesAtIndex:range.location + range.length - 1 effectiveRange:NULL];
119 | NSAttributedString * token = [[NSAttributedString alloc] initWithString:@"\u2026" attributes:attributes];
120 | if (_orgTruncationEndAttributedString != nil) {
121 | NSMutableAttributedString * attributedString = [[NSMutableAttributedString alloc] initWithAttributedString:token];
122 | [attributedString appendAttributedString:_orgTruncationEndAttributedString];
123 | token = attributedString;
124 | }
125 | CFAttributedStringRef tokenRef = (__bridge CFAttributedStringRef)token;
126 | CTLineRef truncationToken = CTLineCreateWithAttributedString(tokenRef);
127 |
128 | NSRange lastLineRange = NSMakeRange(range.location, 0);
129 | lastLineRange.length = [_attributedString length] - lastLineRange.location;
130 | CFAttributedStringRef longString = (__bridge CFAttributedStringRef)[_attributedString attributedSubstringFromRange:lastLineRange];
131 | CTLineRef endLine = CTLineCreateWithAttributedString(longString);
132 | lastLine = CTLineCreateTruncatedLine(endLine, self.bounds.size.width - _orgLastLineRightIndent, kCTLineTruncationEnd, truncationToken);
133 |
134 | if (truncationToken) {
135 | CFRelease(truncationToken);
136 | }
137 | if (endLine) {
138 | CFRelease(endLine);
139 | }
140 | }
141 | }
142 | if (lastLine) {
143 | CGContextSetTextPosition(context, lineOrigin.x, lineOrigin.y);
144 | CTLineDraw(lastLine, context);
145 | CFRelease(lastLine);
146 | } else {
147 | CGContextSetTextPosition(context, lineOrigin.x, lineOrigin.y);
148 | CTLineDraw(line, context);
149 | }
150 | }
151 |
152 | UIGraphicsPushContext(context);
153 | CFRelease(textpath);
154 | CFRelease(textFrame);
155 | CFRelease(forecastFrame);
156 | CFRelease(forecastPath);
157 | CFRelease(framesetter);
158 | }
159 |
160 | - (NSMutableAttributedString *)orgSetAttributedStringStyle:(NSString *)string {
161 |
162 | if (!string) {
163 | return nil;
164 | }
165 |
166 | NSMutableParagraphStyle * style = [[NSMutableParagraphStyle alloc] init];
167 | style.lineSpacing = (_orgLineSpacing > 0) ? _orgLineSpacing : 4;
168 | style.paragraphSpacing = 0;
169 | style.alignment = self.textAlignment;
170 | style.lineBreakMode = NSLineBreakByCharWrapping;
171 |
172 | NSMutableAttributedString * attributedString = [[NSMutableAttributedString alloc] initWithString:string];
173 | NSDictionary * attributes = @{NSForegroundColorAttributeName : self.textColor,
174 | NSFontAttributeName : self.font,
175 | NSKernAttributeName : @(_orgCharSpacing),
176 | NSParagraphStyleAttributeName : style};
177 | [attributedString addAttributes:attributes range:NSMakeRange(0, [attributedString length])];
178 |
179 | return attributedString;
180 | }
181 |
182 | - (void)setText:(NSString *)text {
183 |
184 | self.isDisplay = YES;
185 | self.isText = YES;
186 | [super setText:text];
187 | }
188 |
189 | - (void)setAttributedText:(NSAttributedString *)attributedText {
190 |
191 | self.isDisplay = YES;
192 | self.isText = NO;
193 | [super setAttributedText:attributedText];
194 | }
195 |
196 | - (void)setTextColor:(UIColor *)textColor {
197 |
198 | self.isDisplay = YES;
199 | [super setTextColor:textColor];
200 | }
201 |
202 | - (void)setTextAlignment:(NSTextAlignment)textAlignment {
203 |
204 | self.isDisplay = YES;
205 | [super setTextAlignment:textAlignment];
206 | }
207 |
208 | - (void)setFont:(UIFont *)font {
209 |
210 | self.isDisplay = YES;
211 | [super setFont:font];
212 | }
213 |
214 | - (void)setOrgLineSpacing:(CGFloat)orgLineSpacing {
215 |
216 | self.isDisplay = YES;
217 | _orgLineSpacing = orgLineSpacing;
218 | [self setNeedsDisplay];
219 | }
220 |
221 | - (void)setOrgCharSpacing:(CGFloat)orgCharSpacing {
222 |
223 | self.isDisplay = YES;
224 | _orgCharSpacing = orgCharSpacing;
225 | [self setNeedsDisplay];
226 | }
227 |
228 | - (void)setOrgMargin:(UIEdgeInsets)orgMargin {
229 |
230 | _orgMargin = orgMargin;
231 | [self setNeedsDisplay];
232 | }
233 |
234 | - (void)setOrgVerticalTextAlignment:(OrgHLVerticalTextAlignment)orgVerticalTextAlignment {
235 |
236 | _orgVerticalTextAlignment = orgVerticalTextAlignment;
237 | [self setNeedsDisplay];
238 | }
239 |
240 | @end
241 |
--------------------------------------------------------------------------------
/OrgHalfLineLabel.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 50;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 46266B8A209AD2FF0094ECF0 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 46266B89209AD2FF0094ECF0 /* AppDelegate.m */; };
11 | 46266B8D209AD2FF0094ECF0 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 46266B8C209AD2FF0094ECF0 /* ViewController.m */; };
12 | 46266B90209AD2FF0094ECF0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 46266B8E209AD2FF0094ECF0 /* Main.storyboard */; };
13 | 46266B92209AD3010094ECF0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 46266B91209AD3010094ECF0 /* Assets.xcassets */; };
14 | 46266B95209AD3010094ECF0 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 46266B93209AD3010094ECF0 /* LaunchScreen.storyboard */; };
15 | 46266B98209AD3010094ECF0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 46266B97209AD3010094ECF0 /* main.m */; };
16 | 46266BA2209AD3020094ECF0 /* OrgHalfLineLabelTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 46266BA1209AD3020094ECF0 /* OrgHalfLineLabelTests.m */; };
17 | 46266BAD209AD3020094ECF0 /* OrgHalfLineLabelUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 46266BAC209AD3020094ECF0 /* OrgHalfLineLabelUITests.m */; };
18 | 46266BBC209AD3630094ECF0 /* OrgHalfLineLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 46266BBB209AD3630094ECF0 /* OrgHalfLineLabel.m */; };
19 | /* End PBXBuildFile section */
20 |
21 | /* Begin PBXContainerItemProxy section */
22 | 46266B9E209AD3020094ECF0 /* PBXContainerItemProxy */ = {
23 | isa = PBXContainerItemProxy;
24 | containerPortal = 46266B7D209AD2FF0094ECF0 /* Project object */;
25 | proxyType = 1;
26 | remoteGlobalIDString = 46266B84209AD2FF0094ECF0;
27 | remoteInfo = OrgHalfLineLabel;
28 | };
29 | 46266BA9209AD3020094ECF0 /* PBXContainerItemProxy */ = {
30 | isa = PBXContainerItemProxy;
31 | containerPortal = 46266B7D209AD2FF0094ECF0 /* Project object */;
32 | proxyType = 1;
33 | remoteGlobalIDString = 46266B84209AD2FF0094ECF0;
34 | remoteInfo = OrgHalfLineLabel;
35 | };
36 | /* End PBXContainerItemProxy section */
37 |
38 | /* Begin PBXFileReference section */
39 | 46266B85209AD2FF0094ECF0 /* OrgHalfLineLabel.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OrgHalfLineLabel.app; sourceTree = BUILT_PRODUCTS_DIR; };
40 | 46266B88209AD2FF0094ECF0 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
41 | 46266B89209AD2FF0094ECF0 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
42 | 46266B8B209AD2FF0094ECF0 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; };
43 | 46266B8C209AD2FF0094ECF0 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; };
44 | 46266B8F209AD2FF0094ECF0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
45 | 46266B91209AD3010094ECF0 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
46 | 46266B94209AD3010094ECF0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
47 | 46266B96209AD3010094ECF0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
48 | 46266B97209AD3010094ECF0 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
49 | 46266B9D209AD3020094ECF0 /* OrgHalfLineLabelTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = OrgHalfLineLabelTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
50 | 46266BA1209AD3020094ECF0 /* OrgHalfLineLabelTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OrgHalfLineLabelTests.m; sourceTree = ""; };
51 | 46266BA3209AD3020094ECF0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
52 | 46266BA8209AD3020094ECF0 /* OrgHalfLineLabelUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = OrgHalfLineLabelUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
53 | 46266BAC209AD3020094ECF0 /* OrgHalfLineLabelUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OrgHalfLineLabelUITests.m; sourceTree = ""; };
54 | 46266BAE209AD3020094ECF0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
55 | 46266BBA209AD3630094ECF0 /* OrgHalfLineLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OrgHalfLineLabel.h; sourceTree = ""; };
56 | 46266BBB209AD3630094ECF0 /* OrgHalfLineLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OrgHalfLineLabel.m; sourceTree = ""; };
57 | /* End PBXFileReference section */
58 |
59 | /* Begin PBXFrameworksBuildPhase section */
60 | 46266B82209AD2FF0094ECF0 /* Frameworks */ = {
61 | isa = PBXFrameworksBuildPhase;
62 | buildActionMask = 2147483647;
63 | files = (
64 | );
65 | runOnlyForDeploymentPostprocessing = 0;
66 | };
67 | 46266B9A209AD3020094ECF0 /* Frameworks */ = {
68 | isa = PBXFrameworksBuildPhase;
69 | buildActionMask = 2147483647;
70 | files = (
71 | );
72 | runOnlyForDeploymentPostprocessing = 0;
73 | };
74 | 46266BA5209AD3020094ECF0 /* Frameworks */ = {
75 | isa = PBXFrameworksBuildPhase;
76 | buildActionMask = 2147483647;
77 | files = (
78 | );
79 | runOnlyForDeploymentPostprocessing = 0;
80 | };
81 | /* End PBXFrameworksBuildPhase section */
82 |
83 | /* Begin PBXGroup section */
84 | 46266B7C209AD2FF0094ECF0 = {
85 | isa = PBXGroup;
86 | children = (
87 | 46266B87209AD2FF0094ECF0 /* OrgHalfLineLabel */,
88 | 46266BA0209AD3020094ECF0 /* OrgHalfLineLabelTests */,
89 | 46266BAB209AD3020094ECF0 /* OrgHalfLineLabelUITests */,
90 | 46266B86209AD2FF0094ECF0 /* Products */,
91 | );
92 | sourceTree = "";
93 | };
94 | 46266B86209AD2FF0094ECF0 /* Products */ = {
95 | isa = PBXGroup;
96 | children = (
97 | 46266B85209AD2FF0094ECF0 /* OrgHalfLineLabel.app */,
98 | 46266B9D209AD3020094ECF0 /* OrgHalfLineLabelTests.xctest */,
99 | 46266BA8209AD3020094ECF0 /* OrgHalfLineLabelUITests.xctest */,
100 | );
101 | name = Products;
102 | sourceTree = "";
103 | };
104 | 46266B87209AD2FF0094ECF0 /* OrgHalfLineLabel */ = {
105 | isa = PBXGroup;
106 | children = (
107 | 46266BBA209AD3630094ECF0 /* OrgHalfLineLabel.h */,
108 | 46266BBB209AD3630094ECF0 /* OrgHalfLineLabel.m */,
109 | 46266B88209AD2FF0094ECF0 /* AppDelegate.h */,
110 | 46266B89209AD2FF0094ECF0 /* AppDelegate.m */,
111 | 46266B8B209AD2FF0094ECF0 /* ViewController.h */,
112 | 46266B8C209AD2FF0094ECF0 /* ViewController.m */,
113 | 46266B8E209AD2FF0094ECF0 /* Main.storyboard */,
114 | 46266B91209AD3010094ECF0 /* Assets.xcassets */,
115 | 46266B93209AD3010094ECF0 /* LaunchScreen.storyboard */,
116 | 46266B96209AD3010094ECF0 /* Info.plist */,
117 | 46266B97209AD3010094ECF0 /* main.m */,
118 | );
119 | path = OrgHalfLineLabel;
120 | sourceTree = "";
121 | };
122 | 46266BA0209AD3020094ECF0 /* OrgHalfLineLabelTests */ = {
123 | isa = PBXGroup;
124 | children = (
125 | 46266BA1209AD3020094ECF0 /* OrgHalfLineLabelTests.m */,
126 | 46266BA3209AD3020094ECF0 /* Info.plist */,
127 | );
128 | path = OrgHalfLineLabelTests;
129 | sourceTree = "";
130 | };
131 | 46266BAB209AD3020094ECF0 /* OrgHalfLineLabelUITests */ = {
132 | isa = PBXGroup;
133 | children = (
134 | 46266BAC209AD3020094ECF0 /* OrgHalfLineLabelUITests.m */,
135 | 46266BAE209AD3020094ECF0 /* Info.plist */,
136 | );
137 | path = OrgHalfLineLabelUITests;
138 | sourceTree = "";
139 | };
140 | /* End PBXGroup section */
141 |
142 | /* Begin PBXNativeTarget section */
143 | 46266B84209AD2FF0094ECF0 /* OrgHalfLineLabel */ = {
144 | isa = PBXNativeTarget;
145 | buildConfigurationList = 46266BB1209AD3020094ECF0 /* Build configuration list for PBXNativeTarget "OrgHalfLineLabel" */;
146 | buildPhases = (
147 | 46266B81209AD2FF0094ECF0 /* Sources */,
148 | 46266B82209AD2FF0094ECF0 /* Frameworks */,
149 | 46266B83209AD2FF0094ECF0 /* Resources */,
150 | );
151 | buildRules = (
152 | );
153 | dependencies = (
154 | );
155 | name = OrgHalfLineLabel;
156 | productName = OrgHalfLineLabel;
157 | productReference = 46266B85209AD2FF0094ECF0 /* OrgHalfLineLabel.app */;
158 | productType = "com.apple.product-type.application";
159 | };
160 | 46266B9C209AD3020094ECF0 /* OrgHalfLineLabelTests */ = {
161 | isa = PBXNativeTarget;
162 | buildConfigurationList = 46266BB4209AD3020094ECF0 /* Build configuration list for PBXNativeTarget "OrgHalfLineLabelTests" */;
163 | buildPhases = (
164 | 46266B99209AD3020094ECF0 /* Sources */,
165 | 46266B9A209AD3020094ECF0 /* Frameworks */,
166 | 46266B9B209AD3020094ECF0 /* Resources */,
167 | );
168 | buildRules = (
169 | );
170 | dependencies = (
171 | 46266B9F209AD3020094ECF0 /* PBXTargetDependency */,
172 | );
173 | name = OrgHalfLineLabelTests;
174 | productName = OrgHalfLineLabelTests;
175 | productReference = 46266B9D209AD3020094ECF0 /* OrgHalfLineLabelTests.xctest */;
176 | productType = "com.apple.product-type.bundle.unit-test";
177 | };
178 | 46266BA7209AD3020094ECF0 /* OrgHalfLineLabelUITests */ = {
179 | isa = PBXNativeTarget;
180 | buildConfigurationList = 46266BB7209AD3020094ECF0 /* Build configuration list for PBXNativeTarget "OrgHalfLineLabelUITests" */;
181 | buildPhases = (
182 | 46266BA4209AD3020094ECF0 /* Sources */,
183 | 46266BA5209AD3020094ECF0 /* Frameworks */,
184 | 46266BA6209AD3020094ECF0 /* Resources */,
185 | );
186 | buildRules = (
187 | );
188 | dependencies = (
189 | 46266BAA209AD3020094ECF0 /* PBXTargetDependency */,
190 | );
191 | name = OrgHalfLineLabelUITests;
192 | productName = OrgHalfLineLabelUITests;
193 | productReference = 46266BA8209AD3020094ECF0 /* OrgHalfLineLabelUITests.xctest */;
194 | productType = "com.apple.product-type.bundle.ui-testing";
195 | };
196 | /* End PBXNativeTarget section */
197 |
198 | /* Begin PBXProject section */
199 | 46266B7D209AD2FF0094ECF0 /* Project object */ = {
200 | isa = PBXProject;
201 | attributes = {
202 | LastUpgradeCheck = 0930;
203 | ORGANIZATIONNAME = "66-admin";
204 | TargetAttributes = {
205 | 46266B84209AD2FF0094ECF0 = {
206 | CreatedOnToolsVersion = 9.3;
207 | };
208 | 46266B9C209AD3020094ECF0 = {
209 | CreatedOnToolsVersion = 9.3;
210 | TestTargetID = 46266B84209AD2FF0094ECF0;
211 | };
212 | 46266BA7209AD3020094ECF0 = {
213 | CreatedOnToolsVersion = 9.3;
214 | TestTargetID = 46266B84209AD2FF0094ECF0;
215 | };
216 | };
217 | };
218 | buildConfigurationList = 46266B80209AD2FF0094ECF0 /* Build configuration list for PBXProject "OrgHalfLineLabel" */;
219 | compatibilityVersion = "Xcode 9.3";
220 | developmentRegion = en;
221 | hasScannedForEncodings = 0;
222 | knownRegions = (
223 | en,
224 | Base,
225 | );
226 | mainGroup = 46266B7C209AD2FF0094ECF0;
227 | productRefGroup = 46266B86209AD2FF0094ECF0 /* Products */;
228 | projectDirPath = "";
229 | projectRoot = "";
230 | targets = (
231 | 46266B84209AD2FF0094ECF0 /* OrgHalfLineLabel */,
232 | 46266B9C209AD3020094ECF0 /* OrgHalfLineLabelTests */,
233 | 46266BA7209AD3020094ECF0 /* OrgHalfLineLabelUITests */,
234 | );
235 | };
236 | /* End PBXProject section */
237 |
238 | /* Begin PBXResourcesBuildPhase section */
239 | 46266B83209AD2FF0094ECF0 /* Resources */ = {
240 | isa = PBXResourcesBuildPhase;
241 | buildActionMask = 2147483647;
242 | files = (
243 | 46266B95209AD3010094ECF0 /* LaunchScreen.storyboard in Resources */,
244 | 46266B92209AD3010094ECF0 /* Assets.xcassets in Resources */,
245 | 46266B90209AD2FF0094ECF0 /* Main.storyboard in Resources */,
246 | );
247 | runOnlyForDeploymentPostprocessing = 0;
248 | };
249 | 46266B9B209AD3020094ECF0 /* Resources */ = {
250 | isa = PBXResourcesBuildPhase;
251 | buildActionMask = 2147483647;
252 | files = (
253 | );
254 | runOnlyForDeploymentPostprocessing = 0;
255 | };
256 | 46266BA6209AD3020094ECF0 /* Resources */ = {
257 | isa = PBXResourcesBuildPhase;
258 | buildActionMask = 2147483647;
259 | files = (
260 | );
261 | runOnlyForDeploymentPostprocessing = 0;
262 | };
263 | /* End PBXResourcesBuildPhase section */
264 |
265 | /* Begin PBXSourcesBuildPhase section */
266 | 46266B81209AD2FF0094ECF0 /* Sources */ = {
267 | isa = PBXSourcesBuildPhase;
268 | buildActionMask = 2147483647;
269 | files = (
270 | 46266BBC209AD3630094ECF0 /* OrgHalfLineLabel.m in Sources */,
271 | 46266B8D209AD2FF0094ECF0 /* ViewController.m in Sources */,
272 | 46266B98209AD3010094ECF0 /* main.m in Sources */,
273 | 46266B8A209AD2FF0094ECF0 /* AppDelegate.m in Sources */,
274 | );
275 | runOnlyForDeploymentPostprocessing = 0;
276 | };
277 | 46266B99209AD3020094ECF0 /* Sources */ = {
278 | isa = PBXSourcesBuildPhase;
279 | buildActionMask = 2147483647;
280 | files = (
281 | 46266BA2209AD3020094ECF0 /* OrgHalfLineLabelTests.m in Sources */,
282 | );
283 | runOnlyForDeploymentPostprocessing = 0;
284 | };
285 | 46266BA4209AD3020094ECF0 /* Sources */ = {
286 | isa = PBXSourcesBuildPhase;
287 | buildActionMask = 2147483647;
288 | files = (
289 | 46266BAD209AD3020094ECF0 /* OrgHalfLineLabelUITests.m in Sources */,
290 | );
291 | runOnlyForDeploymentPostprocessing = 0;
292 | };
293 | /* End PBXSourcesBuildPhase section */
294 |
295 | /* Begin PBXTargetDependency section */
296 | 46266B9F209AD3020094ECF0 /* PBXTargetDependency */ = {
297 | isa = PBXTargetDependency;
298 | target = 46266B84209AD2FF0094ECF0 /* OrgHalfLineLabel */;
299 | targetProxy = 46266B9E209AD3020094ECF0 /* PBXContainerItemProxy */;
300 | };
301 | 46266BAA209AD3020094ECF0 /* PBXTargetDependency */ = {
302 | isa = PBXTargetDependency;
303 | target = 46266B84209AD2FF0094ECF0 /* OrgHalfLineLabel */;
304 | targetProxy = 46266BA9209AD3020094ECF0 /* PBXContainerItemProxy */;
305 | };
306 | /* End PBXTargetDependency section */
307 |
308 | /* Begin PBXVariantGroup section */
309 | 46266B8E209AD2FF0094ECF0 /* Main.storyboard */ = {
310 | isa = PBXVariantGroup;
311 | children = (
312 | 46266B8F209AD2FF0094ECF0 /* Base */,
313 | );
314 | name = Main.storyboard;
315 | sourceTree = "";
316 | };
317 | 46266B93209AD3010094ECF0 /* LaunchScreen.storyboard */ = {
318 | isa = PBXVariantGroup;
319 | children = (
320 | 46266B94209AD3010094ECF0 /* Base */,
321 | );
322 | name = LaunchScreen.storyboard;
323 | sourceTree = "";
324 | };
325 | /* End PBXVariantGroup section */
326 |
327 | /* Begin XCBuildConfiguration section */
328 | 46266BAF209AD3020094ECF0 /* Debug */ = {
329 | isa = XCBuildConfiguration;
330 | buildSettings = {
331 | ALWAYS_SEARCH_USER_PATHS = NO;
332 | CLANG_ANALYZER_NONNULL = YES;
333 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
334 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
335 | CLANG_CXX_LIBRARY = "libc++";
336 | CLANG_ENABLE_MODULES = YES;
337 | CLANG_ENABLE_OBJC_ARC = YES;
338 | CLANG_ENABLE_OBJC_WEAK = YES;
339 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
340 | CLANG_WARN_BOOL_CONVERSION = YES;
341 | CLANG_WARN_COMMA = YES;
342 | CLANG_WARN_CONSTANT_CONVERSION = YES;
343 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
344 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
345 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
346 | CLANG_WARN_EMPTY_BODY = YES;
347 | CLANG_WARN_ENUM_CONVERSION = YES;
348 | CLANG_WARN_INFINITE_RECURSION = YES;
349 | CLANG_WARN_INT_CONVERSION = YES;
350 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
351 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
352 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
353 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
354 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
355 | CLANG_WARN_STRICT_PROTOTYPES = YES;
356 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
357 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
358 | CLANG_WARN_UNREACHABLE_CODE = YES;
359 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
360 | CODE_SIGN_IDENTITY = "iPhone Developer";
361 | COPY_PHASE_STRIP = NO;
362 | DEBUG_INFORMATION_FORMAT = dwarf;
363 | ENABLE_STRICT_OBJC_MSGSEND = YES;
364 | ENABLE_TESTABILITY = YES;
365 | GCC_C_LANGUAGE_STANDARD = gnu11;
366 | GCC_DYNAMIC_NO_PIC = NO;
367 | GCC_NO_COMMON_BLOCKS = YES;
368 | GCC_OPTIMIZATION_LEVEL = 0;
369 | GCC_PREPROCESSOR_DEFINITIONS = (
370 | "DEBUG=1",
371 | "$(inherited)",
372 | );
373 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
374 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
375 | GCC_WARN_UNDECLARED_SELECTOR = YES;
376 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
377 | GCC_WARN_UNUSED_FUNCTION = YES;
378 | GCC_WARN_UNUSED_VARIABLE = YES;
379 | IPHONEOS_DEPLOYMENT_TARGET = 11.3;
380 | MTL_ENABLE_DEBUG_INFO = YES;
381 | ONLY_ACTIVE_ARCH = YES;
382 | SDKROOT = iphoneos;
383 | };
384 | name = Debug;
385 | };
386 | 46266BB0209AD3020094ECF0 /* Release */ = {
387 | isa = XCBuildConfiguration;
388 | buildSettings = {
389 | ALWAYS_SEARCH_USER_PATHS = NO;
390 | CLANG_ANALYZER_NONNULL = YES;
391 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
392 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
393 | CLANG_CXX_LIBRARY = "libc++";
394 | CLANG_ENABLE_MODULES = YES;
395 | CLANG_ENABLE_OBJC_ARC = YES;
396 | CLANG_ENABLE_OBJC_WEAK = YES;
397 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
398 | CLANG_WARN_BOOL_CONVERSION = YES;
399 | CLANG_WARN_COMMA = YES;
400 | CLANG_WARN_CONSTANT_CONVERSION = YES;
401 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
402 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
403 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
404 | CLANG_WARN_EMPTY_BODY = YES;
405 | CLANG_WARN_ENUM_CONVERSION = YES;
406 | CLANG_WARN_INFINITE_RECURSION = YES;
407 | CLANG_WARN_INT_CONVERSION = YES;
408 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
409 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
410 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
411 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
412 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
413 | CLANG_WARN_STRICT_PROTOTYPES = YES;
414 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
415 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
416 | CLANG_WARN_UNREACHABLE_CODE = YES;
417 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
418 | CODE_SIGN_IDENTITY = "iPhone Developer";
419 | COPY_PHASE_STRIP = NO;
420 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
421 | ENABLE_NS_ASSERTIONS = NO;
422 | ENABLE_STRICT_OBJC_MSGSEND = YES;
423 | GCC_C_LANGUAGE_STANDARD = gnu11;
424 | GCC_NO_COMMON_BLOCKS = YES;
425 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
426 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
427 | GCC_WARN_UNDECLARED_SELECTOR = YES;
428 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
429 | GCC_WARN_UNUSED_FUNCTION = YES;
430 | GCC_WARN_UNUSED_VARIABLE = YES;
431 | IPHONEOS_DEPLOYMENT_TARGET = 11.3;
432 | MTL_ENABLE_DEBUG_INFO = NO;
433 | SDKROOT = iphoneos;
434 | VALIDATE_PRODUCT = YES;
435 | };
436 | name = Release;
437 | };
438 | 46266BB2209AD3020094ECF0 /* Debug */ = {
439 | isa = XCBuildConfiguration;
440 | buildSettings = {
441 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
442 | CODE_SIGN_STYLE = Manual;
443 | DEVELOPMENT_TEAM = "";
444 | INFOPLIST_FILE = OrgHalfLineLabel/Info.plist;
445 | LD_RUNPATH_SEARCH_PATHS = (
446 | "$(inherited)",
447 | "@executable_path/Frameworks",
448 | );
449 | PRODUCT_BUNDLE_IDENTIFIER = com.66rpg.OrgHalfLineLabel;
450 | PRODUCT_NAME = "$(TARGET_NAME)";
451 | PROVISIONING_PROFILE_SPECIFIER = "";
452 | TARGETED_DEVICE_FAMILY = "1,2";
453 | };
454 | name = Debug;
455 | };
456 | 46266BB3209AD3020094ECF0 /* Release */ = {
457 | isa = XCBuildConfiguration;
458 | buildSettings = {
459 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
460 | CODE_SIGN_STYLE = Manual;
461 | DEVELOPMENT_TEAM = "";
462 | INFOPLIST_FILE = OrgHalfLineLabel/Info.plist;
463 | LD_RUNPATH_SEARCH_PATHS = (
464 | "$(inherited)",
465 | "@executable_path/Frameworks",
466 | );
467 | PRODUCT_BUNDLE_IDENTIFIER = com.66rpg.OrgHalfLineLabel;
468 | PRODUCT_NAME = "$(TARGET_NAME)";
469 | PROVISIONING_PROFILE_SPECIFIER = "";
470 | TARGETED_DEVICE_FAMILY = "1,2";
471 | };
472 | name = Release;
473 | };
474 | 46266BB5209AD3020094ECF0 /* Debug */ = {
475 | isa = XCBuildConfiguration;
476 | buildSettings = {
477 | BUNDLE_LOADER = "$(TEST_HOST)";
478 | CODE_SIGN_STYLE = Automatic;
479 | INFOPLIST_FILE = OrgHalfLineLabelTests/Info.plist;
480 | LD_RUNPATH_SEARCH_PATHS = (
481 | "$(inherited)",
482 | "@executable_path/Frameworks",
483 | "@loader_path/Frameworks",
484 | );
485 | PRODUCT_BUNDLE_IDENTIFIER = com.66rpg.OrgHalfLineLabelTests;
486 | PRODUCT_NAME = "$(TARGET_NAME)";
487 | TARGETED_DEVICE_FAMILY = "1,2";
488 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/OrgHalfLineLabel.app/OrgHalfLineLabel";
489 | };
490 | name = Debug;
491 | };
492 | 46266BB6209AD3020094ECF0 /* Release */ = {
493 | isa = XCBuildConfiguration;
494 | buildSettings = {
495 | BUNDLE_LOADER = "$(TEST_HOST)";
496 | CODE_SIGN_STYLE = Automatic;
497 | INFOPLIST_FILE = OrgHalfLineLabelTests/Info.plist;
498 | LD_RUNPATH_SEARCH_PATHS = (
499 | "$(inherited)",
500 | "@executable_path/Frameworks",
501 | "@loader_path/Frameworks",
502 | );
503 | PRODUCT_BUNDLE_IDENTIFIER = com.66rpg.OrgHalfLineLabelTests;
504 | PRODUCT_NAME = "$(TARGET_NAME)";
505 | TARGETED_DEVICE_FAMILY = "1,2";
506 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/OrgHalfLineLabel.app/OrgHalfLineLabel";
507 | };
508 | name = Release;
509 | };
510 | 46266BB8209AD3020094ECF0 /* Debug */ = {
511 | isa = XCBuildConfiguration;
512 | buildSettings = {
513 | CODE_SIGN_STYLE = Automatic;
514 | INFOPLIST_FILE = OrgHalfLineLabelUITests/Info.plist;
515 | LD_RUNPATH_SEARCH_PATHS = (
516 | "$(inherited)",
517 | "@executable_path/Frameworks",
518 | "@loader_path/Frameworks",
519 | );
520 | PRODUCT_BUNDLE_IDENTIFIER = com.66rpg.OrgHalfLineLabelUITests;
521 | PRODUCT_NAME = "$(TARGET_NAME)";
522 | TARGETED_DEVICE_FAMILY = "1,2";
523 | TEST_TARGET_NAME = OrgHalfLineLabel;
524 | };
525 | name = Debug;
526 | };
527 | 46266BB9209AD3020094ECF0 /* Release */ = {
528 | isa = XCBuildConfiguration;
529 | buildSettings = {
530 | CODE_SIGN_STYLE = Automatic;
531 | INFOPLIST_FILE = OrgHalfLineLabelUITests/Info.plist;
532 | LD_RUNPATH_SEARCH_PATHS = (
533 | "$(inherited)",
534 | "@executable_path/Frameworks",
535 | "@loader_path/Frameworks",
536 | );
537 | PRODUCT_BUNDLE_IDENTIFIER = com.66rpg.OrgHalfLineLabelUITests;
538 | PRODUCT_NAME = "$(TARGET_NAME)";
539 | TARGETED_DEVICE_FAMILY = "1,2";
540 | TEST_TARGET_NAME = OrgHalfLineLabel;
541 | };
542 | name = Release;
543 | };
544 | /* End XCBuildConfiguration section */
545 |
546 | /* Begin XCConfigurationList section */
547 | 46266B80209AD2FF0094ECF0 /* Build configuration list for PBXProject "OrgHalfLineLabel" */ = {
548 | isa = XCConfigurationList;
549 | buildConfigurations = (
550 | 46266BAF209AD3020094ECF0 /* Debug */,
551 | 46266BB0209AD3020094ECF0 /* Release */,
552 | );
553 | defaultConfigurationIsVisible = 0;
554 | defaultConfigurationName = Release;
555 | };
556 | 46266BB1209AD3020094ECF0 /* Build configuration list for PBXNativeTarget "OrgHalfLineLabel" */ = {
557 | isa = XCConfigurationList;
558 | buildConfigurations = (
559 | 46266BB2209AD3020094ECF0 /* Debug */,
560 | 46266BB3209AD3020094ECF0 /* Release */,
561 | );
562 | defaultConfigurationIsVisible = 0;
563 | defaultConfigurationName = Release;
564 | };
565 | 46266BB4209AD3020094ECF0 /* Build configuration list for PBXNativeTarget "OrgHalfLineLabelTests" */ = {
566 | isa = XCConfigurationList;
567 | buildConfigurations = (
568 | 46266BB5209AD3020094ECF0 /* Debug */,
569 | 46266BB6209AD3020094ECF0 /* Release */,
570 | );
571 | defaultConfigurationIsVisible = 0;
572 | defaultConfigurationName = Release;
573 | };
574 | 46266BB7209AD3020094ECF0 /* Build configuration list for PBXNativeTarget "OrgHalfLineLabelUITests" */ = {
575 | isa = XCConfigurationList;
576 | buildConfigurations = (
577 | 46266BB8209AD3020094ECF0 /* Debug */,
578 | 46266BB9209AD3020094ECF0 /* Release */,
579 | );
580 | defaultConfigurationIsVisible = 0;
581 | defaultConfigurationName = Release;
582 | };
583 | /* End XCConfigurationList section */
584 | };
585 | rootObject = 46266B7D209AD2FF0094ECF0 /* Project object */;
586 | }
587 |
--------------------------------------------------------------------------------