Create a PDF (or other visible format like .docx) from CoreData using swift

Description

Hello! Therefore, I save several lines of user input in CoreData using several subclasses of NSManagedObject. Since the application is actually a machine check, it is necessary to print / email the information received by the client in a somewhat structured format. Below you will find photos / examples of how I save data. Please be kind to me because it is my birthday <3

Code examples

Below is an example of how I save information. In this example, the CoreData object is "CrawlerThree" and the data is crawlerDistance.

@IBAction func save(_ sender: AnyObject) {
    let appDel:AppDelegate = (UIApplication.shared().delegate as! AppDelegate)
    let context:NSManagedObjectContext = appDel.managedObjectContext
    let entity1 = NSEntityDescription.insertNewObject(forEntityName: "CrawlerThree", into:context) as NSManagedObject as! CrawlerThree
    entity1.crawlerDistance = distance.text

}

, , . , , , . , , CoreData, , - .

! !

+4
1

.

  • PDF

, , Core Data , .

, , : UIView, UITableView .. PDF, , (Swift) UIView PDF iOS?

+1

Source: https://habr.com/ru/post/1649076/


All Articles