What does this mean when an extra chain is used on the left side of the assignment operator? Is the application damaged if the optional variable is zero?
eg.
// cell is a UITableViewCell cell.textLabel?.text = "Test"
As a short-circuit operator &&that stops when it reaches the first false value, the extra chain stops when it reaches the first nil value.
&&
, , container?.cell?.textLabel?.text = "foo", , textLabel . - , . , .
container?.cell?.textLabel?.text = "foo"
, @gregheo :
, . nil, .
nil
It will act as optional, you can set it as a string or zero. None of them will cause the application to crash if you do not expand your variable without catching if it is zero when it is zero. If anything in your chain is optional, your whole chain (or at least everything after the optional)
Source: https://habr.com/ru/post/1677244/More articles:Looking for an extensible table view to convert my JSON tree structure - iosstr .__ getlice__ does not work as expected, with a negative stop - pythonСписок группировки в Map <Пол, Деньги> - javaAssigning an optional variable in swift 3.0 using? operator returns nil - swiftModernization 2.3.0 Error creating signed APK - androidZoneId and LocalDateTime - javaВозможно ли изменение конфигурации кворума Hazelcast динамически? - hazelcastHow to convert png file to xml resource used by Android? - androidAcrylic imitation in a Win32 application - windowsSpring: how to change runtime interface implementations - javaAll Articles