Skip to content

Commit f2789c9

Browse files
committed
Optimization of text format
1 parent 9027a0e commit f2789c9

File tree

10 files changed

+38
-32
lines changed

10 files changed

+38
-32
lines changed

CYLTabBarController.xcodeproj/project.pbxproj

+6-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
9AE942ED1BDC933E00354519 /* CYLSameFityViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AE942E01BDC933E00354519 /* CYLSameFityViewController.m */; };
1919
9AE942EE1BDC933E00354519 /* CYLDetailsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AE942E21BDC933E00354519 /* CYLDetailsViewController.m */; };
2020
9AE942EF1BDC933E00354519 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9AE942E31BDC933E00354519 /* Images.xcassets */; };
21-
9AE942F01BDC933E00354519 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 9AE942E41BDC933E00354519 /* Info.plist */; };
2221
9AE942F11BDC933E00354519 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AE942E51BDC933E00354519 /* main.m */; };
2322
9AE942F91BDC937F00354519 /* CYLPlusButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AE942F41BDC937F00354519 /* CYLPlusButton.m */; };
2423
9AE942FA1BDC937F00354519 /* CYLTabBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 9AE942F61BDC937F00354519 /* CYLTabBar.m */; };
@@ -260,7 +259,7 @@
260259
9AE9426C1BDC91B800354519 /* Project object */ = {
261260
isa = PBXProject;
262261
attributes = {
263-
LastUpgradeCheck = 0630;
262+
LastUpgradeCheck = 0710;
264263
ORGANIZATIONNAME = "微博@iOS程序犭袁";
265264
TargetAttributes = {
266265
9AE942731BDC91B800354519 = {
@@ -297,7 +296,6 @@
297296
isa = PBXResourcesBuildPhase;
298297
buildActionMask = 2147483647;
299298
files = (
300-
9AE942F01BDC933E00354519 /* Info.plist in Resources */,
301299
9AE942EF1BDC933E00354519 /* Images.xcassets in Resources */,
302300
9AE942E71BDC933E00354519 /* LaunchScreen.xib in Resources */,
303301
9AE942E81BDC933E00354519 /* Main.storyboard in Resources */,
@@ -391,6 +389,7 @@
391389
COPY_PHASE_STRIP = NO;
392390
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
393391
ENABLE_STRICT_OBJC_MSGSEND = YES;
392+
ENABLE_TESTABILITY = YES;
394393
GCC_C_LANGUAGE_STANDARD = gnu99;
395394
GCC_DYNAMIC_NO_PIC = NO;
396395
GCC_NO_COMMON_BLOCKS = YES;
@@ -460,6 +459,7 @@
460459
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
461460
INFOPLIST_FILE = "$(SRCROOT)/Example/Info.plist";
462461
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
462+
PRODUCT_BUNDLE_IDENTIFIER = "CYL.$(PRODUCT_NAME:rfc1034identifier)";
463463
PRODUCT_NAME = "$(TARGET_NAME)";
464464
PROVISIONING_PROFILE = "";
465465
};
@@ -473,6 +473,7 @@
473473
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
474474
INFOPLIST_FILE = "$(SRCROOT)/Example/Info.plist";
475475
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
476+
PRODUCT_BUNDLE_IDENTIFIER = "CYL.$(PRODUCT_NAME:rfc1034identifier)";
476477
PRODUCT_NAME = "$(TARGET_NAME)";
477478
PROVISIONING_PROFILE = "";
478479
};
@@ -492,6 +493,7 @@
492493
);
493494
INFOPLIST_FILE = CYLTabBarControllerTests/Info.plist;
494495
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
496+
PRODUCT_BUNDLE_IDENTIFIER = "CYL.$(PRODUCT_NAME:rfc1034identifier)";
495497
PRODUCT_NAME = "$(TARGET_NAME)";
496498
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CYLTabBarController.app/CYLTabBarController";
497499
};
@@ -507,6 +509,7 @@
507509
);
508510
INFOPLIST_FILE = CYLTabBarControllerTests/Info.plist;
509511
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
512+
PRODUCT_BUNDLE_IDENTIFIER = "CYL.$(PRODUCT_NAME:rfc1034identifier)";
510513
PRODUCT_NAME = "$(TARGET_NAME)";
511514
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/CYLTabBarController.app/CYLTabBarController";
512515
};

CYLTabBarController.xcodeproj/xcuserdata/chenyilong.xcuserdatad/xcschemes/CYLTabBarController.xcscheme

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0630"
3+
LastUpgradeVersion = "0710"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -37,10 +37,10 @@
3737
</BuildActionEntries>
3838
</BuildAction>
3939
<TestAction
40+
buildConfiguration = "Debug"
4041
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4142
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
42-
shouldUseLaunchSchemeArgsEnv = "YES"
43-
buildConfiguration = "Debug">
43+
shouldUseLaunchSchemeArgsEnv = "YES">
4444
<Testables>
4545
<TestableReference
4646
skipped = "NO">
@@ -62,15 +62,18 @@
6262
ReferencedContainer = "container:CYLTabBarController.xcodeproj">
6363
</BuildableReference>
6464
</MacroExpansion>
65+
<AdditionalOptions>
66+
</AdditionalOptions>
6567
</TestAction>
6668
<LaunchAction
69+
buildConfiguration = "Debug"
6770
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
6871
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
6972
launchStyle = "0"
7073
useCustomWorkingDirectory = "NO"
71-
buildConfiguration = "Debug"
7274
ignoresPersistentStateOnLaunch = "NO"
7375
debugDocumentVersioning = "YES"
76+
debugServiceExtension = "internal"
7477
allowLocationSimulation = "YES">
7578
<BuildableProductRunnable
7679
runnableDebuggingMode = "0">
@@ -86,10 +89,10 @@
8689
</AdditionalOptions>
8790
</LaunchAction>
8891
<ProfileAction
92+
buildConfiguration = "Release"
8993
shouldUseLaunchSchemeArgsEnv = "YES"
9094
savedToolIdentifier = ""
9195
useCustomWorkingDirectory = "NO"
92-
buildConfiguration = "Release"
9396
debugDocumentVersioning = "YES">
9497
<BuildableProductRunnable
9598
runnableDebuggingMode = "0">

CYLTabBarControllerTests/Info.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<key>CFBundleExecutable</key>
88
<string>$(EXECUTABLE_NAME)</string>
99
<key>CFBundleIdentifier</key>
10-
<string>CYL.$(PRODUCT_NAME:rfc1034identifier)</string>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
1111
<key>CFBundleInfoDictionaryVersion</key>
1212
<string>6.0</string>
1313
<key>CFBundleName</key>

Example/Classes/Home/CYLHomeViewController.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfa
2929
#pragma mark - Methods
3030

3131
- (void)configureCell:(UITableViewCell *)cell forIndexPath:(NSIndexPath *)indexPath {
32-
[[cell textLabel] setText:[NSString stringWithFormat:@"%@ Controller Cell %ld", self.title, (long)indexPath.row]];
32+
[[cell textLabel] setText:[NSString stringWithFormat:@"%@ Controller Cell %@", self.title, @(indexPath.row)]];
3333
}
3434

3535
#pragma mark - Table view
@@ -53,6 +53,6 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger
5353
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
5454
[tableView deselectRowAtIndexPath:indexPath animated:YES];
5555

56-
[self.navigationController.tabBarItem setBadgeValue:[NSString stringWithFormat:@"%ld", indexPath.row+1]];
56+
[self.navigationController.tabBarItem setBadgeValue:[NSString stringWithFormat:@"%@", @(indexPath.row + 1)]];
5757
}
5858
@end

Example/Classes/Main/View/CYLPlusButtonSubclass.m

+16-16
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ - (void)layoutSubviews
4646
// imageView 和 titleLabel 中心的 Y 值
4747
CGFloat const centerOfImageView = verticalMargin + imageViewEdge * 0.5;
4848
CGFloat const centerOfTitleLabel = imageViewEdge + verticalMargin * 2 + labelLineHeight * 0.5 + 5;
49-
49+
5050
//imageView position 位置
5151
self.imageView.bounds = CGRectMake(0, 0, imageViewEdge, imageViewEdge);
5252
self.imageView.center = CGPointMake(centerOfView, centerOfImageView);
@@ -64,18 +64,18 @@ - (void)layoutSubviews
6464
*
6565
*/
6666
+ (instancetype)plusButton{
67-
67+
6868
CYLPlusButtonSubclass *button = [[CYLPlusButtonSubclass alloc] init];
69-
69+
7070
[button setImage:[UIImage imageNamed:@"post_normal"] forState:UIControlStateNormal];
7171
[button setTitle:@"发布" forState:UIControlStateNormal];
72-
72+
7373
[button setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
7474
button.titleLabel.font = [UIFont systemFontOfSize:9.5];
7575
[button sizeToFit];
76-
76+
7777
[button addTarget:button action:@selector(clickPublish) forControlEvents:UIControlEventTouchUpInside];
78-
78+
7979
return button;
8080
}
8181

@@ -86,18 +86,18 @@ + (instancetype)plusButton{
8686
*/
8787
//+ (instancetype)plusButton
8888
//{
89-
//
89+
//
9090
// UIImage *buttonImage = [UIImage imageNamed:@"hood.png"];
9191
// UIImage *highlightImage = [UIImage imageNamed:@"hood-selected.png"];
92-
//
92+
//
9393
// CYLPlusButtonSubclass* button = [CYLPlusButtonSubclass buttonWithType:UIButtonTypeCustom];
94-
//
94+
//
9595
// button.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleTopMargin;
9696
// button.frame = CGRectMake(0.0, 0.0, buttonImage.size.width, buttonImage.size.height);
9797
// [button setBackgroundImage:buttonImage forState:UIControlStateNormal];
9898
// [button setBackgroundImage:highlightImage forState:UIControlStateHighlighted];
9999
// [button addTarget:button action:@selector(clickPublish) forControlEvents:UIControlEventTouchUpInside];
100-
//
100+
//
101101
// return button;
102102
//}
103103

@@ -108,18 +108,18 @@ - (void)clickPublish {
108108
UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController;
109109
UIViewController *viewController = tabBarController.selectedViewController;
110110

111-
UIActionSheet *actionSheet = [[UIActionSheet alloc]initWithTitle:nil
112-
delegate:nil
113-
cancelButtonTitle:@"取消"
114-
destructiveButtonTitle:nil
115-
otherButtonTitles:@"拍照", @"从相册选取", @"淘宝一键转卖", nil];
111+
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil
112+
delegate:nil
113+
cancelButtonTitle:@"取消"
114+
destructiveButtonTitle:nil
115+
otherButtonTitles:@"拍照", @"从相册选取", @"淘宝一键转卖", nil];
116116
[actionSheet showInView:viewController.view];
117117
}
118118

119119
#pragma mark - UIActionSheetDelegate
120120

121121
- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex {
122-
NSLog(@"buttonIndex = %ld", buttonIndex);
122+
NSLog(@"buttonIndex = %@", @(buttonIndex));
123123
}
124124

125125
#pragma mark - CYLPlusButtonSubclassing

Example/Classes/Message/CYLMessageViewController.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ - (void)viewDidLoad {
2121
#pragma mark - Methods
2222

2323
- (void)configureCell:(UITableViewCell *)cell forIndexPath:(NSIndexPath *)indexPath {
24-
[[cell textLabel] setText:[NSString stringWithFormat:@"%@ Controller Cell %ld", self.title, (long)indexPath.row]];
24+
[[cell textLabel] setText:[NSString stringWithFormat:@"%@ Controller Cell %@", self.title, @(indexPath.row)]];
2525
}
2626

2727
#pragma mark - Table view

Example/Classes/Mine/CYLMineViewController.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ - (void)viewDidLoad {
2121
#pragma mark - Methods
2222

2323
- (void)configureCell:(UITableViewCell *)cell forIndexPath:(NSIndexPath *)indexPath {
24-
[[cell textLabel] setText:[NSString stringWithFormat:@"%@ Controller Cell %ld", self.title, (long)indexPath.row]];
24+
[[cell textLabel] setText:[NSString stringWithFormat:@"%@ Controller Cell %@", self.title, @(indexPath.row)]];
2525
}
2626

2727
#pragma mark - Table view
@@ -44,6 +44,6 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger
4444

4545
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
4646
[tableView deselectRowAtIndexPath:indexPath animated:YES];
47-
[self.navigationController.tabBarItem setBadgeValue:[NSString stringWithFormat:@"%ld", indexPath.row+1]];
47+
[self.navigationController.tabBarItem setBadgeValue:[NSString stringWithFormat:@"%@", @(indexPath.row + 1)]];
4848
}
4949
@end

Example/Classes/SameCity/CYLSameFityViewController.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ -(void)viewDidLoad {
2020
#pragma mark - Methods
2121

2222
- (void)configureCell:(UITableViewCell *)cell forIndexPath:(NSIndexPath *)indexPath {
23-
[[cell textLabel] setText:[NSString stringWithFormat:@"%@ Controller Cell %ld", self.title, (long)indexPath.row]];
23+
[[cell textLabel] setText:[NSString stringWithFormat:@"%@ Controller Cell %@", self.title, @(indexPath.row)]];
2424
}
2525

2626
#pragma mark - Table view

Example/Info.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<key>CFBundleExecutable</key>
88
<string>$(EXECUTABLE_NAME)</string>
99
<key>CFBundleIdentifier</key>
10-
<string>CYL.$(PRODUCT_NAME:rfc1034identifier)</string>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
1111
<key>CFBundleInfoDictionaryVersion</key>
1212
<string>6.0</string>
1313
<key>CFBundleName</key>

0 commit comments

Comments
 (0)