Posts

Post marked as solved
6 Replies
6.1k Views
Hi, I'm setting a collection View in order to display content as instagram Profile view with all the photos in the grid.in order to set the layout I'm using some delegate methods of UIcollectionviewDelegateFlowLayout . When you open the project, the collectionView works well with the grid set well. The problem occurs when you scroll down very fast the collectionView so that you make momentaneously disappear all the cells. In that exact moment all the cell layout I've set before doesn't hold and the images become ultra zoomed and one on top of each other.I don't know how to fix this issue.Also in the compiler I get this error :the item width must be less than the width of the UICollectionView minus the section insets left and right values, minus the content insets left and right values.Please check the values returned by the delegate.The relevant UICollectionViewFlowLayout instance is <UICollectionViewFlowLayout: 0x7fbbe972d1f0>, and it is attached to <UICollectionView: 0x7fbbeb056400; frame = (0 0; 414 896); clipsToBounds = YES; autoresize = RM+BM; gestureRecognizers = <NSArray: 0x60000203c4e0>; layer = <CALayer: 0x600002ef19c0>; contentOffset: {0, 424}; contentSize: {414, 16048}; adjustedContentInset: {88, 0, 83, 0}; layout: <UICollectionViewFlowLayout: 0x7fbbe972d1f0>; dataSource: <InstagramClone.ProfileViewController: 0x7fbbe9708890>>.
Posted
by guala.
Last updated
.
Post not yet marked as solved
1 Replies
291 Views
Hello everyone,I am new in this Forum and I would like to be active in it in order to help and be helped.My problem is this one :I have to create a Dictionary in Xcode that has a Key Value (type : String) and the associated value is an Array of Class called 'Food', practically it is an Array of instances of that type of class. In particular this Class has only one property, that is the name (String).class Food { var name : String }I have to set the Dictionary in order to assign to every key value (for example "sweet", "meat" and "fish") the determined Array of type 'Food' that will contain all the possible istances of the Classes Food with already set the name of themI don't know how to implement this concept inside the code.I've tryed in this way :var foodlist = [String : [Food]] ()Then I don't know how to instantiate the different cell of the array Food for every key value. I try to do this in my own way but It always doesn't work. He returns Errors, so surely is written in a wrong way
Posted
by guala.
Last updated
.