diff --git a/FMC Planner 2.xcodeproj/project.pbxproj b/FMC Planner 2.xcodeproj/project.pbxproj index aa0ad9c..fd6cb5c 100644 --- a/FMC Planner 2.xcodeproj/project.pbxproj +++ b/FMC Planner 2.xcodeproj/project.pbxproj @@ -7,6 +7,8 @@ objects = { /* Begin PBXBuildFile section */ + E227C7831C9F42AB00DE0CA4 /* ViewControllerKeyboard.m in Sources */ = {isa = PBXBuildFile; fileRef = E227C7821C9F42AB00DE0CA4 /* ViewControllerKeyboard.m */; }; + E227C7861C9F474100DE0CA4 /* ViewControllerScreen.m in Sources */ = {isa = PBXBuildFile; fileRef = E227C7851C9F474100DE0CA4 /* ViewControllerScreen.m */; }; E22EE9D11C9DB7B3001F5BC0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = E22EE9D01C9DB7B3001F5BC0 /* main.m */; }; E22EE9D41C9DB7B3001F5BC0 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = E22EE9D31C9DB7B3001F5BC0 /* AppDelegate.m */; }; E22EE9D71C9DB7B3001F5BC0 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E22EE9D61C9DB7B3001F5BC0 /* ViewController.m */; }; @@ -35,6 +37,10 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + E227C7811C9F42AB00DE0CA4 /* ViewControllerKeyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewControllerKeyboard.h; sourceTree = ""; }; + E227C7821C9F42AB00DE0CA4 /* ViewControllerKeyboard.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewControllerKeyboard.m; sourceTree = ""; }; + E227C7841C9F474100DE0CA4 /* ViewControllerScreen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewControllerScreen.h; sourceTree = ""; }; + E227C7851C9F474100DE0CA4 /* ViewControllerScreen.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewControllerScreen.m; sourceTree = ""; }; E22EE9CC1C9DB7B3001F5BC0 /* FMC Planner 2.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "FMC Planner 2.app"; sourceTree = BUILT_PRODUCTS_DIR; }; E22EE9D01C9DB7B3001F5BC0 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; E22EE9D21C9DB7B3001F5BC0 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; @@ -110,6 +116,10 @@ E22EE9DD1C9DB7B3001F5BC0 /* LaunchScreen.storyboard */, E22EE9E01C9DB7B3001F5BC0 /* Info.plist */, E22EE9CF1C9DB7B3001F5BC0 /* Supporting Files */, + E227C7811C9F42AB00DE0CA4 /* ViewControllerKeyboard.h */, + E227C7821C9F42AB00DE0CA4 /* ViewControllerKeyboard.m */, + E227C7841C9F474100DE0CA4 /* ViewControllerScreen.h */, + E227C7851C9F474100DE0CA4 /* ViewControllerScreen.m */, ); path = "FMC Planner 2"; sourceTree = ""; @@ -276,6 +286,8 @@ E22EE9D71C9DB7B3001F5BC0 /* ViewController.m in Sources */, E22EE9D41C9DB7B3001F5BC0 /* AppDelegate.m in Sources */, E22EE9D11C9DB7B3001F5BC0 /* main.m in Sources */, + E227C7831C9F42AB00DE0CA4 /* ViewControllerKeyboard.m in Sources */, + E227C7861C9F474100DE0CA4 /* ViewControllerScreen.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -418,6 +430,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "iPhone Developer"; INFOPLIST_FILE = "FMC Planner 2/Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.weebly.alikja.FMC-Planner-2"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -431,6 +444,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "iPhone Developer"; INFOPLIST_FILE = "FMC Planner 2/Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.weebly.alikja.FMC-Planner-2"; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/FMC Planner 2.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/FMC Planner 2.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index fe2b454..89fcce2 100644 --- a/FMC Planner 2.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/FMC Planner 2.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -2,4 +2,54 @@ + + + + + + + + + + + + + + diff --git a/FMC Planner 2/Assets.xcassets/AppIcon.appiconset/Contents.json b/FMC Planner 2/Assets.xcassets/AppIcon.appiconset/Contents.json index 36d2c80..eeea76c 100644 --- a/FMC Planner 2/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/FMC Planner 2/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -59,6 +59,11 @@ "idiom" : "ipad", "size" : "76x76", "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" } ], "info" : { diff --git a/FMC Planner 2/Assets.xcassets/Contents.json b/FMC Planner 2/Assets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/FMC Planner 2/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/FMC Planner 2/Assets.xcassets/tri.imageset/Contents.json b/FMC Planner 2/Assets.xcassets/tri.imageset/Contents.json new file mode 100644 index 0000000..3a9c069 --- /dev/null +++ b/FMC Planner 2/Assets.xcassets/tri.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "filename" : "triSmall.png", + "scale" : "1x" + }, + { + "idiom" : "iphone", + "filename" : "trBig.png", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "filename" : "triBigger.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/FMC Planner 2/Assets.xcassets/tri.imageset/trBig.png b/FMC Planner 2/Assets.xcassets/tri.imageset/trBig.png new file mode 100644 index 0000000..2204221 Binary files /dev/null and b/FMC Planner 2/Assets.xcassets/tri.imageset/trBig.png differ diff --git a/FMC Planner 2/Assets.xcassets/tri.imageset/triBigger.png b/FMC Planner 2/Assets.xcassets/tri.imageset/triBigger.png new file mode 100644 index 0000000..a6fa4d7 Binary files /dev/null and b/FMC Planner 2/Assets.xcassets/tri.imageset/triBigger.png differ diff --git a/FMC Planner 2/Assets.xcassets/tri.imageset/triSmall.png b/FMC Planner 2/Assets.xcassets/tri.imageset/triSmall.png new file mode 100644 index 0000000..fe31060 Binary files /dev/null and b/FMC Planner 2/Assets.xcassets/tri.imageset/triSmall.png differ diff --git a/FMC Planner 2/Base.lproj/LaunchScreen.storyboard b/FMC Planner 2/Base.lproj/LaunchScreen.storyboard index 2e721e1..90d6157 100644 --- a/FMC Planner 2/Base.lproj/LaunchScreen.storyboard +++ b/FMC Planner 2/Base.lproj/LaunchScreen.storyboard @@ -1,7 +1,8 @@ - + - + + @@ -15,7 +16,6 @@ - diff --git a/FMC Planner 2/Base.lproj/Main.storyboard b/FMC Planner 2/Base.lproj/Main.storyboard index 966e144..01ddbc7 100644 --- a/FMC Planner 2/Base.lproj/Main.storyboard +++ b/FMC Planner 2/Base.lproj/Main.storyboard @@ -3,7 +3,7 @@ - + @@ -18,714 +18,535 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/FMC Planner 2/ViewController.h b/FMC Planner 2/ViewController.h index 2cffaf2..69da1b3 100644 --- a/FMC Planner 2/ViewController.h +++ b/FMC Planner 2/ViewController.h @@ -6,27 +6,17 @@ // Copyright © 2016 Kilian Hofmann. All rights reserved. // +#import "ViewControllerKeyboard.h" +#import "ViewControllerScreen.h" #import @interface ViewController : UIViewController -@property(nonatomic) BOOL alphaOn; - -@property(strong, nonatomic) NSArray *alphabet; -@property(strong, nonatomic) NSArray *numeric; - -@property(strong, nonatomic) IBOutletCollection(UIButton) NSArray *Keys; - @property(strong, nonatomic) IBOutlet UIView *backdropKeys; @property(strong, nonatomic) IBOutlet UIView *backdropScreen; -@property(strong, nonatomic) IBOutletCollection(UILabel) NSArray *ScreenLabels; - -@property(strong, nonatomic) IBOutlet UILabel *Scratchpad; - -@property(strong, nonatomic) IBOutlet UILabel *Header; - -- (IBAction)KeyTaps:(UIButton *)sender; +@property(strong, nonatomic) ViewControllerScreen *screen; +@property(strong, nonatomic) ViewControllerKeyboard *keys; @end diff --git a/FMC Planner 2/ViewController.m b/FMC Planner 2/ViewController.m index 04febf1..0d4473b 100644 --- a/FMC Planner 2/ViewController.m +++ b/FMC Planner 2/ViewController.m @@ -13,89 +13,22 @@ - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. - _alphaOn = true; - _alphabet = [[NSArray alloc] - initWithObjects:@"A", @"B", @"C", @"D", @"E", @"F", @"G", @"H", @"I", - @"J", @"K", @"L", @"M", @"N", @"O", @"P", @"Q", @"R", - @"S", @"T", @"U", @"V", @"W", @"X", @"Y", @"Z", @"SP", - @"CLR", @"DEL", @"NUM", nil]; - _numeric = [[NSArray alloc] - initWithObjects:@"1", @"2", @"3", @"", @"", @"", @"4", @"5", @"6", - @"", @"", @"", @"7", @"8", @"9", @"", @"", @"", - @".", @"0", @"/", @"", @"", @"", @"", @"", @"SP", - @"CLR", @"DEL", @"LET", nil]; - // Round corners _backdropKeys.layer.cornerRadius = 5; _backdropKeys.layer.masksToBounds = YES; _backdropScreen.layer.cornerRadius = 5; _backdropScreen.layer.masksToBounds = YES; - for (UIButton *but in _Keys) { - but.layer.cornerRadius = 5; - but.layer.masksToBounds = YES; - } - // Set Font Size - if (self.view.frame.size.height == 480) { - for (UILabel *label in _ScreenLabels) { - label.font = [UIFont systemFontOfSize:14]; - } - _Header.font = [UIFont systemFontOfSize:14]; - _Scratchpad.font = [UIFont systemFontOfSize:14]; - } - - // Init Start Page - [self clearScreen]; - _Header.text = @"START"; - _Scratchpad.text = @""; } -- (void)didReceiveMemoryWarning { - [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. -} - -- (IBAction)KeyTaps:(UIButton *)sender { - if ([sender.restorationIdentifier isEqualToString:@"Switch"]) { - _alphaOn = !_alphaOn; - [self switchKeyboard]; - } else if ([sender.restorationIdentifier isEqualToString:@"Space"]) { - _Scratchpad.text = [_Scratchpad.text stringByAppendingString:@" "]; - } else if ([sender.restorationIdentifier isEqualToString:@"Clear"]) { - if ([_Scratchpad.text isEqualToString:@"DELETE"]) { - _Scratchpad.text = @""; - } else if (_Scratchpad.text.length > 0) { - _Scratchpad.text = - [_Scratchpad.text substringToIndex:[_Scratchpad.text length] - 1]; - } - } else if ([sender.restorationIdentifier isEqualToString:@"Delete"]) { - _Scratchpad.text = @"DELETE"; - } else { - _Scratchpad.text = - [_Scratchpad.text stringByAppendingString:sender.titleLabel.text]; +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + NSString *segueName = segue.identifier; + if ([segueName isEqualToString:@"keyboard"]) { + _keys = (ViewControllerKeyboard *)[segue destinationViewController]; + _keys.main = self; } -} - -- (void)clearScreen { - for (UILabel *label in _ScreenLabels) { - label.text = @""; - } - _Scratchpad.text = @""; - _Header.text = @""; -} - -- (void)switchKeyboard { - if (_alphaOn) { - for (int i = 0; i < _Keys.count; i++) { - [((UIButton *)_Keys[i]) setTitle:_alphabet[i] - forState:UIControlStateNormal]; - [((UIButton *)_Keys[i]).titleLabel sizeToFit]; - } - } else { - for (int i = 0; i < _Keys.count; i++) { - [((UIButton *)_Keys[i]) setTitle:_numeric[i] - forState:UIControlStateNormal]; - [((UIButton *)_Keys[i]).titleLabel sizeToFit]; - } + if ([segueName isEqualToString:@"screen"]) { + _screen = (ViewControllerScreen *)[segue destinationViewController]; + _screen.main = self; } } diff --git a/FMC Planner 2/ViewControllerKeyboard.h b/FMC Planner 2/ViewControllerKeyboard.h new file mode 100644 index 0000000..1343f55 --- /dev/null +++ b/FMC Planner 2/ViewControllerKeyboard.h @@ -0,0 +1,25 @@ +// +// ViewControllerKeyboard.h +// FMC Planner 2 +// +// Created by Kilian Hofmann on 20.03.16. +// Copyright © 2016 Kilian Hofmann. All rights reserved. +// + +#import + +@class ViewController; +@interface ViewControllerKeyboard : UIViewController + +@property(nonatomic) BOOL alphaOn; + +@property(strong, nonatomic) NSArray *alphabet; +@property(strong, nonatomic) NSArray *numeric; + +@property(strong, nonatomic) IBOutletCollection(UIButton) NSArray *Keys; + +@property(strong, nonatomic) ViewController *main; + +- (IBAction)KeyTaps:(UIButton *)sender; + +@end diff --git a/FMC Planner 2/ViewControllerKeyboard.m b/FMC Planner 2/ViewControllerKeyboard.m new file mode 100644 index 0000000..dfc931f --- /dev/null +++ b/FMC Planner 2/ViewControllerKeyboard.m @@ -0,0 +1,73 @@ +// +// ViewControllerKeyboard.m +// FMC Planner 2 +// +// Created by Kilian Hofmann on 20.03.16. +// Copyright © 2016 Kilian Hofmann. All rights reserved. +// + +#import "ViewController.h" +#import "ViewControllerKeyboard.h" + +@implementation ViewControllerKeyboard + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. + _alphaOn = true; + _alphabet = [[NSArray alloc] + initWithObjects:@"A", @"B", @"C", @"D", @"E", @"F", @"G", @"H", @"I", + @"J", @"K", @"L", @"M", @"N", @"O", @"P", @"Q", @"R", + @"S", @"T", @"U", @"V", @"W", @"X", @"Y", @"Z", @"SP", + @"CLR", @"DEL", @"NUM", nil]; + _numeric = [[NSArray alloc] + initWithObjects:@"1", @"2", @"3", @"", @"", @"", @"4", @"5", @"6", + @"", @"", @"", @"7", @"8", @"9", @"", @"", @"", + @".", @"0", @"/", @"", @"", @"", @"", @"", @"SP", + @"CLR", @"DEL", @"LET", nil]; + // Round button corners + for (UIButton *but in _Keys) { + but.layer.cornerRadius = 5; + but.layer.masksToBounds = YES; + } +} + +- (IBAction)KeyTaps:(UIButton *)sender { + if ([sender.restorationIdentifier isEqualToString:@"Switch"]) { + _alphaOn = !_alphaOn; + [self switchKeyboard]; + } else if ([sender.restorationIdentifier isEqualToString:@"Space"]) { + _main.screen.Scratchpad.text = + [_main.screen.Scratchpad.text stringByAppendingString:@" "]; + } else if ([sender.restorationIdentifier isEqualToString:@"Clear"]) { + if ([_main.screen.Scratchpad.text isEqualToString:@"DELETE"]) { + _main.screen.Scratchpad.text = @""; + } else if (_main.screen.Scratchpad.text.length > 0) { + _main.screen.Scratchpad.text = [_main.screen.Scratchpad.text + substringToIndex:[_main.screen.Scratchpad.text length] - 1]; + } + } else if ([sender.restorationIdentifier isEqualToString:@"Delete"]) { + _main.screen.Scratchpad.text = @"DELETE"; + } else { + _main.screen.Scratchpad.text = [_main.screen.Scratchpad.text + stringByAppendingString:sender.titleLabel.text]; + } +} + +- (void)switchKeyboard { + if (_alphaOn) { + for (int i = 0; i < _Keys.count; i++) { + [((UIButton *)_Keys[i]) setTitle:_alphabet[i] + forState:UIControlStateNormal]; + [((UIButton *)_Keys[i]).titleLabel sizeToFit]; + } + } else { + for (int i = 0; i < _Keys.count; i++) { + [((UIButton *)_Keys[i]) setTitle:_numeric[i] + forState:UIControlStateNormal]; + [((UIButton *)_Keys[i]).titleLabel sizeToFit]; + } + } +} + +@end diff --git a/FMC Planner 2/ViewControllerScreen.h b/FMC Planner 2/ViewControllerScreen.h new file mode 100644 index 0000000..509ad7c --- /dev/null +++ b/FMC Planner 2/ViewControllerScreen.h @@ -0,0 +1,22 @@ +// +// ViewControllerScreen.h +// FMC Planner 2 +// +// Created by Kilian Hofmann on 20.03.16. +// Copyright © 2016 Kilian Hofmann. All rights reserved. +// + +#import + +@class ViewController; +@interface ViewControllerScreen : UIViewController + +@property(strong, nonatomic) IBOutletCollection(UILabel) NSArray *LSK; + +@property(strong, nonatomic) IBOutlet UILabel *Scratchpad; + +@property(strong, nonatomic) IBOutlet UILabel *Header; + +@property(strong, nonatomic) ViewController *main; + +@end diff --git a/FMC Planner 2/ViewControllerScreen.m b/FMC Planner 2/ViewControllerScreen.m new file mode 100644 index 0000000..a8965cd --- /dev/null +++ b/FMC Planner 2/ViewControllerScreen.m @@ -0,0 +1,95 @@ +// +// ViewControllerScreen.m +// FMC Planner 2 +// +// Created by Kilian Hofmann on 20.03.16. +// Copyright © 2016 Kilian Hofmann. All rights reserved. +// + +#import "ViewControllerScreen.h" + +@implementation ViewControllerScreen + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. + // Init Start Page + [self clearScreen]; + _Header.text = @"START"; + _Scratchpad.text = @""; + + // Tap gesture shit and fitToSize + for (UILabel *label in _LSK) { + label.font = [self findAdaptiveFontForUILabelSize:label.frame.size + withMinimumSize:21]; + label.adjustsFontSizeToFitWidth = YES; + label.userInteractionEnabled = YES; + UITapGestureRecognizer *reg = + [[UITapGestureRecognizer alloc] initWithTarget:self + action:@selector(enterLSK:)]; + [reg setNumberOfTapsRequired:1]; + [reg setNumberOfTouchesRequired:1]; + [label addGestureRecognizer:reg]; + } + _Header.font = [self findAdaptiveFontForUILabelSize:_Header.frame.size + withMinimumSize:21]; + _Header.adjustsFontSizeToFitWidth = YES; + _Scratchpad.font = [self findAdaptiveFontForUILabelSize:_Scratchpad.frame.size + withMinimumSize:21]; + _Scratchpad.adjustsFontSizeToFitWidth = YES; +} + +- (void)clearScreen { + for (UILabel *label in _LSK) { + label.text = @""; + } + _Scratchpad.text = @""; + _Header.text = @""; +} + +- (void)enterLSK:(UITapGestureRecognizer *)tapReg { + if ([_Scratchpad.text isEqualToString:@"DELETE"]) { + ((UILabel *)tapReg.view).text = @""; + } else { + ((UILabel *)tapReg.view).text = _Scratchpad.text; + } + _Scratchpad.text = @""; +} + +- (UIFont *)findAdaptiveFontForUILabelSize:(CGSize)labelSize + withMinimumSize:(NSInteger)minSize { + UIFont *tempFont = nil; + NSString *testString = + @"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + + NSInteger tempMin = minSize; + NSInteger tempMax = 256; + NSInteger mid = 0; + NSInteger difference = 0; + + while (tempMin <= tempMax) { + mid = tempMin + (tempMax - tempMin) / 2; + tempFont = [UIFont systemFontOfSize:mid]; + difference = labelSize.height - [testString sizeWithFont:tempFont].height; + + if (mid == tempMin || mid == tempMax) { + if (difference < 0) { + return [UIFont systemFontOfSize:(mid - 1)]; + } + + return [UIFont systemFontOfSize:mid]; + } + + if (difference < 0) { + tempMax = mid - 1; + } else if (difference > 0) { + tempMin = mid + 1; + } else { + return [UIFont systemFontOfSize:mid]; + } + } + + return [UIFont systemFontOfSize:mid]; +} + +@end