 import CoreData
 
 public class TCoreDataManager: NSObject {
+    
     public private(set) var defaultContext: NSManagedObjectContext = NSManagedObjectContext(concurrencyType: .mainQueueConcurrencyType)
     
     public private(set) var nameDB: String

        self.defaultContext = self.managedObjectContext(name: self.nameDB)
    }
    
    public func updateContext(managedObjectContext: AnyObject?) {
        if let context = managedObjectContext as? NSManagedObjectContext {
            self.defaultContext = self.managedObjectContext(name: self.nameDB, managedObjectContext: context)
            self.saveContext()
        }
    }
    
    
    private func managedObjectModelWithName(name: String) -> NSManagedObjectModel {

        return urls[urls.count-1]
    }
    
    public init(dbName name: String, sqliteName: String = "SingleViewCoreData", drop: Bool = false) {
        
        self.nameDB = name
        self.sqliteName = sqliteName + ".sqlite"
        
        super.init()
        
        if drop {
            print("""
!!!!!!!!!!!!!!!!!!!!!!!!!


    Drop Core Data



!!!!!!!!!!!!!!!!!!!!!!!!!
""")
            tLog("")
            tLog("!\n\n\n\n\n")
            tLog("!!!!!!!!!!!!!!!!!!!!!!!!!")
            self.drop()
        }
        
        self.defaultContext = self.managedObjectContext(name: name)
    }
