Migrating code from Objective-C to Swift