My app crashes in specific parts and I am trying to identify why.
I am using Instruments - Leaks but when I access this problematic part of the app, the app crashes and nothing is shown.
What would be the best tool under Instruments umbrella to check these crashes?
Thanks
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I have an array with 10 different categories.
So I create NavigationLink for each of them, calling MyListView and passing data about the category.
NavigationView {
List(categories) { category in
NavigationLink(destination:
MyListView(category: category)
)
{
CategoryRow(category: category)
}
}
}
So when I click in one of these 10 categories, I will call MyListView. Inside MyListView I have a call to the API bringing a lot of information about the chosen category.
The problem here is, even before clicking in any category, MyListView is being called and the API is called for all the 10 categories.
I only want to call MyListView and the API inside it, after selecting the category.
Whats the problem here ?
Thx
When I use TabView and select a TabItem, a chosen View will open right away.
TabView {
HomeView()
.tabItem {
Image(systemName: "house")
Text("Home")
}
}
Now I am trying to do the same, using button.
However with button, the chosen View will open under .sheet or .fullScreenCover.
Button(text) {
self.isPresented.toggle()
}
.sheet(isPresented: $isPresented) {
self.content
}
How can I open the View using button, the same way it's opened using TabBar ?
Thx
I have a TabBar with 5 different views for each TabBar item.
All these 5 views have long content wrapped in a ScrollView.
So let's say I chose my 2nd TabBar item and scroll on this view.
Then I move away to another view and when I hit the 2nd TabBar item again, I want this view scrolled to the top and not at the position I left on the first visualization.
How can I do that?
Thx
I am trying to change the navigation bar background color of my view.
Init() {
let coloredAppearance = UINavigationBarAppearance()
//coloredAppearance.configureWithTransparentBackground()
//It doesnt matter what I use in here, it continues the same
coloredAppearance.backgroundColor = UIColor(red: 202.0/255.0, green: 52.0/255.0, blue: 86.0/255.0, alpha: 1.0)
coloredAppearance.titleTextAttributes = [.foregroundColor: UIColor.white]
UINavigationBar.appearance().standardAppearance = coloredAppearance
UINavigationBar.appearance().compactAppearance = coloredAppearance
UINavigationBar.appearance().scrollEdgeAppearance = coloredAppearance
UINavigationBar.appearance().tintColor = .white
However if you get the red, green, blue, and alpha used above, you will see the color is being shown slightly different on the NavigationBar.
What's the reason for that ?
Thx
I have a form and at the end of it, a button.
Form {
Section {
} //close section
button
} //close form
However, the button is appearing surrounded by white space, like inside a textbox.
What's the reason for that?
I have a TabBar with 8 items.
And as everybody knows, more than 5 makes the 5th item the MORE button and it's perfect.
The problem is when I hit it, the button just blinks.
If I hit again, then the other options are shown.
Why ?
Thx
I have a TabBar with 3 items:
Home
ScrollView
Products
NavigationView
Users
NavigationView
When clicking on the tabBar buttons, I will go back to the related view. However, at the point where I had left.
I would like to every time I move to a different tab, it starts fresh like 1st time.
a) If it's a scrollview, after coming back to the tab I would like the view scrolled to the top.
b) If it's a navigationView, after coming back to the tab, I would like to scroll to the top and move to the Navigation root list.
How can I do it.
Thx folks