But you presumably know the width (i.e. the CollectionView width minus any
insets), and you can calculate the height based on that with NSString or
NSAttributedString boundingRect functions. Assuming you have a subclass for
your CollectionViewCell, you can add a method to return your cell height
Where I work we have spent a fair amount of trying unsuccessfully to get
self-sizing collection view cells to work as described by Apple documentation
with UICollectionViews that have any sort of complexity. I would suggest trying
to implement the sizeForItemAtIndexPath delegate method to see if
You might find this site helpful:
http://useyourloaf.com/blog/swift-string-cheat-sheet/
> On Sep 2, 2016, at 2:08 AM, Gerriet M. Denkmann wrote:
>
> How to translate this into Swift (current version, i.e. the one before 3.0):
>
> UITextView *uitv = …
> NSRange selectedRange = uitv.selectedRan
If I understand correctly, simply unchecking the “Is Initial Controller”
checkbox for the viewController in the Storyboard should fix your problem.
> On Nov 26, 2015, at 5:27 AM, Roland King wrote:
>
> I would like to create the main viewcontroller in my
> applicationDidFinishLaunching:withOpt