ios - Trying to sum number in if statement with swift -


just start using swift , it's getting on nervs.. how fix that? (i've read few answer still didn't got work)

could not find overload '+' accepts supplied arguments 

this i'm doing:

var currentlayoutattributes: uicollectionviewlayoutattributes = attributestoreturn[i] var previouslayoutattributes: uicollectionviewlayoutattributes = attributestoreturn[i - 1] var maximumspacing = 50 var origin = cgrectgetmaxx(previouslayoutattributes.frame) if origin + maximumspacing + currentlayoutattributes.frame.size.width < self.collectionviewcontentsize().width {  } 

the error occurred in if statment

you can't add cgfloat , int. origin cgfloat , maximumspacing integer.

easiest fix be: var maximumspacing: cgfloat = 50


Comments