how to get the dates in an array in ios swift : I have an array like ["2018-03-21 11:09:25","2018-03-22 11:09:25","2018-03-23 11:09:25","2018-03-24 11:09:25"]

I need to display only dates[2018-03-21] in this array. How to split this array?