Skip to content

Commit

Permalink
Opt-in to BetaInteropApi for NSData.create
Browse files Browse the repository at this point in the history
  • Loading branch information
joffrey-bion committed Feb 17, 2024
1 parent 7d9e604 commit f1f31d2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fun ByteString.toNSData(): NSData = unsafeBackingByteArray().toNSData()
* Creates a new [NSData] containing the data copied from this [ByteArray].
*/
@InternalKrossbowIoApi
@OptIn(ExperimentalForeignApi::class, UnsafeNumber::class)
@OptIn(ExperimentalForeignApi::class, UnsafeNumber::class, BetaInteropApi::class)
private fun ByteArray.toNSData(): NSData = memScoped {
NSData.create(bytes = allocArrayOf(this@toNSData), length = this@toNSData.size.convert())
}
Expand Down

0 comments on commit f1f31d2

Please sign in to comment.