In a tableview:

        let itemToDelete = people[indexPath.row]

    print(itemToDelete)

    if (editingStyle == UITableViewCellEditingStyle.delete) {
        // handle delete (by removing the data from your array and updating the tableview)

        persistenceService.context.delete(itemToDelete)
        self.people.remove(at: indexPath.row)

        do {
            try persistenceService.context.save()
        } catch let error as NSError {
            print("Error While Deleting: \(error.userInfo)")
        }


    }

In an alert view:

 let action = UIAlertAction(title: "Save", style: .default) { (_) in
            let name = alert.textFields!.first!.text!
            let age = alert.textFields!.last!.text!

//            fill container
            let person = Person(context: persistenceService.context)
            person.name = name
            person.age = Int16(age)!

//            save container
            persistenceService.saveContext()
            self.people.append(person)

        self.tableView.reloadData()

    }

Auf dem Git Server:

mkdir repository.git
cd repository.git
git init --bare

In Xcode9:

Rechtsklick -> Add Existing Remote

Source Control -> Push

Pfad nach folgendem Muster: user@192.168.1.2:/home/git/repository.git