Some convenient Swift extensions.