I've got one problem in swift. In Objective-C I write like this:
return !item ? self.people.count : item.children.count
So, if item is nil it returns self.people.count, otherwise it returns item.children.count. How to write such thing in Swift?
return (item as? Person)?.children.count ?? self.people.count
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments