2017-08-16 14 views

回答

1

試試這個:

contactsArray = unified.sorted { (a, b) -> Bool in 
    if a.name.isEmpty { 
     return false 
    } else if b.name.isEmpty { 
     return true 
    } else { 
     return a.name.localizedCaseInsensitiveCompare(b.name) == .orderedAscending 
    } 
}