ios version, replace tab with space and some code adjustment