<commit_before>//
//  TableViewController.swift
//  Test
//
//  Created by Socialbit - <NAME> on 14.02.15.
//  Copyright (c) 2015 socialbit. All rights reserved.
//

import UIKit
import SwiftAddressBook

class TableViewController: UITableViewController {

    
    var groups : [SwiftAddressBookGroup]? = []
    var people : [SwiftAddressBookPerson]? = []
    var names : [String?]? = []
    var numbers : [Array<String?>?]? = []
    var birthdates : [NSDate?]? = []
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        swiftAddressBook?.requestAccessWithCompletion { (b :Bool, _ :CFError?) -> Void in
            if b {
                
                //to test adding a new person uncomment the following 
                /*
                var person = SwiftAddressBookPerson.create()
                person.firstName = "newTestuserFirstname"
                person.lastName = "newTestuserLastname"
                person.organization = "newTestuserCompanyname"
                
                var phone = MultivalueEntry(value: "newTestuserNumber", label: "mobile", id: 1)
                person.phoneNumbers = [phone]
                
                swiftAddressBook?.addRecord(person)
                swiftAddressBook?.save()

                */

                self.people = swiftAddressBook?.allPeople
                
                //to test adding a new group uncomment the following<commit_msg>improved add person example in sample project with address adding and multivalue label constants<commit_after>//
//  TableViewController.swift
//  Test
//
//  Created by Socialbit - <NAME> on 14.02.15.
//  Copyright (c) 2015 socialbit. All rights reserved.
//

import UIKit
import SwiftAddressBook
import AddressBook

class TableViewController: UITableViewController {

    
    var groups : [SwiftAddressBookGroup]? = []
    var people : [SwiftAddressBookPerson]? = []
    var names : [String?]? = []
    var numbers : [Array<String?>?]? = []
    var birthdates : [NSDate?]? = []
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        swiftAddressBook?.requestAccessWithCompletion { (b :Bool, _ :CFError?) -> Void in
            if b {
                
                //to test adding a new person uncomment the following 

				/*
                var person = SwiftAddressBookPerson.create()
                person.firstName = "newTestuserFirstname"
                person.lastName = "newTestuserLastname"
                person.organization = "newTestuserCompanyname"
                
                var phone = MultivalueEntry(value: "newTestuserNumber", label: "mobile", id: 1)
                person.phoneNumbers = [phone]

				var addresses : Array<MultivalueEntry<Dictionary<SwiftAddressBookAddressProperty,AnyObject>>>? = nil
				let address1 = [SwiftAddressBookAddressProperty.street:"testStreet" as AnyObject, SwiftAddressBookAddressProperty.city:"testCity"];
				let address2 = [SwiftAddressBookAddressProperty.street:"testStreet2" as AnyObject, SwiftAddressBookAddressProperty.city:"testCity2"];
				addresses = [MultivalueEntry(value: address1, label: kABWorkLabel, id: 0),MultivalueEntry(value: address2, label: kABHomeLabel, id: 0)];

				person.addresses = addresses;
                
                swiftAddressBook?.addRecord(person)
                swiftAddressBook?.save()
				*/


                self.people = swiftAddressBook?.allPeople
                
                //to test adding a new group uncomment the following
{'fraction_non_alphanumeric': 0.0966183574879227, 'fraction_numerical': 0.008525149190110827, 'mean_word_length': 2.1941923774954626, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1689859', 'n_tokens_mistral': 1003, 'n_tokens_neox': 892, 'n_words': 226}