What do you want to save?
Add Code snippet
New code examples in category Swift
-
Lionel Aguero 2022-03-25 02:20:26
swift save data to file
let file = "file.txt" //this is the file. we will write to and read from it let text = "some text" //just a text if let dir = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first { let fileURL = dir.appen... Add solution -
A-312 2022-03-25 00:20:01
closure swift
// The basic closure syntax is: // { (parameter: Type) -> Type in <statements> } // // While closures can be assigned to a variable like in // the example below, they become much more useful once // they're passed into a function such as a list'... Add solution -
A-312 2022-03-19 12:45:01
swift uitextfield only numbers keyboard lock programmatically
class ViewController: UIViewController, UITextFieldDelegate { @IBOutlet weak var textField: UITextField! override func viewDidLoad() { super.viewDidLoad() // you can set the following two properties for the text field in Interfa... Add solution -
Phoenix Logan 2022-03-18 00:25:20
how to read music library from iphone programmatically in swift
// All let mediaItems = MPMediaQuery.songsQuery().items // Or you can filter on various property // Like the Genre for example here var query = MPMediaQuery.songsQuery() let predicateByGenre = MPMediaPropertyPredicate(value: "Rock", forProperty:... Add solution
Best helpers
Ranking is empty