Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

notepad module logic setup #3

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
543 changes: 428 additions & 115 deletions Everyday.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,26 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/firebase-ios-sdk",
"state" : {
"revision" : "f91c8167141d0279726c6f6d9d4a47c026785cbc",
"version" : "10.21.0"
"revision" : "fe09d61a539e11fdbe24f269bba10144b6145fe2",
"version" : "10.22.0"
}
},
{
"identity" : "googleappmeasurement",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleAppMeasurement.git",
"state" : {
"revision" : "cb8617fab75d181270a1d8f763f26b15c73e2e1e",
"version" : "10.21.0"
"revision" : "bf3bb24f6b60a7acedaef504e9ce97154203217a",
"version" : "10.22.0"
}
},
{
"identity" : "googledatatransport",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleDataTransport.git",
"state" : {
"revision" : "a732a4b47f59e4f725a2ea10f0c77e93a7131117",
"version" : "9.3.0"
"revision" : "a637d318ae7ae246b02d7305121275bc75ed5565",
"version" : "9.4.0"
}
},
{
Expand All @@ -68,8 +68,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleUtilities.git",
"state" : {
"revision" : "bc27fad73504f3d4af235de451f02ee22586ebd3",
"version" : "7.12.1"
"revision" : "830ffa9276e10267881f2697283c2fcd867603fd",
"version" : "7.13.0"
}
},
{
Expand All @@ -86,8 +86,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/gtm-session-fetcher.git",
"state" : {
"revision" : "76135c9f4e1ac85459d5fec61b6f76ac47ab3a4c",
"version" : "3.3.1"
"revision" : "5ccda3981422a84186387dbb763ba739178b529c",
"version" : "2.3.0"
}
},
{
Expand All @@ -113,8 +113,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/leveldb.git",
"state" : {
"revision" : "9d108e9112aa1d65ce508facf804674546116d9c",
"version" : "1.22.3"
"revision" : "43aaef65e0c665daadf848761d560e446d350d3d",
"version" : "1.22.4"
}
},
{
"identity" : "m13checkbox",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Marxon13/M13Checkbox",
"state" : {
"revision" : "96ff6c8862db87095315480a56dcebe51e15dac8",
"version" : "3.4.1"
}
},
{
Expand All @@ -140,8 +149,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/promises.git",
"state" : {
"revision" : "e70e889c0196c76d22759eb50d6a0270ca9f1d9e",
"version" : "2.3.1"
"revision" : "540318ecedd63d883069ae7f1ed811a2df00b6ac",
"version" : "2.4.0"
}
},
{
Expand All @@ -158,8 +167,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/VKCOM/vkid-ios-sdk.git",
"state" : {
"revision" : "ed4b733be37abd273c65406bff709e2f79656dc7",
"version" : "1.2.2"
"revision" : "005d6876b367840e8ab5741fd6f69bef2d48f0d7",
"version" : "1.3.0"
}
}
],
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,42 @@
<key>Everyday.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
<integer>2</integer>
</dict>
<key>Promises (Playground) 1.xcscheme</key>
<key>Playground (Playground) 1.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>5</integer>
</dict>
<key>Playground (Playground) 2.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>6</integer>
</dict>
<key>Playground (Playground).xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>4</integer>
</dict>
<key>Promises (Playground) 1.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>2</integer>
</dict>
<key>Promises (Playground) 2.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>5</integer>
<integer>3</integer>
</dict>
<key>Promises (Playground) 3.xcscheme</key>
<dict>
Expand Down Expand Up @@ -49,7 +70,7 @@
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>2</integer>
<integer>0</integer>
</dict>
</dict>
</dict>
Expand Down
25 changes: 25 additions & 0 deletions Everyday/Entities/User.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// User.swift
// Everyday
//
// Created by user on 28.02.2024.
//

import Foundation

struct Schedule {
let daysOfWeek: [[(workout: Workout, indexOfDay: Int)]] // 7 elements (arrays) = 7 days
}

struct MockSchedule {

static let mockSchedule = Schedule(daysOfWeek: [
[],
[],
[],
[],
[(workout: Mock.mockWorkouts[0], indexOfDay: 0), (workout: Mock.mockWorkouts[1], indexOfDay: 0)],
[(workout: Mock.mockWorkouts[2], indexOfDay: 0)],
[(workout: Mock.mockWorkouts[0], indexOfDay: 1)]
])
}
68 changes: 68 additions & 0 deletions Everyday/Entities/Workout.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
//
// Workout.swift
// Everyday
//
// Created by user on 28.02.2024.
//

import Foundation

struct Workout {
let name: String
var days: [DayOfWorkout]
}

struct DayOfWorkout {
var name: String
var sets: [TrainingSet]
}

struct TrainingSet {
var name: String
var exercises: [Exercise]
}

struct Exercise {
let name: String
let description: String
var result: String // change for enum ResultOfExercise, problem: set 0 by default?
}

// not in use yet
enum ResultOfExercise {
case reps(Int, Int) // associated values: number of reps, extra weight (zero by default or another case)
case time(Int, Int, Int) // associated values: minutes, seconds, extra weight (zero by default or another case)
}

struct Mock {

static let mockWorkouts = [
Workout(name: "Фулбоди", days: [
DayOfWorkout(name: "День 1", sets: [
TrainingSet(name: "", exercises: [
Exercise(name: "Подтягивания", description: "", result: "10"),
Exercise(name: "Отжимания", description: "", result: "20")]),
TrainingSet(name: "", exercises: [
Exercise(name: "Пресс", description: "", result: "11"),
Exercise(name: "Спина", description: "", result: "22")])]),
DayOfWorkout(name: "День 2", sets: [
TrainingSet(name: "", exercises: [
Exercise(name: "епуапук", description: "", result: "10 раз"),
Exercise(name: "куцпкцпц", description: "", result: "20 раз")]),
TrainingSet(name: "", exercises: [
Exercise(name: "кцпук", description: "", result: "1 минута"),
Exercise(name: "куцпукп", description: "", result: "20 раз")])])]),
Workout(name: "Руки", days: [
DayOfWorkout(name: "День 1", sets: [
TrainingSet(name: "", exercises: [
Exercise(name: "Фокусы", description: "", result: "10 попугаев")])])]),
Workout(name: "Ноги", days: [
DayOfWorkout(name: "День 1", sets: [
TrainingSet(name: "", exercises: [
Exercise(name: "Штанга", description: "", result: "8 раз")])])]),
Workout(name: "Кардио", days: [
DayOfWorkout(name: "День 1", sets: [
TrainingSet(name: "", exercises: [
Exercise(name: "Jumping Jacks", description: "", result: "20 раз")])])])
]
}
FiX1iN1iT marked this conversation as resolved.
Show resolved Hide resolved
6 changes: 6 additions & 0 deletions Everyday/Extensions/String+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,10 @@ extension String {
var localized: String {
NSLocalizedString(self, comment: "\(self) could not be found in Localized file")
}

var isNumber: Bool {
return self.allSatisfy { character in
character.isNumber
}
}
}
20 changes: 10 additions & 10 deletions Everyday/Extensions/UIColor+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ extension UIColor {
guard let color = UIColor(named: "SpaceGray") else {
fatalError("Can't find color: SpaceGray")
}
return color
}()
static let grayElement: UIColor = {
guard let color = UIColor(named: "GrayElements") else {
fatalError("Can't find color: Snow")
}
return color
}()
}
return color
}()

static let grayElement: UIColor = {
guard let color = UIColor(named: "GrayElements") else {
fatalError("Can't find color: Snow")
}
return color
}()
}
}
1 change: 0 additions & 1 deletion Everyday/Extensions/UIView+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import UIKit

extension UIView {

func addSubviews(_ views: UIView...) {
for view in views {
addSubview(view)
Expand Down
12 changes: 12 additions & 0 deletions Everyday/Helpers/CustomError.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//
// CustomError.swift
// Everyday
//
// Created by user on 28.02.2024.
//

import Foundation

enum CustomError: String, Error {
case unknownError = "Неопределнная ошибка"
}
FiX1iN1iT marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import SwiftUI

struct ProfileAcknowledgementView: View {
struct ProfileAcknowledgementView: View {

// MARK: - properties

Expand Down Expand Up @@ -176,11 +176,11 @@ struct ProfileAcknowledgementView: View {
ProfileAcknowledgementModel.shared.gender = selectedGender.description
ProfileAcknowledgementModel.shared.weight = selectedWeight
}
}
}

// MARK: - extensions
// MARK: - extensions

private extension ProfileAcknowledgementView {
private extension ProfileAcknowledgementView {
struct Constants {

static let primaryText = Color.primaryText
Expand Down Expand Up @@ -212,4 +212,4 @@ private extension ProfileAcknowledgementView {
static let colorOpacity: CGFloat = 0.1
}
}
}
}
Loading