data class SponsorItemResponseImpl( override val id: Int, override val name: String, override val url: String, override val image: String ) : SponsorItemResponse アノテーションを付ける
ElementType.Type) -> Single<ElementType> { return Single<ElementType>.create { observer in self.invokeOnCompletion { cause in if let cause = cause { observer(.error(cause)) return KotlinUnit() } if let result = self.getCompleted() as? ElementType { observer(.success(result)) return KotlinUnit() } • asSingle()はKotlinx_coroutines_core_nativeDeferredに対する extension functionになっている
ElementType.Type) -> Single<ElementType> { return Single<ElementType>.create { observer in self.invokeOnCompletion { cause in if let cause = cause { observer(.error(cause)) return KotlinUnit() } if let result = self.getCompleted() as? ElementType { observer(.success(result)) return KotlinUnit() } Deferred#invokeOnCompletionを呼び出すことで Coroutinesを起動できる • asSingle()はKotlinx_coroutines_core_nativeDeferredに対する extension functionになっている
actual fun apiEndpoint(): String = BuildConfig.API_ENDPOINT iOS data/api-impl/src/iosMain/kotlinDebug/ /ApiEndpoint.kt internal actual fun apiEndpoint(): String = “https://.../api” data/api-impl/src/iosMain/kotlinRelease/ /ApiEndpoint.kt internal actual fun apiEndpoint(): String = “https://.../api”