Example 1: ihow to find ios apps online
[{"sale_id": "11","item_id": "7","description": "","serialnumber": "","line": "1","quantity_purchased": "1.000","item_cost_price": "15.00","item_unit_price": "20.00","discount": "0.00","discount_type": "0","item_location": "1","print_option": "0","name": "KIkk Siyau salsa de soya","category": "Condiment","item_type": "0","stock_type": "0"},{"sale_id": "11","item_id": "2","description": "","serialnumber": "","line": "2","quantity_purchased": "1.000","item_cost_price": "2.00","item_unit_price": "5.00","discount": "0.00","discount_type": "0","item_location": "1","print_option": "0","name": "Sausages","category": "Meats","item_type": "0","stock_type": "0"},{"sale_id": "11","item_id": "4","description": "","serialnumber": "","line": "3","quantity_purchased": "1.000","item_cost_price": "3.00","item_unit_price": "0.00","discount": "0.00","discount_type": "0","item_location": "1","print_option": "0","name": "Pancake Mix","category": "pastry","item_type": "0","stock_type": "0"},{"sale_id": "11","item_id": "1","description": "","serialnumber": "","line": "4","quantity_purchased": "1.000","item_cost_price": "5.00","item_unit_price": "6.00","discount": "0.00","discount_type": "0","item_location": "1","print_option": "0","name": "Doritos","category": "Snacks","item_type": "0","stock_type": "0"},{"sale_id": "11","item_id": "957","description": "","serialnumber": "","line": "5","quantity_purchased": "1.000","item_cost_price": "7.50","item_unit_price": "5.50","discount": "0.50","discount_type": "0","item_location": "1","print_option": "0","name": "Grace Chicken Vienna Sausages 140g","category": "Canned Goods","item_type": "0","stock_type": "0"}]
Example 2: building an ios file browser
// Create a new document.
func documentBrowser(_ controller: UIDocumentBrowserViewController,
didRequestDocumentCreationWithHandler importHandler: @escaping (URL?, UIDocumentBrowserViewController.ImportMode) -> Void) {
os_log("==> Creating A New Document.", log: .default, type: .debug)
let doc = TextDocument()
let url = doc.fileURL
// Create a new document in a temporary location.
doc.save(to: url, for: .forCreating) { (saveSuccess) in
// Make sure the document saved successfully.
guard saveSuccess else {
os_log("*** Unable to create a new document. ***", log: .default, type: .error)
// Cancel document creation.
importHandler(nil, .none)
return
}
// Close the document.
doc.close(completionHandler: { (closeSuccess) in
// Make sure the document closed successfully.
guard closeSuccess else {
os_log("*** Unable to create a new document. ***", log: .default, type: .error)
// Cancel document creation.
importHandler(nil, .none)
return
}
// Pass the document's temporary URL to the import handler.
importHandler(url, .move)
})
}
}