Converting app to SWIFT