Skip to content

Commit

Permalink
Add activity type drop down option to allow user to select their dail…
Browse files Browse the repository at this point in the history
…y activity(ies).
  • Loading branch information
hitenkmr committed Aug 14, 2018
1 parent cbe3130 commit 3d21aed
Show file tree
Hide file tree
Showing 9 changed files with 480 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Actifit/Actifit/Assets.xcassets/check.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "check.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "check@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "check@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
349 changes: 349 additions & 0 deletions Actifit/Actifit/Extensions/UIView+Additions.swift

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions Actifit/Actifit/Views/ActivityTypeTableViewCell.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// ActivityTypeTableViewCell.swift
// Actifit
//
// Created by Hitender kumar on 15/08/18.
//

import UIKit

class ActivityTypeTableViewCell: UITableViewCell {

override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}

override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)

// Configure the view for the selected state
}

}
21 changes: 21 additions & 0 deletions Actifit/Actifit/Views/ActivityTypeTableViewCell.xib
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13142" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12042"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="ActivityTypeTableViewCell" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<rect key="frame" x="0.0" y="0.0" width="320" height="43"/>
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
</tableViewCell>
</objects>
</document>
46 changes: 46 additions & 0 deletions Actifit/Actifit/Views/ActivityTypesView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
//
// ActivityTypesView.swift
// Actifit
//
// Created by Hitender kumar on 15/08/18.
//

import UIKit

class ActivityTypesView: UIView {

@IBOutlet weak var activitiesTAbleView : UITableView!
@IBOutlet weak var selectActivityBtn : UIButton!

let activityTypes = ["Aerobics", "BasketBall", "Boxing", "Cycling", "Daily Activity", "Dancing", "Elliptical", "Football", "House Chores", "Jogging", "Martial Arts", "Moving Around Office", "Rope Skipping", "Running", "Shopping", "Stair Mill", "Table Tennis", "Tennis", "Treadmill", "Walking", "Weight Lifting"]

var selectedActivities : [String]()

override func awakeFromNib() {
super.awakeFromNib()
}

//MARK : INTERFACE BUILDER ACTIONS

}

extension ActivityTypesView : UITableViewDelegate, UITableViewDataSource {

//MARK: UITableViewDataSource

func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return activityTypes.count
}

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell : ActivityTypeTableViewCell = tableView.dequeueReusableCell(withIdentifier: "ActivityTypeTableViewCell", for: indexPath) as! ActivityTypeTableViewCell
cell.SelectActivityBtnCompletion = { selectedIndexPath in
self.selectedActivities.append(self.activityTypes[selectedIndexPath.row])
}
return cell
}

//MARK: UITableViewDelegate


}
18 changes: 18 additions & 0 deletions Actifit/Actifit/Views/ActivityTypesView.xib
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13142" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12042"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/>
</view>
</objects>
</document>

0 comments on commit 3d21aed

Please sign in to comment.