Convert some Obj-C to Swift