Skip to content

Commit f3dd56f

Browse files
authored
Merge pull request #75 from OlegEremenko991/develop
- Вынес модели в отдельный пакет SWModels - Убрал лишние импорты и сгенерировал публичные инициализаторы - Включил еще несколько правил форматирования кода
2 parents 660d8e3 + 9bd11e2 commit f3dd56f

File tree

119 files changed

+781
-694
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+781
-694
lines changed

.swiftformat

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,22 +76,12 @@ unusedArguments, \
7676
preferKeyPath
7777

7878
--disable isEmpty, \
79-
indent, \
8079
markTypes, \
8180
organizeDeclarations, \
82-
wrapMultilineStatementBraces, \
83-
wrap, \
84-
linebreakAtEndOfFile, \
8581
numberFormatting, \
86-
opaqueGenericParameters, \
87-
redundantRawValues, \
8882
sortDeclarations, \
8983
sortedSwitchCases, \
90-
trailingClosures, \
91-
wrapSwitchCases, \
92-
wrapEnumCases, \
93-
wrapConditionalBodies, \
94-
yodaConditions
84+
wrapMultilineStatementBraces
9585

9686
# Exclude
9787
--exclude \

SwiftUI-WorkoutApp.xcodeproj/project.pbxproj

Lines changed: 17 additions & 140 deletions
Large diffs are not rendered by default.

SwiftUI-WorkoutApp/Constants.swift

Lines changed: 0 additions & 38 deletions
This file was deleted.

SwiftUI-WorkoutApp/DateFormatterService/Package.swift

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,16 @@ let package = Package(
77
name: "DateFormatterService",
88
platforms: [.iOS(.v15)],
99
products: [
10-
// Products define the executables and libraries a package produces, and make them visible to other packages.
1110
.library(
1211
name: "DateFormatterService",
1312
targets: ["DateFormatterService"]
1413
)
1514
],
16-
dependencies: [
17-
// Dependencies declare other packages that this package depends on.
18-
// .package(url: /* package url */, from: "1.0.0"),
19-
.package(path: "../Utils")
20-
],
15+
dependencies: [],
2116
targets: [
22-
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
23-
// Targets can depend on other targets in this package, and on products in packages this package depends on.
2417
.target(
2518
name: "DateFormatterService",
26-
dependencies: ["Utils"]
19+
dependencies: []
2720
),
2821
.testTarget(
2922
name: "DateFormatterServiceTests",

SwiftUI-WorkoutApp/Utils/Sources/Utils/Date+.swift renamed to SwiftUI-WorkoutApp/DateFormatterService/Sources/DateFormatterService/Date+.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Foundation
22

3-
public extension Date {
3+
extension Date {
44
var isToday: Bool {
55
Calendar.current.isDateInToday(self)
66
}

SwiftUI-WorkoutApp/DateFormatterService/Sources/DateFormatterService/DateFormatterService.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import Foundation
2-
import Utils
32

43
public enum DateFormatterService {
54
public static func readableDate(from string: String?, locale: Locale = .autoupdatingCurrent) -> String {
@@ -34,14 +33,14 @@ public enum DateFormatterService {
3433
}
3534

3635
public static func dateFromIsoString(_ string: String?) -> Date {
37-
ISO8601DateFormatter().date(from: string.valueOrEmpty) ?? .now
36+
ISO8601DateFormatter().date(from: string ?? "") ?? .now
3837
}
3938

4039
public static func dateFromString(_ string: String?, format: DateFormat) -> Date {
4140
let formatter = DateFormatter()
4241
formatter.dateFormat = format.rawValue
4342
formatter.locale = Locale(identifier: "en_US_POSIX")
44-
return formatter.date(from: string.valueOrEmpty) ?? .now
43+
return formatter.date(from: string ?? "") ?? .now
4544
}
4645
}
4746

SwiftUI-WorkoutApp/Extensions/Array+.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import Foundation
1+
import SWModels
22
import UIKit.UIImage
33

4-
extension Array where Element: UIImage {
4+
extension [UIImage] {
55
/// Создает список медиафайлов из картинок для отправки на сервер
66
var toMediaFiles: [MediaFile] {
77
enumerated().compactMap { index, image in
File renamed without changes.
File renamed without changes.

SwiftUI-WorkoutApp/Models/AuthData.swift

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)