        var orderedContacts: [String: [CNContact]] = [String: [CNContact]]()
        CNContact.localizedString(forKey: CNLabelPhoneNumberiPhone)
        fetchRequest.mutableObjects = false
        fetchRequest.unifyResults = true
        fetchRequest.sortOrder = .givenName
        do {
            try contactStore.enumerateContacts(with: fetchRequest, usingBlock: { (contact, _) -> Void in
                // Ordering contacts based on alphabets in firstname
                var key: String = "#"
                // If ordering has to be happening via family name change it here.
                let firstLetter = contact.givenName.count > 0 ? contact.givenName[0] : " "//contact.givenName[0..<1]
                if firstLetter.containsAlphabets {
                    key = firstLetter.uppercased()
                }
                var contacts = [CNContact]()