//
//  File.swift
//  Collegian
//
//  Created by Parsa Bagheri on 6/2/21.
//  Copyright © 2021 Parsa Bagheri. All rights reserved.
//

import Foundation
import UIKit

func createTextPost(name: String, imageData: Data?, text: String) -> TextPost {
    let coreDataContext = (UIApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext
    let tp = TextPost(context: coreDataContext)
    tp.date = Date()
    tp.image = imageData
    tp.name = name
    tp.text = text
    return tp
}
