Post

Replies

Boosts

Views

Activity

Reply to Sorting Array of Dictionaries with Exceptions?
This should be possible by adjusting your sort condition. Instead of lValue.categoryName < rValue.categoryNameyou could write something like this: (lValue.categoryName == price || rValue.categoryName == price) || lValue.categoryName < rValue.categoryName or !(lValue.categoryName == price || rValue.categoryName == price) || lValue.categoryName < rValue.categoryName This is not correct code yet and I didn't validate the conditions, but I hope you get the idea. lValue.categoryName < rValue.categoryName is the sort condition the .sort-function uses to decide in which order the elements should appear. You can use very complex conditions or even a function deciding the order of two items by returning true or false depending on the order you want the two compared elements to appear.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’22
Reply to Do iPadOS 16 Playground support RegxBuilder?
RegEx and RegExBuilder support needs Swift 5.7. Playgrounds app on the iPad currently only supports Swift 5.6. Therefore it is not enough to have iPadOS 16 beta installed on the iPad you would need a new version of Playgrounds app too. Unfortunately this newer version often comes very late in the year, usually only after the new macOS version ships (in oct or nov) and in the last years there was no Testflight beta for the app.
Jun ’22
Reply to can i use sfsymbols in my app?
From the SF Symbols web page: All SF Symbols shall be considered to be system-provided images as defined in the Xcode and Apple SDKs license agreements and are subject to the terms and conditions set forth therein. You may not use SF Symbols — or glyphs that are substantially or confusingly similar — in your app icons, logos, or any other trademark-related use. Apple reserves the right to review and, in its sole discretion, require modification or discontinuance of use of any Symbol used in violation of the foregoing restrictions, and you agree to promptly comply with any such request. Especially the symbols marked with the little i in the circle (i) are restricted.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’22
Reply to SwiftUI Tutorial - Scrumdinger - mysterious AVPlayer initialization syntax
I can not find your quoted code private var player: AVPlayer { AVPlayer.sharedDingPlayer } in the Project Files. Did you mean private var player: AVPlayer = { AVPlayer.sharedDingPlayer }() ? This initialises the playervariable of Type AVPlayer with the result of the provided closure, which simply returns AVPlayer.sharedDingPlayer while leaving out the not needed return statement.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’22
Reply to Sorting Array of Dictionaries with Exceptions?
This should be possible by adjusting your sort condition. Instead of lValue.categoryName < rValue.categoryNameyou could write something like this: (lValue.categoryName == price || rValue.categoryName == price) || lValue.categoryName < rValue.categoryName or !(lValue.categoryName == price || rValue.categoryName == price) || lValue.categoryName < rValue.categoryName This is not correct code yet and I didn't validate the conditions, but I hope you get the idea. lValue.categoryName < rValue.categoryName is the sort condition the .sort-function uses to decide in which order the elements should appear. You can use very complex conditions or even a function deciding the order of two items by returning true or false depending on the order you want the two compared elements to appear.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’22
Reply to Swift Playgrounds
Take a look at the official Swift book
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Sep ’22
Reply to Take the screenshot of the WKView with embedded video
This is probably due to copyright restrictions. Screenshots of protected videos are blanked.
Topic: Machine Learning & AI SubTopic: General Tags:
Replies
Boosts
Views
Activity
Sep ’22
Reply to Navigating in and out of a NavigationSplitView
Has anyone got this to work? A NavigationSplitView inside of a NavigationStack? It still does not work in Xcode 14.1, iPadOS 16 Beta 2
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’22
Reply to Swift UI ‘ghost’ outline left over during TextField edition
Make sure you only access the GUI and the corresponding state from the main thread. If not, all kind of strange behaviour may occur.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’22
Reply to Why is @Binding not behaving as I expect here?
@Binding is not the right property wrapper to declare an ObservableObject inside a View. Use @ObservedObject or @StateObject to do that. @Binding is used for value type variables. see https://www.hackingwithswift.com/quick-start/swiftui/all-swiftui-property-wrappers-explained-and-compared
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’22
Reply to Lag in my game
You could try to use SwiftUI's Canvas View for drawing your maze instead of drawing separate views für each element.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’22
Reply to Can I use apple virtualization in swiftUI?
The Open Source Project "VirtualBuddy" on Github uses SwiftUI and Virtualization.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’22
Reply to Do iPadOS 16 Playground support RegxBuilder?
Now that Apple says (advertises) that it is possible to develop and publish an app on the App Store using only an iPad and Playgrounds, they should find a way to give access to the new APIs from the Playgrounds app before the release of the new OSes. Otherwise you would need a Mac and XCode again to make sure they run on the new versions, when they are published!
Replies
Boosts
Views
Activity
Jun ’22
Reply to Do iPadOS 16 Playground support RegxBuilder?
RegEx and RegExBuilder support needs Swift 5.7. Playgrounds app on the iPad currently only supports Swift 5.6. Therefore it is not enough to have iPadOS 16 beta installed on the iPad you would need a new version of Playgrounds app too. Unfortunately this newer version often comes very late in the year, usually only after the new macOS version ships (in oct or nov) and in the last years there was no Testflight beta for the app.
Replies
Boosts
Views
Activity
Jun ’22
Reply to Navigating in and out of a NavigationSplitView
I observed something similar trying to put a NavigationSplitView inside a NavigationStack. Let's hope this is a beta (1) problem and perhaps there is even a beta 2 today with improvements. Does anyone know if this setup should work?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to How to execute a CPU-bound task in background using Swift Concurrency without blocking UI updates?
You need to create a detached Task in compute: https://docs.swift.org/swift-book/LanguageGuide/Concurrency.html#ID643
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to Why LazyHStack takes full height but HStack does not?
Because LazyHStack can't know it's ideal size without generating (not lazyly) all of its children, therefore defeating its original purpose. So it has to choose a fixed height?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’22
Reply to can i use sfsymbols in my app?
From the SF Symbols web page: All SF Symbols shall be considered to be system-provided images as defined in the Xcode and Apple SDKs license agreements and are subject to the terms and conditions set forth therein. You may not use SF Symbols — or glyphs that are substantially or confusingly similar — in your app icons, logos, or any other trademark-related use. Apple reserves the right to review and, in its sole discretion, require modification or discontinuance of use of any Symbol used in violation of the foregoing restrictions, and you agree to promptly comply with any such request. Especially the symbols marked with the little i in the circle (i) are restricted.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’22
Reply to SwiftUI Tutorial - Scrumdinger - mysterious AVPlayer initialization syntax
I can not find your quoted code private var player: AVPlayer { AVPlayer.sharedDingPlayer } in the Project Files. Did you mean private var player: AVPlayer = { AVPlayer.sharedDingPlayer }() ? This initialises the playervariable of Type AVPlayer with the result of the provided closure, which simply returns AVPlayer.sharedDingPlayer while leaving out the not needed return statement.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
May ’22