Browse Source

Revert "Support styling on back button on iOS (#3755)" (#3989)

This reverts commit f2635f1116.
Guy Carmeli 6 years ago
parent
commit
fe2ca84500
No account linked to committer's email address
2 changed files with 2 additions and 29 deletions
  1. 0
    2
      lib/ios/RNNBackButtonOptions.h
  2. 2
    27
      lib/ios/RNNBackButtonOptions.m

+ 0
- 2
lib/ios/RNNBackButtonOptions.h View File

8
 @property (nonatomic, strong) NSString* transition;
8
 @property (nonatomic, strong) NSString* transition;
9
 @property (nonatomic, strong) NSNumber* showTitle;
9
 @property (nonatomic, strong) NSNumber* showTitle;
10
 @property (nonatomic, strong) NSNumber* color;
10
 @property (nonatomic, strong) NSNumber* color;
11
-@property (nonatomic, strong) NSString* fontFamily;
12
-@property (nonatomic, strong) NSNumber* fontSize;
13
 
11
 
14
 @end
12
 @end

+ 2
- 27
lib/ios/RNNBackButtonOptions.m View File

15
 		
15
 		
16
 		UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithImage:image style:UIBarButtonItemStylePlain target:nil action:nil];
16
 		UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithImage:image style:UIBarButtonItemStylePlain target:nil action:nil];
17
 		[self setBackItem:backItem onViewController:viewController];
17
 		[self setBackItem:backItem onViewController:viewController];
18
-	} else {
19
-		NSString *title;
20
-		
21
-		title = self.title ? self.title : viewController.navigationItem.title;
22
-		UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithTitle:title
18
+	} else if (self.title) {
19
+		UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithTitle:self.title
23
 																	 style:UIBarButtonItemStylePlain
20
 																	 style:UIBarButtonItemStylePlain
24
 																	target:nil
21
 																	target:nil
25
 																	action:nil];
22
 																	action:nil];
26
-
27
-		if (self.color) {
28
-			[backItem setTintColor:[RCTConvert UIColor:self.color]];
29
-		}
30
-
31
-		if(self.fontFamily || self.fontSize) {
32
-			NSNumber* fontSize = self.fontSize;
33
-			NSString* fontFamily = self.fontFamily;
34
-			NSMutableDictionary* textAttributes = [[NSMutableDictionary alloc] init];
35
-			UIFont *font;
36
-
37
-			if (!fontSize) {
38
-				fontSize = [[NSNumber alloc] initWithInt: 18];
39
-			}
40
-			font = fontFamily ? 
41
-				[UIFont fontWithName:fontFamily size:[fontSize floatValue]] : 
42
-				[UIFont systemFontOfSize:[fontSize floatValue]];
43
-			[textAttributes setObject:font forKey:NSFontAttributeName];
44
-
45
-			[backItem setTitleTextAttributes:textAttributes forState:UIControlStateNormal];
46
-			[backItem setTitleTextAttributes:textAttributes forState:UIControlStateHighlighted];
47
-		}
48
 		
23
 		
49
 		[self setBackItem:backItem onViewController:viewController];
24
 		[self setBackItem:backItem onViewController:viewController];
50
 	}
25
 	}