Convert data manager to swift