diff --git a/IfElse/IfElse.xcodeproj/project.xcworkspace/xcshareddata/IfElse.xccheckout b/IfElse/IfElse.xcodeproj/project.xcworkspace/xcshareddata/IfElse.xccheckout index c528788..5260a85 100644 --- a/IfElse/IfElse.xcodeproj/project.xcworkspace/xcshareddata/IfElse.xccheckout +++ b/IfElse/IfElse.xcodeproj/project.xcworkspace/xcshareddata/IfElse.xccheckout @@ -7,34 +7,46 @@ IDESourceControlProjectIdentifier 1FB1EB48-B010-423E-B8FC-A6EF94AD96F8 IDESourceControlProjectName - project + IfElse IDESourceControlProjectOriginsDictionary - 871AD5BEB35E842816B7B3CF4033C4298E764D23 - https://github.com/accesscode-2-2/unit-0.git + 9752D1003C09669846699296A85585C5548B2D34 + https://github.com/kaishajones/myfirstrepository.git + BAD0033D05756E529C5FF0EABC2DBC15B8B8219E + https://github.com/kaishajones/IfElse.git IDESourceControlProjectPath - lessons/week-0/IfElse/IfElse.xcodeproj/project.xcworkspace + IfElse/IfElse.xcodeproj IDESourceControlProjectRelativeInstallPathDictionary - 871AD5BEB35E842816B7B3CF4033C4298E764D23 + 9752D1003C09669846699296A85585C5548B2D34 ../../../../.. + BAD0033D05756E529C5FF0EABC2DBC15B8B8219E + ../../.. IDESourceControlProjectURL - https://github.com/accesscode-2-2/unit-0.git + https://github.com/kaishajones/IfElse.git IDESourceControlProjectVersion 111 IDESourceControlProjectWCCIdentifier - 871AD5BEB35E842816B7B3CF4033C4298E764D23 + BAD0033D05756E529C5FF0EABC2DBC15B8B8219E IDESourceControlProjectWCConfigurations IDESourceControlRepositoryExtensionIdentifierKey public.vcs.git IDESourceControlWCCIdentifierKey - 871AD5BEB35E842816B7B3CF4033C4298E764D23 + 9752D1003C09669846699296A85585C5548B2D34 IDESourceControlWCCName - unit-0 + .. + + + IDESourceControlRepositoryExtensionIdentifierKey + public.vcs.git + IDESourceControlWCCIdentifierKey + BAD0033D05756E529C5FF0EABC2DBC15B8B8219E + IDESourceControlWCCName + IfElse diff --git a/IfElse/IfElse.xcodeproj/project.xcworkspace/xcuserdata/kaishajones.xcuserdatad/UserInterfaceState.xcuserstate b/IfElse/IfElse.xcodeproj/project.xcworkspace/xcuserdata/kaishajones.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..0e5f39e Binary files /dev/null and b/IfElse/IfElse.xcodeproj/project.xcworkspace/xcuserdata/kaishajones.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/IfElse/IfElse.xcodeproj/xcuserdata/kaishajones.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/IfElse/IfElse.xcodeproj/xcuserdata/kaishajones.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..fe2b454 --- /dev/null +++ b/IfElse/IfElse.xcodeproj/xcuserdata/kaishajones.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/IfElse/IfElse.xcodeproj/xcuserdata/kaishajones.xcuserdatad/xcschemes/IfElse.xcscheme b/IfElse/IfElse.xcodeproj/xcuserdata/kaishajones.xcuserdatad/xcschemes/IfElse.xcscheme new file mode 100644 index 0000000..6485954 --- /dev/null +++ b/IfElse/IfElse.xcodeproj/xcuserdata/kaishajones.xcuserdatad/xcschemes/IfElse.xcscheme @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/IfElse/IfElse.xcodeproj/xcuserdata/kaishajones.xcuserdatad/xcschemes/xcschememanagement.plist b/IfElse/IfElse.xcodeproj/xcuserdata/kaishajones.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..44aa48b --- /dev/null +++ b/IfElse/IfElse.xcodeproj/xcuserdata/kaishajones.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,27 @@ + + + + + SchemeUserState + + IfElse.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 8DFE63E81B22A54400D3D7AA + + primary + + + 8DFE64011B22A54400D3D7AA + + primary + + + + + diff --git a/IfElse/IfElse/Base.lproj/Main.storyboard b/IfElse/IfElse/Base.lproj/Main.storyboard index 34c014c..6f1f5b1 100644 --- a/IfElse/IfElse/Base.lproj/Main.storyboard +++ b/IfElse/IfElse/Base.lproj/Main.storyboard @@ -1,7 +1,8 @@ - + + @@ -35,18 +36,27 @@ + + + - + - + - + + + + + + + @@ -70,48 +80,56 @@ - + + - - - - - - + + + + + + + - - + + - - - - - - + + + + + + + - + + + + + + diff --git a/IfElse/IfElse/ViewController.m b/IfElse/IfElse/ViewController.m index b3ee131..df96bbc 100644 --- a/IfElse/IfElse/ViewController.m +++ b/IfElse/IfElse/ViewController.m @@ -8,20 +8,85 @@ #import "ViewController.h" -@interface ViewController () +@interface ViewController () //this viewcontroller is showing us attributes(properties) of our code. Attributes --> Action (implementation) +@property (weak, nonatomic) IBOutlet UITextField *textField1; +@property (weak, nonatomic) IBOutlet UITextField *textField2; +@property (weak, nonatomic) IBOutlet UITextField *textField3; +@property (weak, nonatomic) IBOutlet UISwitch *toggle; @end @implementation ViewController +- (IBAction)buttonTapped:(id)sender { + NSLog (@"tapped"); + + +//I'm creating a new variable... if you want to access UITextField, you must use ".self + + NSString *textField1Value = self.textField1.text; + NSLog(@"%@", textField1Value); + + NSString *textField2Value = self.textField2.text; + NSLog(@"%@", textField2Value); + + NSString *textField3Value = self.textField3.text; + NSLog(@"%@", textField3Value); + + //----------------------------- + // justin + //int justinAge = 18; + //BOOL justinAccompanied = YES; + //BOOL justinSwag = NO; + //int justinMoney = 4; + + + // carl + //int carlAge = 18; + //BOOL carlAccompanied = YES; + //BOOL carlSwag = NO; + //int carlMoney = 4000; + + // rules + //int minAge = 21; + //int minMoney = 200; + //int buyoff = 50; + + + //if (carlAge < minAge && !carlAccompanied) { + //NSLog(@"You can't play this game"); + //} else if (!carlSwag) { + //NSLog(@"welcome"); + //} else if (!carlSwag) { + //if (carlMoney >= buyoff) { + //NSLog(@"welcome"); + //} else { + //NSLog(@"You can't play this game"); + //} + + //----------------------------- + + + + + NSString *one = self.textField1.text; + NSString *two = self.textField2.text; + NSString *three = self.textField3.text; + + //in order to compare string you must send a message to another string. + + + BOOL oneEqualsTwo = [one isEqualToString:two]; + if (oneEqualsTwo) { + [self.toggle setOn: YES animated: YES]; + } + if (three < one) { + [self.toggle setOn: NO animated: YES]; + } + if (two >= three) { + [self.toggle setOn: NO animated: NO]; + } -- (void)viewDidLoad { - [super viewDidLoad]; - // Do any additional setup after loading the view, typically from a nib. -} -- (void)didReceiveMemoryWarning { - [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. } @end