uicollectionviewcell

delete Single Core Data Item from a uicollectionviewCell using a button

蓝咒 提交于 2020-07-23 07:40:11
问题 I am trying to delete a single element of the coreData set using a button inside a collectionviewcell. So the cell has a label with the result of the core data fetch. When I hit the button it should delete the cell making it no longer appear. Also the the core data single set item should be perementley deleted. I have scence this used before in protocols but not using core data.The core data is var itemName. class CustomCell: UICollectionViewCell { @objc func delete() { }} class

delete Single Core Data Item from a uicollectionviewCell using a button

筅森魡賤 提交于 2020-07-23 07:39:19
问题 I am trying to delete a single element of the coreData set using a button inside a collectionviewcell. So the cell has a label with the result of the core data fetch. When I hit the button it should delete the cell making it no longer appear. Also the the core data single set item should be perementley deleted. I have scence this used before in protocols but not using core data.The core data is var itemName. class CustomCell: UICollectionViewCell { @objc func delete() { }} class

delete Single Core Data Item from a uicollectionviewCell using a button

社会主义新天地 提交于 2020-07-23 07:38:46
问题 I am trying to delete a single element of the coreData set using a button inside a collectionviewcell. So the cell has a label with the result of the core data fetch. When I hit the button it should delete the cell making it no longer appear. Also the the core data single set item should be perementley deleted. I have scence this used before in protocols but not using core data.The core data is var itemName. class CustomCell: UICollectionViewCell { @objc func delete() { }} class

UICollectionView doesn't scroll inside UITableViewCell

北城余情 提交于 2020-06-29 06:19:51
问题 I'm having an issue with UICollectionView scrolling inside UITableViewCell. Unfortunately, the CollectionView doesn't scroll at all. When I'm trying to disable other UITableViewCells it works without any problem and vice versa. CollectionViewCell: import UIKit class CategoriesCollectionViewCell: UICollectionViewCell { override init(frame: CGRect) { super.init(frame: frame) backgroundColor = .white layoutUI() } required init(coder adecoder: NSCoder) { fatalError("init(codeer:) has not been

Grid layout with CollectionView in Swift

北城以北 提交于 2020-06-24 00:44:47
问题 I would like to achieve this result: Searching around I found out that probably the way to do it is using UICollectionView , so no problem with that since there are many tutorials and questions on Stack Overflow. I have 3 questions: I cannot find anything about the "separators" (the line that divides all the boxes). I like that it doesn't touch the screen borders horizontally. Is it done programmatically? To divide the space equally in all devices (3 boxes/buttons horizontally) I found this

Swift 4 - Push a ViewController from a UICollectionView Cell

本秂侑毒 提交于 2020-04-30 16:37:41
问题 I'm stuck in my project and is in need for some help. I want to push/present a UICollectionViewController from a UICollectionViewCell including my UINavigationBar . I have understand that you can not actually present a ViewController from a Cell? How do I supposed to do in this case? My problem is that my NavigationBar won´t show up. Here is my Cell: import UIKit import Firebase class UserProfileHeader: UICollectionViewCell, UIImagePickerControllerDelegate, UINavigationControllerDelegate {

UICollectionViewCell is wrong width with label [duplicate]

杀马特。学长 韩版系。学妹 提交于 2020-03-22 12:43:31
问题 This question already has answers here : UICollectionViewLayout Not working with UIImage in Swift 5 and Xcode 11 (2 answers) Closed 2 days ago . I found something strange. I created a custom UICollectionViewCell and a label inside it. I applied auto-layout only to the top, leading, and bottom of the label. class TestCollectionViewCell: UICollectionViewCell { @IBOutlet weak var label: UILabel! override func awakeFromNib() { super.awakeFromNib() } } And if the text is long, it is clipped off

Uicollection view dynamic height but fixed width

与世无争的帅哥 提交于 2020-03-05 00:23:37
问题 I am working with UICollectionView I have 4 different kind of cells. Every cell is designed in xib file . when i load them in collection view it goes out of screen. i don't know why it is happening. Some cells have fixed height while some have dynamic height (depends on data coming from API). So is there any possible way to solve this issue. i have tried Estimate size automatic to dynamic override func awakeFromNib() { super.awakeFromNib() self.contentView

XCUITest - fail to find UICollectionView Cell and cell items

徘徊边缘 提交于 2020-03-04 21:33:16
问题 i have collection list of items cell , i wants to make UI test (XCUItest). But unable to find the element collection view cell and its elements inside it . UIViewController ---> UICollectionView ----> UICollectionViewCell -----> The element that I would like to get. func testProductListingPageLoad() { let collection = app.collectionViews["ProductList"] let element = collection.cells["ProductListItemCell0"].firstMatch XCTAssert(collection.exists) // it is successful XCTAssert(element.exists) /

What's wrong with register(_:forCellWithReuseIdentifier:) on UICollectionView?

霸气de小男生 提交于 2020-02-02 02:43:05
问题 I'm working with an UICollectionView . As dequeueReusableCell(withReuseIdentifier:for:) expects You must register a class or nib file using the register(_:forCellWithReuseIdentifier:) method before calling this method , I added a line in my viewDidLoad func as self.collectionView!.register(PhotoCollectionViewCell.self, forCellWithReuseIdentifier: reuseIdentifier) Now when I'm using the cell for dequeuing and configuring, I'm getting error and app crashes. fatal error: unexpectedly found nil