Skip to content
Permalink
Browse files

BMI Calculator Exercise

  • Loading branch information...
ConnectionsDigital committed Nov 19, 2018
1 parent 8245abf commit f4961cc613e4acc1fc3af828ee4f3b9ec5224efa
Showing with 324 additions and 30 deletions.
  1. +21 −0 BMI.xcodeproj/project.pbxproj
  2. +52 −16 BMI/Assets.xcassets/AppIcon.appiconset/Contents.json
  3. BIN BMI/Assets.xcassets/AppIcon.appiconset/Icon.png
  4. BIN BMI/Assets.xcassets/AppIcon.appiconset/icon_20pt-1.png
  5. BIN BMI/Assets.xcassets/AppIcon.appiconset/icon_20pt@2x.png
  6. BIN BMI/Assets.xcassets/AppIcon.appiconset/icon_20pt@3x.png
  7. BIN BMI/Assets.xcassets/AppIcon.appiconset/icon_29pt-1.png
  8. BIN BMI/Assets.xcassets/AppIcon.appiconset/icon_29pt.png
  9. BIN BMI/Assets.xcassets/AppIcon.appiconset/icon_29pt@2x-1.png
  10. BIN BMI/Assets.xcassets/AppIcon.appiconset/icon_29pt@2x.png
  11. BIN BMI/Assets.xcassets/AppIcon.appiconset/icon_29pt@3x.png
  12. BIN BMI/Assets.xcassets/AppIcon.appiconset/icon_40pt-1.png
  13. BIN BMI/Assets.xcassets/AppIcon.appiconset/icon_40pt.png
  14. BIN BMI/Assets.xcassets/AppIcon.appiconset/icon_40pt@2x-1.png
  15. BIN BMI/Assets.xcassets/AppIcon.appiconset/icon_40pt@2x.png
  16. BIN BMI/Assets.xcassets/AppIcon.appiconset/icon_40pt@3x.png
  17. BIN BMI/Assets.xcassets/AppIcon.appiconset/icon_57pt@1x.jpg
  18. BIN BMI/Assets.xcassets/AppIcon.appiconset/icon_57pt@2x.jpg
  19. BIN BMI/Assets.xcassets/AppIcon.appiconset/icon_60pt@2x.png
  20. BIN BMI/Assets.xcassets/AppIcon.appiconset/icon_60pt@3x.png
  21. BIN BMI/Assets.xcassets/AppIcon.appiconset/icon_76pt.png
  22. BIN BMI/Assets.xcassets/AppIcon.appiconset/icon_76pt@2x.png
  23. BIN BMI/Assets.xcassets/AppIcon.appiconset/icon_83.5@2x.png
  24. +21 −0 BMI/Assets.xcassets/Button.imageset/Contents.json
  25. BIN BMI/Assets.xcassets/Button.imageset/redButton.png
  26. +21 −0 BMI/Assets.xcassets/Button2.imageset/Contents.json
  27. BIN BMI/Assets.xcassets/Button2.imageset/redButton2.png
  28. +21 −0 BMI/Assets.xcassets/Splash.imageset/Contents.json
  29. BIN BMI/Assets.xcassets/Splash.imageset/Splash.png
  30. +22 −0 BMI/BMI.swift
  31. +22 −6 BMI/Base.lproj/LaunchScreen.storyboard
  32. +86 −5 BMI/Base.lproj/Main.storyboard
  33. +9 −0 BMI/DarkMode.xcdatamodeld/DarkMode.xcdatamodel/contents
  34. +0 −2 BMI/Info.plist
  35. +49 −1 BMI/ViewController.swift
@@ -7,21 +7,25 @@
objects = {

/* Begin PBXBuildFile section */
8A7C2F3E219CB339003210FE /* BMI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A7C2F3D219CB339003210FE /* BMI.swift */; };
8AF0CBF7219A4C950001A6D0 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8AF0CBF6219A4C950001A6D0 /* AppDelegate.swift */; };
8AF0CBF9219A4C950001A6D0 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8AF0CBF8219A4C950001A6D0 /* ViewController.swift */; };
8AF0CBFC219A4C950001A6D0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8AF0CBFA219A4C950001A6D0 /* Main.storyboard */; };
8AF0CBFE219A4C960001A6D0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8AF0CBFD219A4C960001A6D0 /* Assets.xcassets */; };
8AF0CC01219A4C960001A6D0 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8AF0CBFF219A4C960001A6D0 /* LaunchScreen.storyboard */; };
8AF0CC0A219A601B0001A6D0 /* DarkMode.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 8AF0CC08219A601B0001A6D0 /* DarkMode.xcdatamodeld */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
8A7C2F3D219CB339003210FE /* BMI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BMI.swift; sourceTree = "<group>"; };
8AF0CBF3219A4C950001A6D0 /* BMI.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BMI.app; sourceTree = BUILT_PRODUCTS_DIR; };
8AF0CBF6219A4C950001A6D0 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
8AF0CBF8219A4C950001A6D0 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
8AF0CBFB219A4C950001A6D0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
8AF0CBFD219A4C960001A6D0 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
8AF0CC00219A4C960001A6D0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
8AF0CC02219A4C960001A6D0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
8AF0CC09219A601B0001A6D0 /* DarkMode.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = DarkMode.xcdatamodel; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
@@ -60,6 +64,8 @@
8AF0CBFD219A4C960001A6D0 /* Assets.xcassets */,
8AF0CBFF219A4C960001A6D0 /* LaunchScreen.storyboard */,
8AF0CC02219A4C960001A6D0 /* Info.plist */,
8AF0CC08219A601B0001A6D0 /* DarkMode.xcdatamodeld */,
8A7C2F3D219CB339003210FE /* BMI.swift */,
);
path = BMI;
sourceTree = "<group>";
@@ -135,7 +141,9 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8A7C2F3E219CB339003210FE /* BMI.swift in Sources */,
8AF0CBF9219A4C950001A6D0 /* ViewController.swift in Sources */,
8AF0CC0A219A601B0001A6D0 /* DarkMode.xcdatamodeld in Sources */,
8AF0CBF7219A4C950001A6D0 /* AppDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -336,6 +344,19 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */

/* Begin XCVersionGroup section */
8AF0CC08219A601B0001A6D0 /* DarkMode.xcdatamodeld */ = {
isa = XCVersionGroup;
children = (
8AF0CC09219A601B0001A6D0 /* DarkMode.xcdatamodel */,
);
currentVersion = 8AF0CC09219A601B0001A6D0 /* DarkMode.xcdatamodel */;
path = DarkMode.xcdatamodeld;
sourceTree = "<group>";
versionGroupType = wrapper.xcdatamodel;
};
/* End XCVersionGroup section */
};
rootObject = 8AF0CBEB219A4C950001A6D0 /* Project object */;
}
@@ -1,93 +1,129 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"idiom" : "iphone",
"filename" : "icon_20pt@2x.png",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"idiom" : "iphone",
"filename" : "icon_20pt@3x.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "icon_29pt.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "icon_29pt@2x.png",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"idiom" : "iphone",
"filename" : "icon_29pt@3x.png",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"idiom" : "iphone",
"filename" : "icon_40pt@2x.png",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"idiom" : "iphone",
"filename" : "icon_40pt@3x.png",
"scale" : "3x"
},
{
"size" : "57x57",
"idiom" : "iphone",
"size" : "60x60",
"filename" : "icon_57pt@1x.jpg",
"scale" : "1x"
},
{
"size" : "57x57",
"idiom" : "iphone",
"filename" : "icon_57pt@2x.jpg",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "icon_60pt@2x.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "icon_60pt@3x.png",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"idiom" : "ipad",
"filename" : "icon_20pt-1.png",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"idiom" : "ipad",
"filename" : "icon_40pt-1.png",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"idiom" : "ipad",
"filename" : "icon_29pt-1.png",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"idiom" : "ipad",
"filename" : "icon_29pt@2x-1.png",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"idiom" : "ipad",
"filename" : "icon_40pt.png",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"idiom" : "ipad",
"filename" : "icon_40pt@2x-1.png",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"idiom" : "ipad",
"filename" : "icon_76pt.png",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"idiom" : "ipad",
"filename" : "icon_76pt@2x.png",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "icon_83.5@2x.png",
"scale" : "2x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "Icon.png",
"scale" : "1x"
}
],
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "redButton.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "redButton2.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "Splash.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.
@@ -0,0 +1,22 @@
//
// BMI.swift
// BMI
//
// Created by Kenneth W Jackson on 11/14/18.
// Copyright © 2018 Connections Digital. All rights reserved.
//
import Foundation


//bmi = (myBMI.weight * 703) / (myBMI.height * myBMI.height)
public struct BMICalculator {
func bmi(height: Int, weight: Int) -> Int {
let bmiCalc = 703 * weight / (height * height)
return bmiCalc
}
}




@@ -1,7 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina6_5" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
@@ -11,15 +15,27 @@
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Splash" translatesAutoresizingMaskIntoConstraints="NO" id="fsJ-Cd-2cY">
<rect key="frame" x="19.666666666666657" y="114.66666666666669" width="375" height="667"/>
</imageView>
</subviews>
<color key="backgroundColor" red="0.8901960784313725" green="0.14117647058823529" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="fsJ-Cd-2cY" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="00t-Bt-FJY"/>
<constraint firstItem="fsJ-Cd-2cY" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="Bw5-7S-laU"/>
</constraints>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
<point key="canvasLocation" x="48.75" y="372.88732394366195"/>
</scene>
</scenes>
<resources>
<image name="Splash" width="375" height="667"/>
</resources>
</document>
Oops, something went wrong.

0 comments on commit f4961cc

Please sign in to comment.
You can’t perform that action at this time.