Post

Replies

Boosts

Views

Activity

Reply to UIcollectionView with array no loading sections
Would need to test with complete code, to confirm. If you want to post an email for a short moment. But I would do setupViews() inside func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) - UICollectionViewCell { With present code, I suspect you do not set the labels of the cell you dequeue…
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’21
Reply to Splitting text into cards
I'll try to clarify so. There is a full text. I do think it would be better to let user scroll through the text than create different cards, but… If the design is for several cards, we need: To know what part of text will fit in the rect of the textField, Label, whatever it is. For the first card, one need to find what is the last word that can fit into the rect. Loop from first word to following words, compute what would be the needed rect to display (with func boundingRect), and continue as long we don't hit the end of text or exceed the size of available rect. When the loop ends, we get the subtext from first word to the last that fits. And put this text in the display zone   when user asks for next card, redo the same, but the new first word is the one just after last word of the previous card. Hope that's more clear…
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’21
Reply to Set an array of arrays inside of UICollectionView that's inside a UITableView and return the correct number of items?
What you need to do is populate both the tableViewCell and the collection inside. The mechanism to define a dataSource is the following: you declare the dataSource as self when you create the Collection then, it all occurs in     func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) - UICollectionViewCell { This dataSource function is defined in the class (which corresponds to the self above). So, when you create the tableView cell, you have to declare dataSource for the CollectionView    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) - UITableViewCell { seasonsCollectionView.dataSource = self Now, in  collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath)  you need to use the correct part of the array that contains all collections. Something like  cell.seasonsCollectionView.model = // Something the model should be of type episodess So, probably coming from a 2 dimension array of episodess, that correspond to: the tableView cell row (contained in its tag ?) where the collection is : that should give an array of episodess in this array, the episodess for the cellForItemAt indexPath.row Hope that helps.
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’21
Reply to Splitting text into cards
So, I was not the only one who was not understood. 😉 Did I explain myself incomprehensibly? somehow. As you do not explain what you don't understand. Did you look at the algorithm I proposed ? Did you try to implement (it requires basic Swift, not advanced UIKit or SwiftUI skills). I just don't really understand what the input is. Which input are you speaking about ? The input text you want to split ? The messages on the forum? Your answers are not clarifying your problem in anyway.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’21
Reply to Adding png to ImageView causes black screen
there's a size limit Yes, at least that is what I experienced for the launch screen. It may not be the pixel size only, but also the weight of the image. In a project, I did reduce from a few MB image to a few 100 kB and everything worked fine (and it did occupy the full screen, even on iPad). In addition, that is not a serious problem for a launch screen which appears only a very short time. Vary large images are no problem in "main storyboard" of course.
Mar ’21