[swift] How to check object is nil or not in swift?