Posts

Post marked as solved
3 Replies
0 Views
We are seeing this as well. Have you been able to find any workarounds?
Post not yet marked as solved
3 Replies
0 Views
We’re you on iOS 13.1 or iOS 13? I just upgraded to the latest 13.1 beta and it started working. Maybe it’s an issue just on 13.0?
Post not yet marked as solved
28 Replies
0 Views
I am seeing the same behavior. I submitted a bug report: FB7216407
Post not yet marked as solved
8 Replies
0 Views
I've been in contact with Apple about the issue but no official fix yet. There is an open radar to address this issue. We have found one workaround. First, make sure you set self.contentView.translatesAutoresizingMaskIntoConstraints = false. You will also need to override preferredLayoutAttributesFitting with the following code: override open func preferredLayoutAttributesFitting(_ layoutAttributes: UICollectionViewLayoutAttributes) -> UICollectionViewLayoutAttributes { if #available(iOS 12.0, tvOS 12.0, *) { /* In iOS 12, there are issues with self-sizing cells. The fix is to call updateConstraintsIfNeeded() and turn on translatesAutoResizingMaskIntoConstraints as described in Apples release notes: "You might encounter issues with systemLayoutSizeFitting(_:) when using a UICollectionViewCell subclass that requires updateConstraints(). (42138227) — Workaround: Don't call the cell's setNeedsUpdateConstraints() method unless you need to support live constraint changes. If you need to support live constraint changes, call updateConstraintsIfNeeded() before calling systemLayoutSizeFitting(_:)." */ self.updateConstraintsIfNeeded() return super.preferredLayoutAttributesFitting(layoutAttributes)
Post not yet marked as solved
27 Replies
0 Views
Has anyone tried Xcode 10.1 beta to see if l this is resolved?
Post not yet marked as solved
2 Replies
0 Views
Post not yet marked as solved
27 Replies
0 Views
Unfortunately nothing so far. I submitted a bug report and posted a spindump. The bug was then duped and is still open. Hoping the GM seed tomorrow solves the issue.
Post not yet marked as solved
4 Replies
0 Views
I am seeing the same behavior on beta 10. Any ideas?
Post not yet marked as solved
6 Replies
0 Views
Ah that's perfect! Is there a similar method to get the array of AudioChannelLabel's for the Layout? I couldn't find one but maybe I'm looking in the wrong place.
Post not yet marked as solved
6 Replies
0 Views
@Polyphonic - How would you recommend dynamically figuring out how many channels are in a particular kAudioChannelLayoutTag (and also the associated kAudioChannelLabel's)? Previously, UseChannelDescriptions allowed us to easily support a wide range of layouts. However, the only option I see now is to hardcode the mapping for each kAudioChannelLayoutTag. Is that correct? How would we be able to handle new tags that may appear in future iOS versions? Also, is there a current list of the tags that may be returned in iOS? For example, I expected kAudioChannelLayoutTag_StereoHeadphones to be returned when I plugged in headphones but that wasn't the case.Thanks in advance!
Post not yet marked as solved
9 Replies
0 Views
Is there a way to file a bug against iOS 12 specifically? I filed it against iOS + SDK / UIKit last week but still haven't heard back on it.
Post not yet marked as solved
9 Replies
0 Views
Yeah you definitely could be correct, I'm certainly no expert. My understanding was the following:1. apply(:) - A chance for the cell to take custom layoutAttributes and apply them to the cell. The default implementation does nothing so my thinking is this is just for custom use cases.2. preferredLayouAttributesFitting(:) - This is the last chance for anyone to modify the layoutAttribute before the base attributes are applied to the cell. To me, this is the biggest clue that autolayout can run here - if the system provides a mechanism to change the layoutAttribute one more time, I would think this is where the autolayout calculation gets run. I actually just looked at instruments on iOS 12 simulator and it does still call systemLayoutSizeFittingSize (https://www.dropbox.com/s/2w0dnvr29tjt7i1/Screen%20Shot%202018-08-21%20at%2012.54.10%20PM.png?dl=0 ). However, the new size doesn't seem to be applied to the attribute...I definitely agree it would be great to get an answer from Apple. Any suggestions on how to contact someone who can help? I noticed TSI tickets are not available for pre-release software.
Post not yet marked as solved
9 Replies
0 Views
Interesting - that's not how I understood the lifecycle of self-sizing cells. My understanding was the following:1. layoutAttributesForElements(in:) is called to get the default layout attributes2. UICollectionViewCell.applyLayoutAttributes is then called on the cell to apply any custom layout attributes. This gets called immediately after the cell has been added to the UICollectionView according to the documentation:// Classes that want to support custom layout attributes specific to a given UICollectionViewLayout subclass can apply them here. // This allows the view to work in conjunction with a layout class that returns a custom subclass of UICollectionViewLayoutAttributes from -layoutAttributesForItem: or the corresponding layoutAttributesForHeader/Footer methods. // -applyLayoutAttributes: is then called after the view is added to the collection view and just before the view is returned from the reuse queue. // Note that -applyLayoutAttributes: is only called when attributes change, as defined by -isEqual:. - (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes;3. UICollectionViewCell.preferredLayoutAttributesFittingAttributes is called. This allows the cell to modify the default attributes for a given cell. My understanding was the default implementation of this used autolayout to calculate the final size. I actually saw this when using instruments to see stack traces on iOS 11.4. The UICollectionViewCell is given their size based on the final attribute returned in preferredLayoutAttributesFittingAttributes.The timing of these methods works out - it just seems like the default implementation of preferredLayoutAttributesFittingAttributes doesn't make the autolayout calculation. @QuinceyMorris - for self-sizing cells using autolayout, when is the calculation was done? In a few WWDC presentations, they say self-sizing cells using autolayout is supported.
Post not yet marked as solved
9 Replies
0 Views
Thank you for your help! I uploaded the sample project here if you want to take a look: https://www.dropbox.com/s/tkm82yu20yn4d3s/TestCV.zip?dl=0. Sorry for not specifying - I'm talking about UICollectionView self-sizing cells. I set the width constraint dynamically in UICollectionViewCell.applyLayoutAttributes (you can see that in TestCollectionViewCell).
Post not yet marked as solved
8 Replies
0 Views
Has anyone heard from Apple on this issue? I am having the same issue on my project.