uicollectionview

How to Save Data and Segue Back to Collection View?

社会主义新天地 提交于 2020-01-06 16:17:26
问题 tl;dr: I'm having trouble figuring out how to segue from my NewTransactionViewController back to my main CollectionViewController and when going back, adding the data from the NewTransactionViewController into my collection list view. What I've found online is either too basic for what I need or too sophisticated. Essentially I'm trying to mimic a UITableView but I'm using collections for more dynamic capabilities later on (plus I want the option of multiple columns). I'm new to programming

How to Save Data and Segue Back to Collection View?

最后都变了- 提交于 2020-01-06 16:17:02
问题 tl;dr: I'm having trouble figuring out how to segue from my NewTransactionViewController back to my main CollectionViewController and when going back, adding the data from the NewTransactionViewController into my collection list view. What I've found online is either too basic for what I need or too sophisticated. Essentially I'm trying to mimic a UITableView but I'm using collections for more dynamic capabilities later on (plus I want the option of multiple columns). I'm new to programming

URL array throwing optional error swift

岁酱吖の 提交于 2020-01-06 07:14:00
问题 I am not sure how to resolve the optional type error that occurs at "if let imageURL = imageFile.path" in my code below. The error it throws is "Initializer for conditional binding must have Optional type, not 'String'" After googling, I'm guessing it has something to do with the directoryContentsArray = URL I set at the beginning of my CollectionViewController class. Please help! P.S. Sorry for the repeat optional error question, but I'm super confused :/ class CollectionViewController:

How to get Cell title from external data source for UICollectionView

喜你入骨 提交于 2020-01-06 06:09:28
问题 I currently have a view where I display a collectionView with some categories. I followed this post to get my collectionView to properly load display data. I got that working just fine. My issue is that now I need to be able to get the text from whichever cell the user selects to use within my search bar. My current code: class SearchViewController: ButtonBarPagerTabStripViewController, UISearchBarDelegate{ let headerId = "sectionHeader" let categoriesId = "categoriesId" lazy var searchBar:

Loading data into UICollectionView bunch by bunch

回眸只為那壹抹淺笑 提交于 2020-01-06 05:56:25
问题 I am building an chat app and I have a problem with the collection view. In my app I just want to do something like whatsapp, in starting I load the first 50 messages and when we scroll down then want to fetch other messages bunch by bunch. But when I doing this and call the collection view reloadData method then it scroll to the top message. And I don't want they scrolling. Can you help me. Please.. I just simply want to make the collectionView similar to whatsapp's chat view.. i.e. load

How to show three columns in a CollectionView using swift4 in all devices

杀马特。学长 韩版系。学妹 提交于 2020-01-06 05:41:10
问题 func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { if collectionView == self.collectionViewVideo { var collectionViewSize = collectionViewVideo.frame.size collectionViewSize.width = collectionViewSize.width/3.0 //Display Three elements in a row. return collectionViewSize } else { return CGSize(width: 60, height: 60) } } 回答1: You also need to take space in account. Space is your collection

CollectionView, TableView registered classes for reuse identifiers

笑着哭i 提交于 2020-01-06 05:03:51
问题 I want to know which classes are registered with a UITableView or a UICollectionView with reuse identifiers is it possible to find this info? I've checked the class references and didn't find anything. I wanted to unregister certain classes from the tableview in order to replace them with other classes. I know i can just change the reuse identifier, however, I'd like to know if there is a way to get the registered classes/nibs of these objects 回答1: It seems to be reuse identifier is married

CollectionView, TableView registered classes for reuse identifiers

ぐ巨炮叔叔 提交于 2020-01-06 05:03:09
问题 I want to know which classes are registered with a UITableView or a UICollectionView with reuse identifiers is it possible to find this info? I've checked the class references and didn't find anything. I wanted to unregister certain classes from the tableview in order to replace them with other classes. I know i can just change the reuse identifier, however, I'd like to know if there is a way to get the registered classes/nibs of these objects 回答1: It seems to be reuse identifier is married

How to change UICollectionView zIndex?

霸气de小男生 提交于 2020-01-06 04:21:07
问题 Check the image below. I need to highlight the focused cell such that it is above all the cells in collectionView . I know I have to change the zIndex of the focused cell. How to do that? I need the logic. My code is in objective-c . This is for tvOS but iOS code will also work here I guess. 回答1: Have you tried setting value for cell.layer.zPosition ? 回答2: Try manually applying layer.zPosition to be the zIndex in applyLayoutAttributes: method of UICollectionViewCell subclass: - (void

Pass touches on some part of UICollectionView to underlying views

心已入冬 提交于 2020-01-05 16:52:26
问题 First take a look at the attacthed image: My hiearchy looks as following: UIView UIButton UICollectionView UICollectionViewCell UICollectionViewCell UICollectionViewCell UICollectionViewCell UICollectionView is added to UIVew as H:[collectionView(==270)]| and V:|-(70)-[collectionView]-(70)-| . I have two requirements: 1) only the blue part of the UICollectionViewCell should trigger the collectionView::didSelectItemAtIndexPath: method. Which I have sucesfully implemented with - (UIView *