Skip to content

Commit

Permalink
Starting Stretching (#21)
Browse files Browse the repository at this point in the history
* Added Starting Stretching
* Fix a bug where choosing a progression does not represent it in database
  • Loading branch information
mazurio authored Dec 28, 2016
1 parent a257c0d commit 8ace239
Show file tree
Hide file tree
Showing 45 changed files with 551 additions and 514 deletions.
212 changes: 116 additions & 96 deletions BodyweightFitness.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions BodyweightFitness/Bodyweight Fitness.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.4.0</string>
<string>1.5.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>142</string>
<string>149</string>
<key>Fabric</key>
<dict>
<key>APIKey</key>
Expand Down
18 changes: 17 additions & 1 deletion BodyweightFitness/Controller/HomeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ class HomeViewController: UIViewController {
@IBOutlet weak var last7Days: UILabel!
@IBOutlet weak var last31Days: UILabel!

@IBOutlet weak var routineCardView: CardView!
@IBOutlet weak var routineTitle: UILabel!
@IBOutlet weak var routineShortDescription: UITextView!

init() {
super.init(nibName: "HomeView", bundle: nil)
}
Expand Down Expand Up @@ -38,6 +42,8 @@ class HomeViewController: UIViewController {
self.renderStatisticsView()

self.tabBarController?.title = it.title
self.routineTitle.text = it.title
self.routineShortDescription.text = it.shortDescription
})
}

Expand All @@ -52,7 +58,7 @@ class HomeViewController: UIViewController {
target: self,
action: #selector(routine))

self.tabBarController?.title = "Bodyweight Fitness"
self.tabBarController?.title = RoutineStream.sharedInstance.routine.title
}

func renderWorkoutProgressView() {
Expand Down Expand Up @@ -132,6 +138,10 @@ class HomeViewController: UIViewController {
RoutineStream.sharedInstance.setRoutine("routine0")
})

alertController.addAction(UIAlertAction(title: "Starting Stretching", style: .Default) { (action) in
RoutineStream.sharedInstance.setRoutine("d8a722a0-fae2-4e7e-a751-430348c659fe")
})

alertController.addAction(UIAlertAction(title: "Molding Mobility", style: .Default) { (action) in
RoutineStream.sharedInstance.setRoutine("e73593f4-ee17-4b9b-912a-87fa3625f63d")
})
Expand All @@ -146,4 +156,10 @@ class HomeViewController: UIViewController {
self.tabBarController?.navigationItem.backBarButtonItem = backItem
self.showViewController(WorkoutViewController(), sender: nil)
}

@IBAction func readMore(sender: AnyObject) {
if let requestUrl = NSURL(string: RoutineStream.sharedInstance.routine.url) {
UIApplication.sharedApplication().openURL(requestUrl)
}
}
}
13 changes: 11 additions & 2 deletions BodyweightFitness/Controller/WorkoutViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,19 @@ class WorkoutViewController: UIViewController {

alertController.addAction(
UIAlertAction(title: title, style: .Default) { (action) in
RoutineStream.sharedInstance.routine.setProgression(exercise)
let repositoryRoutine = RepositoryStream.sharedInstance.getRepositoryRoutineForToday()
let currentExerciseId = currentSection.currentExercise?.exerciseId
let exerciseId = exercise.exerciseId

self.changeExercise(exercise)
let realm = RepositoryStream.sharedInstance.getRealm()

try! realm.write {
repositoryRoutine.exercises.filter { $0.exerciseId == currentExerciseId }.first?.visible = false
repositoryRoutine.exercises.filter { $0.exerciseId == exerciseId }.first?.visible = true
}

RoutineStream.sharedInstance.routine.setProgression(exercise)
self.changeExercise(exercise)
PersistenceManager.storeRoutine(RoutineStream.sharedInstance.routine)
}
)
Expand Down
87 changes: 0 additions & 87 deletions BodyweightFitness/Frameworks/AnimatableImageView.swift

This file was deleted.

12 changes: 0 additions & 12 deletions BodyweightFitness/Frameworks/AnimatedFrame.swift

This file was deleted.

115 changes: 0 additions & 115 deletions BodyweightFitness/Frameworks/Animator.swift

This file was deleted.

79 changes: 0 additions & 79 deletions BodyweightFitness/Frameworks/ImageSourceHelpers.swift

This file was deleted.

Loading

0 comments on commit 8ace239

Please sign in to comment.