spierce7
07/09/2018, 10:39 PMspierce7
07/09/2018, 10:48 PMthymecypher
07/10/2018, 2:08 AMMohit Gurumukhani
07/10/2018, 3:01 AMfun call() : Unit{
var url = NSURL.alloc()
url = url?.initWithString("<https://jsonplaceholder.typicode.com/posts/1>")
var nsrequest = NSMutableURLRequest(url as NSURL)
nsrequest.HTTPMethod = "GET"
var this_nsdata : NSData? = null
var this_nsresponse : NSURLResponse? = null
var this_nserror : NSError? = null
var syncer = dispatch_semaphore_create(0)
var sess = NSURLSession.sharedSession()
var task = sess.dataTaskWithRequest(nsrequest) { nsdata: NSData?, nsresponse: NSURLResponse?, nserror: NSError? ->
this_nsdata = nsdata
this_nsresponse = nsresponse as NSHTTPURLResponse
this_nserror = nserror
dispatch_semaphore_signal(syncer)
}
task.resume()
dispatch_semaphore_wait(syncer, DISPATCH_TIME_FOREVER)
if(this_nserror == null && this_nsdata != null){
this_nsresponse as NSHTTPURLResponse
var nsstrobj = NSString.stringWithUTF8String(this_nsdata!!.bytes as CPointer<ByteVar>)
print(nsstrobj as String)
}
else {
print("whoops")
}
}
mcastiblanco
07/10/2018, 7:00 AMorg.jetbrains.kotlin:kotlin-native-gradle-plugin:0.8
but keep getting the error Could not find org.jetbrains.kotlin:kotlin-native-shared:0.8
. Attaching full stack of the error...musachev
07/10/2018, 4:19 PMbipin
07/10/2018, 6:38 PMRxKotlin
in Kotlin-Native
common module?yusuf3000
07/11/2018, 1:25 PMsuspend
keyword.
If you use the suspend keyword, then all methods that call this method also need to be marked with suspend. Which means that the method that is called from the iOS side is marked with suspend. But when I compile the kotlin framework using konan, the methods vanish from the Obj-c framework.
Is this because coroutines are experimental? Will this be supported?
I’ve got an example project where you can see this happening: https://github.com/yusufcareem/MockKNProjectspierce7
07/11/2018, 8:48 PMOther important JetBrains-provided libraries, like kotlinx.coroutines, kotlinx.serialization, and Ktor HTTP client are getting experimental Kotlin/Native support, which means it is possible to write an iOS app and Android application sharing the same REST API-related logic.
I don't see kotlin/native access for these libraries. Do I need to access special branches? My team actually wants to start using the kotlin/native counterparts for all of these.Seri
07/11/2018, 9:14 PMspierce7
07/12/2018, 2:58 AM@Frozen
class AtomicInt(private var value: Int = 0) {
// ...
}
If you have a var
in a frozen object, how can you still mutate the value of that var
? I thought it was unchangeable after it is frozen. What am I misunderstanding?bipin
07/12/2018, 7:07 AMe5l/http-client-common
bipin
07/12/2018, 7:48 AMawesome-kotlin-native
repo, please contribute it to make curated list of mutliplatform libs, resources.
https://github.com/bipinvaylu/awesome-kotlin-nativeAregev2
07/12/2018, 8:31 AMString
to a C function?Dmitry Kandalov
07/12/2018, 12:14 PMenleur
07/12/2018, 2:02 PMlsk
07/12/2018, 3:22 PMsrc/kotlin/main.kt:36:38: error: type _MDP_NOTIFY_TYPE is not supported in callback signature
-> this probably meanas that I have too complex enum class as a parameter in the callback function. I want to know what’s not supported on the enum and if it is suppose to be fixed sooncaffeine
07/12/2018, 10:42 PMobject Foo {
var counter = 0
class Bar {
init {
//counter++// << this line
}
}
}
fun main(args: Array<String>) {
//NOP
}
if delete "//" on marked line, then compiler throw exceptionDominaezzz
07/13/2018, 6:39 PMthevery
07/13/2018, 8:02 PMMohit Gurumukhani
07/14/2018, 12:09 AMNikolai
07/14/2018, 7:32 AMAregev2
07/14/2018, 11:02 AMString.format
be available in native?spierce7
07/15/2018, 6:29 PMthevery
07/15/2018, 6:36 PMspierce7
07/15/2018, 6:46 PMval windowInfoList = CGWindowListCopyWindowInfo(kCGWindowListOptionAll, kCGNullWindowID)!!
windowInfoList
is of type CFArrayRef
, and no matter what I do I can't figure out how to use it / get at the items in the array. Any help would be appreciated. Here is the documentation for the function: https://developer.apple.com/documentation/coregraphics/1455137-cgwindowlistcopywindowinfomcastiblanco
07/16/2018, 12:19 AMCould not find org.jetbrains.kotlin:kotlin-native-shared:0.8.
was that my project was using gradle 4.7
. It seems that K/N 0.8
requires 4.8.1
, at least for multiplatform projectsspierce7
07/16/2018, 1:06 AMnapperley
07/16/2018, 2:55 AMDmitry Kandalov
07/16/2018, 8:27 AMkotlin.collections
🤔)Dmitry Kandalov
07/16/2018, 8:27 AMkotlin.collections
🤔)elizarov
07/16/2018, 8:35 AMDmitry Kandalov
07/16/2018, 8:45 AMelizarov
07/16/2018, 8:47 AMArrayDeque
(both K/N and JS) for this use-case. See https://youtrack.jetbrains.com/issue/KT-21327