Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added IfElse/.DS_Store
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "1"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "IfElse/ViewController.m"
timestampString = "455316840.042719"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "40"
endingLineNumber = "40"
landmarkName = "-buttonTapped:"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "IfElse/ViewController.h"
timestampString = "455317338.499771"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "16"
endingLineNumber = "16">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0630"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8DFE63E81B22A54400D3D7AA"
BuildableName = "IfElse.app"
BlueprintName = "IfElse"
ReferencedContainer = "container:IfElse.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8DFE64011B22A54400D3D7AA"
BuildableName = "IfElseTests.xctest"
BlueprintName = "IfElseTests"
ReferencedContainer = "container:IfElse.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8DFE64011B22A54400D3D7AA"
BuildableName = "IfElseTests.xctest"
BlueprintName = "IfElseTests"
ReferencedContainer = "container:IfElse.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8DFE63E81B22A54400D3D7AA"
BuildableName = "IfElse.app"
BlueprintName = "IfElse"
ReferencedContainer = "container:IfElse.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8DFE63E81B22A54400D3D7AA"
BuildableName = "IfElse.app"
BlueprintName = "IfElse"
ReferencedContainer = "container:IfElse.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8DFE63E81B22A54400D3D7AA"
BuildableName = "IfElse.app"
BlueprintName = "IfElse"
ReferencedContainer = "container:IfElse.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>IfElse.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>8DFE63E81B22A54400D3D7AA</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>8DFE64011B22A54400D3D7AA</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
46 changes: 32 additions & 14 deletions IfElse/IfElse/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="vXZ-lx-hvc">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
<capability name="Alignment constraints with different attributes" minToolsVersion="5.1"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
</dependencies>
<scenes>
Expand Down Expand Up @@ -35,6 +36,9 @@
<include reference="Zqi-Kp-0sb"/>
</mask>
</variation>
<connections>
<action selector="buttonTapped:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="i7d-L6-anX"/>
</connections>
</button>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="iGu-Ut-VER">
<rect key="frame" x="0.0" y="-30" width="97" height="30"/>
Expand All @@ -51,6 +55,12 @@
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<progressView opaque="NO" contentMode="scaleToFill" verticalHuggingPriority="750" progress="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="GgN-wM-GYb">
<rect key="frame" x="0.0" y="-2" width="150" height="2"/>
<variation key="widthClass=compact" fixedFrame="YES">
<rect key="frame" x="125" y="490" width="150" height="2"/>
</variation>
</progressView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
Expand All @@ -73,20 +83,21 @@
<exclude reference="iGu-Ut-VER"/>
<exclude reference="NHM-gg-8tT"/>
<exclude reference="aB7-bV-Euy"/>
<exclude reference="GgN-wM-GYb"/>
</mask>
<mask key="constraints">
<exclude reference="8TF-Rc-kG4"/>
<exclude reference="YG0-rg-2K5"/>
<exclude reference="y9A-GV-8wG"/>
<exclude reference="FUk-zx-HHm"/>
<exclude reference="NaR-3r-PFr"/>
<exclude reference="pIc-Dd-VL9"/>
<exclude reference="u61-Ws-DaA"/>
<exclude reference="4m5-pb-omc"/>
<exclude reference="KoG-0I-h8P"/>
<exclude reference="vUU-ID-K6d"/>
<exclude reference="FUk-zx-HHm"/>
<exclude reference="NaR-3r-PFr"/>
<exclude reference="pIc-Dd-VL9"/>
<exclude reference="8TF-Rc-kG4"/>
<exclude reference="YG0-rg-2K5"/>
<exclude reference="y9A-GV-8wG"/>
<exclude reference="dAR-uW-kvy"/>
<exclude reference="rJf-e4-gKp"/>
<exclude reference="u61-Ws-DaA"/>
</mask>
</variation>
<variation key="widthClass=compact">
Expand All @@ -95,23 +106,30 @@
<include reference="iGu-Ut-VER"/>
<include reference="NHM-gg-8tT"/>
<include reference="aB7-bV-Euy"/>
<include reference="GgN-wM-GYb"/>
</mask>
<mask key="constraints">
<include reference="8TF-Rc-kG4"/>
<include reference="YG0-rg-2K5"/>
<include reference="y9A-GV-8wG"/>
<include reference="FUk-zx-HHm"/>
<include reference="NaR-3r-PFr"/>
<include reference="pIc-Dd-VL9"/>
<include reference="u61-Ws-DaA"/>
<include reference="4m5-pb-omc"/>
<include reference="KoG-0I-h8P"/>
<include reference="vUU-ID-K6d"/>
<include reference="FUk-zx-HHm"/>
<include reference="NaR-3r-PFr"/>
<include reference="pIc-Dd-VL9"/>
<include reference="8TF-Rc-kG4"/>
<include reference="YG0-rg-2K5"/>
<include reference="y9A-GV-8wG"/>
<include reference="dAR-uW-kvy"/>
<include reference="rJf-e4-gKp"/>
<include reference="u61-Ws-DaA"/>
</mask>
</variation>
</view>
<connections>
<outlet property="progressBar" destination="GgN-wM-GYb" id="NsE-tv-BVF"/>
<outlet property="textField1" destination="iGu-Ut-VER" id="LAI-tP-H3P"/>
<outlet property="textField2" destination="aB7-bV-Euy" id="e7v-YQ-E4E"/>
<outlet property="textField3" destination="NHM-gg-8tT" id="eWg-V4-4VZ"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
</objects>
Expand Down
38 changes: 31 additions & 7 deletions IfElse/IfElse/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,42 @@

@interface ViewController ()

@property (weak, nonatomic) IBOutlet UITextField *textField1;
@property (weak, nonatomic) IBOutlet UITextField *textField2;
@property (weak, nonatomic) IBOutlet UITextField *textField3;

@property (weak, nonatomic) IBOutlet UIProgressView *progressBar;

@end

@implementation ViewController

- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
- (IBAction)buttonTapped:(id)sender {
NSLog(@"tapped");

NSString *one = self.textField1.text;
NSString *two = self.textField1.text;
NSString *three = self.textField1.text;

if ([one isEqualToString:(@"33")]) {
[self.progressBar setProgress:(.50)];
NSLog(@"You've cracked the code!");
} else if ([one isEqualToString:(@"22")]) {
NSLog(@"You've made some progress...!");
[self.progressBar setProgress:(.33)];
} else if ([one isEqualToString:(@"66")]){
[self.progressBar setProgress:(.66)];
NSLog(@"Making more progress now!");
} else {
[self.progressBar setProgress:(.99)];
NSLog(@"Good job! Full progress!");
}




}

- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}


@end