writing digem in ios