Post

Replies

Boosts

Views

Activity

Reply to Segmentation fault vs Variable ... used before being initialized
init() in SwiftUI for State var is a bit tricky: https://www.hackingwithswift.com/forums/swiftui/why-no-setting-of-intial-state/2021 Something like this should work:     @Binding var playingId: Int?     @State var player: AVPlayer!     init(playingId: Binding<Int?>, player: AVPlayer) {         _player = State(initialValue: player)         self._playingId = playingId }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’21
Reply to Is it legal to decompile Apple Open Source components?
If you illustrate behaviour by showing interactions, you do not decompile, you simply execute. So there should not be decompilation legal issue. Take care to fully follow open software rules (you may have to publish the relevant parts of your code in open source). I would also advise to be very clear when you submit to Appstore, by explaining the situation in the comments to reviewer.
Topic: App & System Services SubTopic: Core OS Tags:
Aug ’21
Reply to Bug in SwiftUI?
There may be an identifier missing . Replace List(m_watch_list_view_model.m_watch_list_model) { watch_list_model in with List(m_watch_list_view_model.m_watch_list_model, id: \.id) { watch_list_model in Note: the use of underscore in name is not Switish at all. Remove them and replace by camelCase. For instance m_watch_list_view_model should become mWatchListViewModel furthermore, the starting m has not clear meaning.  So you could replace with watchListViewModel
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’21
Reply to Is there a way to generate Swift/Swift UI code based on user input?
No direct answer to the question. But take care on rules for review: there are strict limits to adding executable code to an app. 2.5.2 Apps should be self-contained in their bundles, and may not read or write data outside the designated container area, nor may they download, install, or execute code which introduces or changes features or functionality of the app, including other apps. Educational apps designed to teach, develop, or allow students to test executable code may, in limited circumstances, download code provided that such code is not used for other purposes. Such apps must make the source code provided by the app completely viewable and editable by the user.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’21
Reply to How to extract the value of CGFloat from CGPoint?
1.       var xvalues: [CGFloat] = [] 2.       var yvalues: [CGFloat] = [] 3.       if (observation1.count) == 5{ 4.         for n in observation1 { 5.           xvalues.append(n.x) 6.           yvalues.append(n.y) 7.         } 8.         filter1 = convolve(xvalues, sgfilterwindow5_order2) 9.         filter2 = convolve(yvalues, sgfilterwindow5_order2) It seems you miss a closing curly bracket before line 8. Use map function: if (observation1.count) == 5 { xvalues = observation1.map {$0.x } yvalues = observation1.map {$0.y } }
Aug ’21