Post

Replies

Boosts

Views

Activity

Reply to Review process
We are trying to get an app on the App Store that uses background location management. According to the review team, our app is used solely for the purpose of tracking employees, and is thus unsuitable for the App Store. The guideline the review team says we do not follow is 2.5.4. And why does the app need to run in the background mode?
Jan ’21
Reply to Updating @State Variable Depending ForEach Row Selection
It seems that I have achieved my objective with the following. But I'm not sure if it's an efficient approach. import SwiftUI struct ContentView: View { @State var numbers = [2021, 9, 30] var body: some View { let firstLocalYear = 2021 let firstLocalMonth = 9 let firstLocalDay = 24 let firstLastDay = 30 NavigationView { List { Section(header: Text("Current month")) { ForEach(firstLocalDay ..< firstLastDay) { i in HStack { Text("\(firstLocalMonth)-\(i + 1)") Spacer() Button("Select") { self.numbers = [firstLocalYear, firstLocalMonth, i + 1] } NavigationLink( destination: TimeView(numbers: $numbers), label: { Text("") }) } } } } } } } struct TimeView: View { @Binding var numbers: [Int] var body: some View { HStack { Text(String(numbers[0])) Text(String(numbers[1])) Text(String(numbers[2])) } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’21