Hi,
You might want to check this article: https://www.hackingwithswift.com/quick-start/swiftui/how-to-add-a-search-bar-to-filter-your-data
A more correct way to do what you want to achieve would be to create a struct or class representing a medicine, and then an array containing the actual medicines that you want to display. Then, you would create your list by iterating over this array. And you could display the search results in this list, like the article explains it.
Hope it helps!
Post
Replies
Boosts
Views
Activity
Same for me
Hi! You might be interested by this free course created by Apple:
https://developer.apple.com/tutorials/app-dev-training
But before you get started with that, I recommend that you have a basic understand of Object Oriented Programming (OOP).
If you're completely new to programming/computer science, you might also want to check Harvard's CS50, available entirely for free on YouTube, or at this link:
https://www.edx.org/course/introduction-computer-science-harvardx-cs50x
It helped me a lot!
Have fun coding!
From what I've understood, it doesn't need to be 5 dimensional, but rather, 2 dimensional.
The dimension in a matrix doesn't correspond to the number of rows and columns. In your case, two dimensions seems enough: one for the severity (from one to five), and one for the likelihood (1 to 5).
You could therefore store data like so :
Matrix[2][5] = 3 (which would mean that there are 3 questions that have a severity of 2 and a likelihood of 3).
A good visual representation of the dimensions of a matrix would be the following. A one-dimensional matrix is just an array/list. A two dimensional array corresponds to an Excel/Numbers spreadsheet. And a three dimensional array could be use to store the coordinates of the cubes composing a Rubik's Cube, for example. Above 3, it's hard to have a visual representation.
A 5-dimensional matrix would be suitable if you had 5 different sliders per question.
Therefore, if you can represent your table in a spreadsheet, it means that two dimensions is enough.
Let me know if my answer is suitable for your project! :)
Hi! I didn’t really understand the things that you want to store in your matrix, could you please explain that better? Why do you need 5 dimensions?
I feel like using such a matrix for storing data is not a good idea and might not be easy to work with. You might be interested in learning more about Object Oriented Programming (OOP), and maybe store each question’s data inside a struct or a class that would represent a question.
My question might seem stupid, but have you downloaded the latest WatchOS 10 beta on your watch?
Hi,
when uploading a picture to safari on iOS, the user can able or disable GPS data in the bottom left corner, by tapping the “Options” button. (iOS 17)
From what I remember, this is not new to iOS 17.
Could you please provide more context? Maybe a screenshot of what you would like to accomplish?
What I can say for now is that you didn’t write anything into the “HelpView” button action. Therefore, it doesn’t do anything.
To learn more about SwiftUI, you might be interested in the following course :
https://developer.apple.com/tutorials/app-dev-training
PS: I've also thought of disabling the scrolling of the list, and then displaying it under my scrollview in a VStack, which itself would be in a vertical scrollview. But I didn't manage to get rid of the list's “scrollability“.
Hi! When installing SF Pro from Apple website (https://developer.apple.com/fonts/), you can read this in the license:
IMPORTANT NOTE: THE APPLE SF PRO FONT IS TO BE USED SOLELY FOR CREATING MOCK-UPS OF USER INTERFACES TO BE USED IN SOFTWARE PRODUCTS RUNNING ON APPLE’S iOS, iPadOS, macOS OR tvOS OPERATING SYSTEMS, AS APPLICABLE.
So the answer is: no, you can't use SF Fonts in a web app.
Solved it! In case anyone is wondering, the problem occurred because I'm also storing an enum case in my Interaction class, which is a known issue in iOS 17 Beta 2. The workaround was to store a String and then "translate" it to an enum type using a computed property. The computed property is declared as @Transient, so it's not stored. And it works perfectly fine!
Without more context or explanations, it's hard to help you.
The behaviour you are seeing is actually as expected, due to the way logical operators work in programming.
When you use an OR (||) operator in your while condition, it means the loop will continue to execute as long as at least one of the conditions is true. So in your case, the loop will keep running if either gemsCollected < 3 OR switchesToggled < 4.
Therefore, even if you have collected 3 gems, but have not toggled 4 switches, the loop will continue to run because the switchesToggled < 4 condition is still true.
Maybe you should take a look at the StoreKit documentation:
https://developer.apple.com/documentation/storekit
Hi! I think this StackOverflow post might help you:
https://stackoverflow.com/questions/76419052/how-to-resolve-swiftdata-error-type-does-not-conform-to-protocol-persisten
From what I've understood, it's a bug in Xcode Beta 2. The workaround for now is to not previews.