MacOS support using Mac Catalyst
This commit is contained in:
@@ -6,8 +6,10 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import UIKit
|
||||
import SwiftUI
|
||||
#if !os(macOS)
|
||||
import UIKit
|
||||
#endif
|
||||
|
||||
@MainActor class MainViewModel: ObservableObject {
|
||||
@Published var categories: [Category] = []
|
||||
|
||||
@@ -33,6 +33,7 @@ struct CategoryDetailView: View {
|
||||
.navigationTitle(categoryName == "*" ? "Other" : categoryName)
|
||||
.toolbar {
|
||||
ToolbarItem(placement: .topBarTrailing) {
|
||||
|
||||
Menu {
|
||||
Button {
|
||||
print("Add new recipe")
|
||||
|
||||
@@ -367,13 +367,17 @@ fileprivate struct DurationPicker: View {
|
||||
Text(title)
|
||||
Spacer()
|
||||
TextField("00", text: $duration.hourComponent)
|
||||
#if !os(macOS)
|
||||
.keyboardType(.decimalPad)
|
||||
#endif
|
||||
.textFieldStyle(.roundedBorder)
|
||||
.multilineTextAlignment(.trailing)
|
||||
.frame(maxWidth: 40)
|
||||
Text(":")
|
||||
TextField("00", text: $duration.minuteComponent)
|
||||
#if !os(macOS)
|
||||
.keyboardType(.decimalPad)
|
||||
#endif
|
||||
.textFieldStyle(.roundedBorder)
|
||||
.frame(maxWidth: 40)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user