Posts

Post not yet marked as solved
5 Replies
1.4k Views
does anyone know why when i create an instance of a view by typing it names and then putting parentheses after it, in a for loop, the View shares data amongst the instances? i need unique values within an instanceHere's the code to my view:struct SwiftUIView: SwiftUI.View { private let currentDB: [my_Section] = loadDB() private let subcurrentDB: [my_subSection] = loadSubsubsections() @ObservedObject var first_value: section_array // @Binding var current_section: ContentView.my_Section // @State private var comment: String = String() var body: some SwiftUI.View { Picker(selection: $first_value.first_value, label: Text("Subsection")) { ForEach(0 ..< self.subcurrentDB.count) { Text(self.subcurrentDB[$0].details) } } } }Here's how I create the view... ForEach(master_subsections) { result in SwiftUIView(first_value: self.first_value) }
Posted
by tonexoxo.
Last updated
.
Post not yet marked as solved
0 Replies
323 Views
I'm trying to create 2 pickers, one that when updated changes the values of the second picker based on the index of the first picker...When I change the value of the first picker, the second picker updates accordingly.The issue? When I select an item from the second picker, I get index out of range. The error is obvious, there are more items in the second picker then the first and they are both binded to the same dataset..So, when $selectedSubsection changes in the first picker, the second picker get's the according data.Now, how do I allow the second picker to make some choices on a new content so that $selectedSubsection doesn't change?Picker(selection: $selectedSubsection, label: Text("Subsection")) { ForEach(0 ..< self.subsections.count) { Text(self.subsections[$0].name) }} Picker(selection: $selectedSubsection, label: Text("Subsection")) { ForEach(0 ..< self.subsubsections.count) { if self.subsubsections[$0].belongs_to == self.subsections[self.selectedSubsection].id { Text(self.subsubsections[$0].details) } }}
Posted
by tonexoxo.
Last updated
.
Post not yet marked as solved
1 Replies
449 Views
is it possible to detect when the lock screen is being looked at to present a push notification at that time?example:my app can calculate how long the phone was been locked, id like to display the minutes it has been locked when the phone lock screen is looked at to give an option or the user to decide wether or not he/she wants to unlock it.can this be done?
Posted
by tonexoxo.
Last updated
.
Post not yet marked as solved
0 Replies
362 Views
Is it possible to use MDM to know when an app is launched and closed?Is it possible to use MDM to receive app usage statistics from the battery screen?Please provide examples and references if possible!
Posted
by tonexoxo.
Last updated
.
Post not yet marked as solved
0 Replies
967 Views
Hi. I found this app: https://apps.apple.com/us/app/moment-screen-time-control/id771541926It monitors how much time you spend on other apps on your iDevice (besides the app itself)...I want to know how to gather similar statistics?I'd like to do so with Push Notifications.Can't find the answer anywhere!Help please.
Posted
by tonexoxo.
Last updated
.