var viewSize = Double(viewersView.frame.size.width)
var itemSize = Double(boxSize + viewerHorizontalPadding)
self.maxViewers = floor(viewSize / itemSize) //should be Int
I get an error that says:
No "floor" candidates produce expected contextual result type "Int"
I imported Darwin.
floor
takes a Double and returns another Double. If you want it to be an Int (to match self.maxViewers
, you must convert it explicitly: Int(floor(viewSize / itemSize))
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With