uicollectionviewcell

Inserting a New Cell Into A UICollectionView

瘦欲@ 提交于 2019-12-24 11:51:39
问题 I’m trying to add in a new cell into my collection view, only if it has more than one item already in it. I have no worked much with collection views, and research in the docs and this site had not helped solve this issue yet. So, on my cellForItemAtIndexPath method, I do a check to see if it is populated. If not, I add the cell, like so: - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { if (self.myArray.count != 0) { return self

UICollectionView and push to detailViewController using Parse

断了今生、忘了曾经 提交于 2019-12-24 11:44:50
问题 I use the tapGesture method to pouch the image from UICollectionView to detailViewController viewController.h as follows: #import <Parse/Parse.h> @interface CardsViewController : UIViewController <UICollectionViewDelegateFlowLayout> { NSMutableArray *allImages; NSArray *cardFileArray; } @property (weak, nonatomic) IBOutlet UICollectionView *imageCollection and viewController.m as the follow - (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView { return 1; } -

Perform a segue selection from a uicollectionview that is embedded in a tableview cell?

删除回忆录丶 提交于 2019-12-24 09:19:02
问题 Currently we have a uicollectionview that is embedded in a tableview cell. When the collection view cell is selected it's suppose to initiate a push segue to another view controller. The problem is there is no option to perform the segue on the cell. Is there a way around it? Here is the cell: class CastCell : UITableViewCell { var castPhotosArray: [CastData] = [] let extraImageReuseIdentifier = "castCollectCell" let detailToPeopleSegueIdentifier = "detailToPeopleSegue" var castID: NSNumber?

How do I show a UITableView within a UICollectionViewCell

时光怂恿深爱的人放手 提交于 2019-12-24 08:21:31
问题 I am a new Swift programmer and I am currently working on a very simple to-do-list application. The catch is that I want to display a not-to-do list as well. Additionally, I am attempting to do this all through code. I want the user to be able to scroll horizontally between 2 CollectionViewCells, that each have a TableView within them displaying a 'To Do List' and a 'Not To Do List'. So far I have a ViewController that creates a UICollectionView that has 2 custom cells that each fills up the

iOS UICollectionView: Cells not showing

巧了我就是萌 提交于 2019-12-24 04:35:08
问题 I'm missing something obvious here as this isn't a difficult task. I have my Collection view in storyboard (amongst other views), with the prototype cell's reuse id being "Cell", and a UILabel in that cell, with a tag of 100. The code (boilerplate): - (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView { return 1; } - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { return 4; } - (UICollectionViewCell *

Is there any way to know which collection view cell is at a specific point?

梦想与她 提交于 2019-12-24 01:51:35
问题 I have a CGPoint and I would like to know which cell from my collection view currently contains that point. Is there any simple way to do this or do I have to write my own method? 回答1: I haven't used UICollectionView s much, but there's a method that seems perfect: - (NSIndexPath *)indexPathForItemAtPoint:(CGPoint)point; The point you pass to the method has to be within the coordinate system of the collection view. You can do: CGPoint convertedPoint = [collectionView convertPoint:point

How to use a detail disclosure button in UICollectionViewCell?

走远了吗. 提交于 2019-12-24 00:44:20
问题 I am trying to use the detail disclosure button on the view controller pictured below (PhotoSearchViewController) to show a UIAlertController that shows the photo description from the ImageUrlItem. When I click the button, it shows that it was pressed, but the alert containing the description does not appear. My code for the ImageUrlItem: import Foundation import Firebase struct ImageUrlItem { //Should I add my description in here? let key: String let imageUrl: String let

AVPlayer inside of UICollectionViewCell stops playing when app enters background

我们两清 提交于 2019-12-23 18:51:11
问题 I have a local video file playing in a loop using AVPlayerLooper but whenever I press the home button (app enters background) and then reopen the app, the video has stopped playing. I also have an AVPlayerLooper inside of a simple view and not a collectionViewCell. To solve the issue on this view I simply call player.play() inside of applicationDidBecomeActive() . This does not work for the collectionViewCell. Have tried removing playerLayer before the app enters the background and adding it

How to dynamically add labels and buttons in section header of UICollectionView?

给你一囗甜甜゛ 提交于 2019-12-23 15:57:46
问题 Please help me how I can add labels horizontally and similarly buttons horizontally but each button should align at down of each label like a another section. This should happen dynamically in the header of the UICollectionView as the number of labels and buttons is according to my data. I want to make a excel kind of layout and in header I want to show the above controls. Thanks in advance! I have done this- - (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView

Custom cell with UITableView inside UICollectionViewCell

倖福魔咒の 提交于 2019-12-23 15:38:44
问题 I have a custom UICollectionViewCell for a UICollectionView. I have marked this custom class as UITableViewDataSource and UITableViewDelegate in order to put UITableView in each cell of Collection view. The table view is rendering properly in each cell of collection view but the issue is with the data in those table view header and cells. Example: I have 10 questions with 5 to 6 options for each question. I have kept number of items in collection view as count of questionList which creates