|
Hello everyone! I added a title for each of my sections. But when a section is empty, the tittle doesn't disappear. Here is my code.
|
|
TooMas asks:
You pasted an awful lot of code, but much of it has nothing to do with your question. At times like this, it might be useful to Step Away from your Project! Instead, concentrate on the function you want with a small project. This is a great job for Experiment with options! Please return and let us know how you solved this!
|
|
Thank you for your answer :) Maybe I didn't make myself clear. In the task of the 38th day, we created an application in which we add our expenses. I would like the title of the section to appear when a new expense is added. And disappeared when the section became empty. I would like to do this without using "isOn" I hope you can understand me. English is not my forte |
|
Toomaa clarifies his question:
Your use case depends on the state of your data model. Do you have expenses or not? You can answer this question by asking your expenses array if it is EMPTY. Then you make a decision to SHOW the section if the DO NOT create a
|
SAVE 50% All our books and bundles are half price for Black Friday, so you can take your Swift knowledge further without spending big! Get the Swift Power Pack to build your iOS career faster, get the Swift Platform Pack to builds apps for macOS, watchOS, and beyond, or get the Swift Plus Pack to learn advanced design patterns, testing skills, and more.
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.