How to convert Swift/ObjC methods to NativeScript

The last point of interest from RecordModel might be the save method, which will export our recording from the app's tmp directory to the app's documents folder while converting it to the smaller filesize .m4a audio format:

this._recorder.audioFile  .exportAsynchronouslyWithNameBaseDirExportFormatFromSampleToSampleCallback(    fileName, BaseDirectory.Documents, ExportFormat.M4a, null, null,     (af: AKAudioFile, err: NSError) => {      this.savedFilePath = documentsFilePath(fileName);  });

Long method name, right? Yes, indeed; some Swift/ObjC parameterized method names collapse to become very long. That particular method in Swift is defined as follows:

exportAsynchronously(name:baseDir:exportFormat:fromSample:toSample:callback:) ...

Get NativeScript for Angular Mobile Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.