Davide Giuseppe Farella
04/19/2020, 6:42 PMsquareup.okio
on the shared code? The doc uses File
which is only a jvm typeAmanjeet Singh
04/19/2020, 6:58 PMexpect
declarations in common module and then actual
declarations in iosMain
and androidMain
(jvm implementation).
For eg:
In common,
expect class FileUtils(path: String) {
fun readFile(): String
}
In androidMain,
actual class FileUtils actual constructor(path: String){
fun readFile() = File(path).readText()
}
In ioS main similarly,
you can do in actual NSString.stringWithContentsOfFile(
rootPath,
NSUTF8StringEncoding,
null
)
``````Davide Giuseppe Farella
04/19/2020, 7:17 PMAmanjeet Singh
04/19/2020, 7:40 PMactuals
.Davide Giuseppe Farella
04/19/2020, 8:14 PMAmanjeet Singh
04/19/2020, 8:39 PM