UICollectionViewFlowLayout does not correctly apply minimumInterItemSpacing and minimumLineSpacing for a horizontal scrolling grid

Originator:bblaukopf
Number:rdar://47732322 Date Originated:1/2/2019
Status:Open Resolved:
Product: Product Version:
Classification: Reproducible:
 
Area:
UIKit

Summary:
Reproduce using the attached project.

Steps to Reproduce:
1) Open attached project. Notice that the storyboard sets minimumInterItemSpacing to 10, and minimumLineSpacing to 50. 

2) Build and run in the simulator or on device

3) Note each cell is of identical size, and that horizontal spacing is 50pt and vertical spacing is 10pt.

4) Edit ViewController.m and comment out line 41 #define USE_IDENTICAL_SIZES

5) Build and run in the simulator or on device.

6) Notice that horizontal spacing has reduced to 10pt, while vertical spacing has increased to >50pt. 

7) Edit Main.storyboard and make the  minimumInterItemSpacing 50 and minimumLineSpacing 10.

8) Build and run in the simulator or on device.

9) Note that the cell spacing now matches 3).


Note 

Expected Results:

The spacing of cells at step 3) and step 6) should be identical while step 9) should differ.

Actual Results:

Spacing of cells at step 3) and 6) is different while step 9) matches step 3).

Version/Build:

As attached.

Configuration:

Xcode 10.1 (10B61). 
OS X 10.14.2.

Simulator used was iPhone SE, device used was iPhone SE running 12.1

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!