Skip to content

Commit 9bd11e2

Browse files
committed
Вынес модели в пакет SWModels
Дополнительно убрал лишние импорты и сгенерировал публичные инициализаторы
1 parent 05130fb commit 9bd11e2

File tree

113 files changed

+608
-497
lines changed

Some content is hidden

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

113 files changed

+608
-497
lines changed

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 & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,11 @@ let package = Package(
1212
targets: ["DateFormatterService"]
1313
)
1414
],
15-
dependencies: [
16-
.package(path: "../Utils")
17-
],
15+
dependencies: [],
1816
targets: [
1917
.target(
2018
name: "DateFormatterService",
21-
dependencies: ["Utils"]
19+
dependencies: []
2220
),
2321
.testTarget(
2422
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.

SwiftUI-WorkoutApp/Models/Country.swift

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

0 commit comments

Comments
 (0)