Swift Snippet: selectively update object from an optional new value

Ankit Aggarwal
HackerNoon.com
1 min readJan 18, 2017

--

Following operator can be used to update object from new optional value.This can be used when we do not want object to get updated to nil from new optional value.

Frequently used when mapping server response since we do not get all params in every response and by using this operator we do not have to check for all non optionals value again and again.

Usage

--

--