Post

Replies

Boosts

Views

Activity

Reply to List changing into a different mode in a different view
Your SheetView NavigationView is using the default style of .columns. You want .stack Add this modifier to the SheetView NavigationView: .navigationViewStyle(.stack) Like this: var body: some View { NavigationView { VStack { SheetListView() Spacer() HStack { Text("App version 0.1 (DEV)") .foregroundColor(.gray) } .toolbar { Button("Done") { dismiss() } .font(.headline) .padding() } } .background(Color(.systemGroupedBackground)) } .navigationViewStyle(.stack) /// **.stack** } Extra Hint: when pasting code to the forum, use "Paste and Match Style", to avoid the extra blank lines.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’21
Reply to Cannot convert value of type '[Double]' to expected argument type 'Double'
@H957169 some friendly tips: Please remember always to respond, when people try to help you. Include enough information in your question to allow people to understand your problem. When one of your questions is answered, remember to mark the question as answered. Then the forum will work as intended, and people will be more likely to help you in future.
Topic: Programming Languages SubTopic: Swift Tags:
Oct ’21
Reply to Alert isn't presenting when we use confirmationDialog in a View Xcode 13
Try this: @State private var showingOptions = false @State private var showingAlert = false var body: some View { VStack { Button("Show Options") { showingOptions = true } .alert(isPresented: $showingAlert) { Alert(title: Text("Alert"), message: Text("Message"), dismissButton: .default(Text("OK"))) } .confirmationDialog("Select option", isPresented: $showingOptions, titleVisibility: .visible) { Button("Show Alert") { self.showingAlert = true } } } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’21
Reply to DateFormatter vs leap seconds
Leap seconds are a long-running saga on macOS (and all Unix OSes). If you periodically sync your time with a server, then things are generally fine. But if you need to-the-second accuracy, while a leap-second is added, and you are performing date maths, then maybe not so good! If you have developed a workaround, please share it here!
Topic: App & System Services SubTopic: General Tags:
Oct ’21
Reply to iOS 15 - New JSONDecoding Decimals issue
Also interesting: struct DTO: Decodable { let amount: Double var decimal: Decimal { Decimal(amount) } } amount and decimal both print as 9.21 Or (better) try this: struct DTO: Decodable { let amount: Decimal enum CodingKeys: CodingKey { case amount } init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) let doubleValue = try container.decode(Double.self, forKey: .amount) amount = Decimal(doubleValue) } } This is basically keeping it simple for the JSON... JSON can do Doubles... ...then we convert to the Decimal that we really want. Plug-in this updated DTO to your project, and the rest of your code remains as-is.
Topic: Programming Languages SubTopic: Swift Tags:
Oct ’21
Reply to Cannot convert value of type '[Double]' to expected argument type 'Double'
"NewTime" is an array (of something - you don't say what. "NewDistance" is... what... you don't say. Then you have: let calculatePace = (NewTime / NewDistance) ...where you divide an Array by something. That doesn't make sense.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to List changing into a different mode in a different view
Your SheetView NavigationView is using the default style of .columns. You want .stack Add this modifier to the SheetView NavigationView: .navigationViewStyle(.stack) Like this: var body: some View { NavigationView { VStack { SheetListView() Spacer() HStack { Text("App version 0.1 (DEV)") .foregroundColor(.gray) } .toolbar { Button("Done") { dismiss() } .font(.headline) .padding() } } .background(Color(.systemGroupedBackground)) } .navigationViewStyle(.stack) /// **.stack** } Extra Hint: when pasting code to the forum, use "Paste and Match Style", to avoid the extra blank lines.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Cannot convert value of type '[Double]' to expected argument type 'Double'
"someValue" is expecting a type of "Double" So "SomeValue" and the other "SomeValue" must both be of type "Double" The error message suggests that one (or both) of them is not. If you include more code details, it will be possible to say exactly where the error lies.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Cannot convert value of type '[Double]' to expected argument type 'Double'
@H957169 some friendly tips: Please remember always to respond, when people try to help you. Include enough information in your question to allow people to understand your problem. When one of your questions is answered, remember to mark the question as answered. Then the forum will work as intended, and people will be more likely to help you in future.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Importing a custom programmed swift package
Did you declare anything that needs to be accessed outside the package as "public"?
Replies
Boosts
Views
Activity
Oct ’21
Reply to Alert isn't presenting when we use confirmationDialog in a View Xcode 13
Try this: @State private var showingOptions = false @State private var showingAlert = false var body: some View { VStack { Button("Show Options") { showingOptions = true } .alert(isPresented: $showingAlert) { Alert(title: Text("Alert"), message: Text("Message"), dismissButton: .default(Text("OK"))) } .confirmationDialog("Select option", isPresented: $showingOptions, titleVisibility: .visible) { Button("Show Alert") { self.showingAlert = true } } } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Cannot find 'Table' in scope
You did change something... you are using Xcode 13.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Ask for app feedback as an intermediate step before app review
No.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to DateFormatter vs leap seconds
Leap seconds are a long-running saga on macOS (and all Unix OSes). If you periodically sync your time with a server, then things are generally fine. But if you need to-the-second accuracy, while a leap-second is added, and you are performing date maths, then maybe not so good! If you have developed a workaround, please share it here!
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Two-step verification to add developer account works in VisualStudio for Mac, but it does not in Xcode
You have already asked this question, and people have tried to help. Better to add more information to that thread, rather than ask the question again.
Replies
Boosts
Views
Activity
Oct ’21
Reply to TestFlight is down
TestFlight is working for me. (UK)
Replies
Boosts
Views
Activity
Oct ’21
Reply to iOS 15 - New JSONDecoding Decimals issue
Also interesting: struct DTO: Decodable { let amount: Double var decimal: Decimal { Decimal(amount) } } amount and decimal both print as 9.21 Or (better) try this: struct DTO: Decodable { let amount: Decimal enum CodingKeys: CodingKey { case amount } init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) let doubleValue = try container.decode(Double.self, forKey: .amount) amount = Decimal(doubleValue) } } This is basically keeping it simple for the JSON... JSON can do Doubles... ...then we convert to the Decimal that we really want. Plug-in this updated DTO to your project, and the rest of your code remains as-is.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Xcode 13.0 installions blocked on M1 Big Sur 11.6
Xcode 13 can be installed from the App Store. When you say "installions blocked", what do you mean by that? What is "blocking" the installation? What is the exact message that you are seeing? Have you checked that you have enough free space to install Xcode (this is perhaps the most common issue)?
Replies
Boosts
Views
Activity
Oct ’21
Reply to time sensitive notification on iPad
{post removed}
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to iOS 15 - New JSONDecoding Decimals issue
Can you share the relevant parts of your code (e.g. the model and the decoding technique), and a sample of your JSON?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Oct ’21