swift - syntax, == operator when not in if statement. -


i came across line of code

let shouldexpandwindow = self.itemsoffset + self.items.count == self.windowoffset + self.windowcount 

i'm not used seeing == outside of if statement. know it's meant comparisons. how work in case. thank

== function takes 2 values of same type (such int) , returns bool. example, if comparing 2 ints, function signature is:

func ==(lhs: int, rhs: int) -> bool 

the result of comparison assigned shouldexpandwindow swift infers have type bool.

you can find out option-clicking on ==:

enter image description here


Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -