Post

Replies

Boosts

Views

Activity

Reply to Set an array of arrays inside of UICollectionView that's inside a UITableView and return the correct number of items?
yes all of then are global Well, frankly saying, you may need a lot more emojis which looks more severe. I often say to developers who say themselves as beginners, if you need effort to keep two or more arrays consistent, it is an indication of bad design and you should re-organize your code. You should better avoid using globals just for data passing. And you are still using non-Capitalized name for structs, that is making your code harder to read. Anyway, you have multiple UICollectionViews in each UITableView, so each UICollectionView needs to have own its dataSource. Only one global modelOfSeason would never work appropriately for multiple UICollectionViews. I will try to find how to fix your code with minimum modification, but it may take long. By the way, this thread is being too heavy for the Safari of my old MacBook Air. Maybe too many Code block (`) is not good for Safari, please try Text attachment` next time.
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’21
Reply to How do I wrap the viewDidLoad function?
Actually, I don't understand the answers well. Then you should better stay in the original thread until you are confident enough that your issue is solved. When you think the problem is solved, mark the right answer as SOLVED. You may find another issue when one problem solved, in such case you should better start a new thread.
Topic: UI Frameworks SubTopic: UIKit Tags:
Mar ’21
Reply to Splitting text into cards
First of all, please clarify what you want to do. You should better show some example inputs: the text and title comes from the Internet. And output examples for each input, what sort of cards will be shown? (Frankly, I do not understand why device size would affect.) Frankly, Claude31's first reply is too difficult even for me, so it is quite reasonable you do not understand it well. But if it would be the right direction to achieve what you want, you may need to learn it, even if it may take very long time. (Simply saying, writing an app would not be so simple.) So, I recommend you to clarify what you want to achieve. That will help both you and us to judge whether the proposed solution would be the right way to go, or not.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’21
Reply to UICollectionView - Changing UI of one specific cell causes changes for every fifth cell
Add var favorite: Bool parameter to my struct.  When the data of a tweet is fetched from JSON, set favorite's default value to false.  When the button addToFavorite is pushed, toggle favorites value to true and save that object with some persistence manager, Then, every time data is fetched again for the same user to get his/her tweets, do a check if the tweet exists in persistence manager with the favorite parameter set to true, and if it does, set its UI accordingly? Seems to be a possible implementation.
Topic: UI Frameworks SubTopic: UIKit Tags:
Mar ’21
Reply to Adding png to ImageView causes black screen
So I conclude that there's a size limit (or some similar issue) to launch screen images. Is there? Very likely. I could have reproduced the black screen issue with my 3024x4032 jpg. I do not know if this is a known issue or documented somewhere, but, in fact, I use a full screen image of size 1242x2688 jpg in my recent project and it shows fine. Thanks for finding this and sharing your experience.
Mar ’21
Reply to Core Data Make Decodable
I can show you the method but I will have to remove the API key. Thanks for showing additional code, and it's OK I do not need API key. But what I want is context. In which class you defined the method? Please show whole definition of the class, including the definitions of all related properties and methods.
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’21
Reply to Core Data Make Decodable
Seems you do not think PlayersVC or cPlayerArr is related... OK, I can guess, just that makes me spend more time.         let decoder = JSONDecoder()         let appDelegate = UIApplication.shared.delegate as! AppDelegate //- Intentionally using forced casting.         decoder.userInfo[.managedObjectContext] = appDelegate.persistentContainer.viewContext
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’21