Skip to content

Commit

Permalink
Merge pull request #20 from ayesha1/Create-Profile-Page
Browse files Browse the repository at this point in the history
Create profile page
  • Loading branch information
ayesha1 authored May 9, 2019
2 parents 3722896 + 52ea450 commit c1673a2
Show file tree
Hide file tree
Showing 4,413 changed files with 987,168 additions and 2,917 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
22 changes: 17 additions & 5 deletions FitGram.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

/* Begin PBXBuildFile section */
67421F5E8D7162D63B85AE62 /* Pods_FitGramUITests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 940399A09079A09547646AE6 /* Pods_FitGramUITests.framework */; };
6A75F12B227CC68C005CABED /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 6A75F12A227CC68C005CABED /* GoogleService-Info.plist */; };
6A75F169227F8BC3005CABED /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 6A75F168227F8BC3005CABED /* GoogleService-Info.plist */; };
6A861C682248425000D7B261 /* ProfileViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A861C672248425000D7B261 /* ProfileViewController.swift */; };
6A861C6A2248426100D7B261 /* ExerciseNewsFeedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A861C692248426100D7B261 /* ExerciseNewsFeedViewController.swift */; };
6A861C6C2248426B00D7B261 /* ChallengeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A861C6B2248426B00D7B261 /* ChallengeViewController.swift */; };
Expand Down Expand Up @@ -47,7 +47,7 @@
08D493BD7918F5C714641236 /* Pods-FitGramTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FitGramTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-FitGramTests/Pods-FitGramTests.release.xcconfig"; sourceTree = "<group>"; };
4026B0B4A0A30922BCDAAEB9 /* Pods-FitGramTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FitGramTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-FitGramTests/Pods-FitGramTests.debug.xcconfig"; sourceTree = "<group>"; };
4D5C0C86127AECE77FBF174D /* Pods-FitGramUITests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FitGramUITests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-FitGramUITests/Pods-FitGramUITests.debug.xcconfig"; sourceTree = "<group>"; };
6A75F12A227CC68C005CABED /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
6A75F168227F8BC3005CABED /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "../../../../Downloads/GoogleService-Info.plist"; sourceTree = "<group>"; };
6A861C672248425000D7B261 /* ProfileViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ProfileViewController.swift; path = ../ProfileViewController.swift; sourceTree = "<group>"; };
6A861C692248426100D7B261 /* ExerciseNewsFeedViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ExerciseNewsFeedViewController.swift; path = ../ExerciseNewsFeedViewController.swift; sourceTree = "<group>"; };
6A861C6B2248426B00D7B261 /* ChallengeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = ChallengeViewController.swift; path = ../ChallengeViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -108,6 +108,7 @@
6A861C6622483EEF00D7B261 /* Controllers */ = {
isa = PBXGroup;
children = (
6A94450D22480D3000980F88 /* AppDelegate.swift */,
6ACF3609226677D80088EB0B /* Tabs */,
6AADB1D12261624000290A83 /* LandingPageViewController.swift */,
6AADB1D32261625100290A83 /* LoginViewController.swift */,
Expand Down Expand Up @@ -144,11 +145,10 @@
children = (
6ADD6EE3225E336000B63B3E /* FitGram.entitlements */,
6A861C6622483EEF00D7B261 /* Controllers */,
6A94450D22480D3000980F88 /* AppDelegate.swift */,
6A94451422480D3300980F88 /* Assets.xcassets */,
6A94451622480D3300980F88 /* LaunchScreen.storyboard */,
6A94451922480D3300980F88 /* Info.plist */,
6A75F12A227CC68C005CABED /* GoogleService-Info.plist */,
6A75F168227F8BC3005CABED /* GoogleService-Info.plist */,
);
path = FitGram;
sourceTree = "<group>";
Expand Down Expand Up @@ -323,7 +323,7 @@
files = (
6A94451822480D3300980F88 /* LaunchScreen.storyboard in Resources */,
6A94451522480D3300980F88 /* Assets.xcassets in Resources */,
6A75F12B227CC68C005CABED /* GoogleService-Info.plist in Resources */,
6A75F169227F8BC3005CABED /* GoogleService-Info.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -405,19 +405,31 @@
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-FitGram/Pods-FitGram-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/BoringSSL-GRPC/openssl_grpc.framework",
"${BUILT_PRODUCTS_DIR}/CBFlashyTabBarController/CBFlashyTabBarController.framework",
"${BUILT_PRODUCTS_DIR}/GTMSessionFetcher/GTMSessionFetcher.framework",
"${BUILT_PRODUCTS_DIR}/GoogleUtilities/GoogleUtilities.framework",
"${BUILT_PRODUCTS_DIR}/PMSuperButton/PMSuperButton.framework",
"${BUILT_PRODUCTS_DIR}/Protobuf/Protobuf.framework",
"${BUILT_PRODUCTS_DIR}/SnapKit/SnapKit.framework",
"${BUILT_PRODUCTS_DIR}/gRPC-C++/grpcpp.framework",
"${BUILT_PRODUCTS_DIR}/gRPC-Core/grpc.framework",
"${BUILT_PRODUCTS_DIR}/leveldb-library/leveldb.framework",
"${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/openssl_grpc.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CBFlashyTabBarController.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GTMSessionFetcher.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleUtilities.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PMSuperButton.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Protobuf.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SnapKit.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/grpcpp.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/grpc.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/leveldb.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
Expand Down
Binary file not shown.
21 changes: 21 additions & 0 deletions FitGram/Assets.xcassets/arrow.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "arrow.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file added FitGram/Assets.xcassets/arrow.imageset/arrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions FitGram/Assets.xcassets/camera.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "camera.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"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.
21 changes: 21 additions & 0 deletions FitGram/Assets.xcassets/logout.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "logout.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"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.
21 changes: 21 additions & 0 deletions FitGram/Assets.xcassets/plus.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "plus.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file added FitGram/Assets.xcassets/plus.imageset/plus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions FitGram/Assets.xcassets/settings.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "settings.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"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.
21 changes: 21 additions & 0 deletions FitGram/Assets.xcassets/user.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "user.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file added FitGram/Assets.xcassets/user.imageset/user.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import UIKit
import Firebase

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

Expand All @@ -22,6 +23,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
window?.makeKeyAndVisible()

FirebaseApp.configure()

return true
}

Expand Down
4 changes: 2 additions & 2 deletions FitGram/Controllers/ChallengeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ class ChallengeViewController: UIViewController {
super.viewDidLoad()

// Do any additional setup after loading the view.
self.view.backgroundColor = UIColor.red
self.title = ""
self.view.backgroundColor = UIColor.white
self.title = "Challenge"
}

override func didReceiveMemoryWarning() {
Expand Down
89 changes: 87 additions & 2 deletions FitGram/Controllers/ExerciseNewsFeedViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,103 @@
//

import UIKit
import SnapKit
import Firebase

class ExerciseNewsFeedViewController: UIViewController {
var roundButton = UIButton()
weak var labelMessage: UILabel!
let db = Firestore.firestore()
let timestamp = NSDate().timeIntervalSince1970

override func viewDidLoad() {
super.viewDidLoad()


// Do any additional setup after loading the view.
self.view.backgroundColor = UIColor.red
self.title = ""
self.view.backgroundColor = UIColor.white
self.title = "Exercise"



//Button
self.roundButton = UIButton(type: .custom)
self.roundButton.setTitleColor(UIColor.orange, for: .normal)
self.roundButton.addTarget(self, action: #selector(ButtonClick(_:)), for: UIControl.Event.touchUpInside)
self.view.addSubview(roundButton)
}



override func viewWillLayoutSubviews() {

roundButton.layer.cornerRadius = roundButton.layer.frame.size.width/2
roundButton.backgroundColor = UIColor.lightGray
roundButton.clipsToBounds = true
roundButton.setImage(#imageLiteral(resourceName: "plus"), for: .normal)
roundButton.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
roundButton.trailingAnchor.constraint(equalTo: self.view.trailingAnchor, constant: -10),
roundButton.bottomAnchor.constraint(equalTo: self.view.bottomAnchor, constant: -60),
roundButton.widthAnchor.constraint(equalToConstant: 50),
roundButton.heightAnchor.constraint(equalToConstant: 50)])
}

@objc func ButtonClick(_ sender: UIButton){

/** Do whatever you wanna do on button click**/
print("🤬")
showInputDialog()


}

func showInputDialog() {
//Creating UIAlertController and
//Setting title and message for the alert dialog
let alertController = UIAlertController(title: "Enter Workout", message: "Enter Workout Name, Calories Burned and Time duration", preferredStyle: .alert)

//the confirm action taking the inputs
let confirmAction = UIAlertAction(title: "Enter", style: .default) { (_) in

//getting the input values from user
let workoutName = alertController.textFields?[0].text
let caloriesBurned = alertController.textFields?[1].text
var ref: DocumentReference? = nil

let dataToSave: [String: Any] = ["workoutName": workoutName, "timeEntered": self.timestamp, "caloriesBurned": Int(caloriesBurned!)]
ref = self.db.collection("workouts").addDocument(data: dataToSave) { err in
if let err = err {
print("Error adding document: \(err)")
} else {
print("Document added with ID: \(ref!.documentID)")
}
}

}

//the cancel action doing nothing
let cancelAction = UIAlertAction(title: "Cancel", style: .cancel) { (_) in }

//adding textfields to our dialog box
alertController.addTextField { (textField) in
textField.placeholder = "Enter Workout Name"
}
alertController.addTextField { (textField) in
textField.placeholder = "Enter Calories"
}

//adding the action to dialogbox
alertController.addAction(confirmAction)
alertController.addAction(cancelAction)

//finally presenting the dialog box
self.present(alertController, animated: true, completion: nil)
}

override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}

}
Loading

0 comments on commit c1673a2

Please sign in to comment.