I have set in my info.plist file, the background and image I want for my launch screen.
The image is 200px x 200px and for some reason, when the launch screen happens, the image gets stretched, not keeping the original size.
How can I fix it ?
Thank you
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
The main view on my app brings data from 3 different API calls.
So when the app starts, the data are still being returned, so nothing is seen but just a blank space.
They are basically a Thumbnail and its title.
What would be the best solution for that:
Have a temporary thumb and a text like "loading" OR
any other approach?
Thank you
I have a store, but need to call the method inside the body.
However the only way it works is if I call it inside init otherwise I have an error.
@ObservedObject var store = MyStore()
init(category: categoryModel) {
store.getData(categoryId: category.id) //here works
}
var body: some View {
store.getData(categoryId: category.id) //Here I will have the error: Type '()' cannot conform to 'View'
Why ? Thx
I am using SF symbols on my TabBar but even though I use the stroke version, it inserts the fill one.
ProductsListView()
.tabItem {
Image(systemName: "book")
Text("Products")
}
However, the image that shows up when I run the application in the book.fill
Why this could be happening?
Thx
I have a Loading view saying "Please wait" that I want to be presented until the data from the API comes back.
However, self.showLoading = false is executed even before store.getHomeItems() is finished.
How can I do it ?
struct HomeView: View {
@State var showLoading = false
...
if (self.showLoading == true) {
LoadingView()
} else {
//my content
}
...
ScrollView {
//my scroll content
}
.onAppear {
self.showLoading = true
DispatchQueue.main.async {
store.getHomeItems()
}
self.showloading = false
...
}
I also dont know if I can call Dispatch on my HomeView, since my API layer has also an another DispatchQueue.
URLSession.shared.dataTask(with: url) { (data, _, _) in
guard let data = data else { return }
let myItems = try! JSONDecoder().decode([ItemModel].self, from: data)
DispatchQueue.main.asyncAfter(deadline: .now() + 10) {
completion(myItems)
}
}
.resume()
Thank you
I have a picker on my view but it's not selectable unless I replace my VStack for a NavigationView.
However I cant have a NavigationView on this page, otherwise it brakes other parts.
What's the solution for that ?
Thx
VStack {
Picker
}
I have a button that when pressed should call an API which return an ID.
Then having this ID, I will call a 2nd API.
Button(action: {
var id = self.callApi1()
self.callApi2(id)
}) {
Text("Start")
}
How can I call the Api2 JUST when the Api1 was finished and returned its value ?
Thank you
I have an app where I am bringing some formatted text from the database.
The problem is when I use:
Text(myDataComingFromJson), of course, my text will be something like:
I've created an extension where I can remove the HTML tags but then all my text will be in only one paragraph and the lists won't exist ()
The second approach would use WKWebView but then I will have some headaches formatting text or loading extra views to do the job.
Question:
Is there a way to use Text directly, but keeping break lines and lists? Even though I have to change the content at the database level ?
I also have tried using \r\n in the database but still didn't work.
Is there a better solution?
Thank you all