https://kotlinlang.org logo
Docs
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
ios
  • k

    Konstantin Petrukhnov

    04/24/2018, 3:43 PM
    Is there way to generate UUID on iOS and jre in kotlin?
    2 replies · 1 participant
  • d

    dany

    05/29/2018, 8:10 AM
    Hello everyone, I have an app using an Objective-C framework built from a Kotlin multi platform project. However Apple is recently refusing the app updates with the following message:
    >> Non-public API usage:
    The app contains or inherits from non-public classes in Frameworks/MyLib.framework/MyLib: NSBlock
    s
    5 replies · 2 participants
  • k

    Konstantin Petrukhnov

    05/31/2018, 10:21 AM
    Trying to compile code that works in jvm. Got next error: https://pastebin.com/MpP8g6aa
    g
    o
    16 replies · 3 participants
  • g

    galex

    06/20/2018, 8:01 PM
    Hello, how do I install what I need to develop a custom UIView ? I’ve got the basic setup ready (https://github.com/galex/chord-view-mpp), I don’t understand how to build the :lib:ios module into an UI iOS Component ?
    👍 1
    o
    1 reply · 2 participants
  • s

    salomonbrys

    10/10/2018, 1:53 PM
    Hey everyone. I need some help 😉 How can I get a
    String
    with the content of an
    NSData
    ? In swift, it would be:
    let datastring = String(data: fooData, encoding: NSUTF8StringEncoding)
    s
    2 replies · 2 participants
  • s

    salomonbrys

    10/10/2018, 3:39 PM
    (the framework is Pokedex_KMP.klib.framework)
    s
    2 replies · 2 participants
  • a

    Ana Stu

    11/16/2018, 10:57 AM
    hello! I've developed an Android app in Kotlin with the help of Android Studio, I want to make it available in iOS too, anyone with some experience could tell me how could I get started?
    o
    1 reply · 2 participants
  • d

    darkmoon_uk

    12/18/2018, 10:35 AM
    Trying to implement a
    UITableViewDataSource
    Protocol in pure Kotlin... The bridging seems to think I'm overriding a totally different method signature in the protocol, and so is throwing a compile error (on the return type). Is this expected? A bug? Workarounds exist with annotations?
    s
    9 replies · 2 participants
  • d

    darkmoon_uk

    12/18/2018, 5:38 PM
    What workflow are people using for Kotlin/iOS/Android in terms of IDE's? If I'm not mistaken, the iOS autocomplete is only currently working under IntelliJ, so it seems best to work mainly in IntelliJ and compile in Xcode.
    s
    1 reply · 2 participants
  • d

    darkmoon_uk

    12/18/2018, 5:39 PM
    Lack of support in AppCode latest version seems to suggest JB are working on a closer integration for next version? 🤞
    l
    1 reply · 2 participants
  • d

    darkmoon_uk

    12/18/2018, 9:45 PM
    Any Kotlin classes that I define which derive from ObjC (NSObject based) are not showing up in my Framework header - what am I doing wrong?
    s
    2 replies · 2 participants
  • o

    o.semen

    01/02/2019, 11:10 AM
    so, I ended up with such
    cinterops
    section
    fromPreset(presets.iosX64, 'ios') {
                compilations.main.outputKinds('FRAMEWORK')
                compilations.main {
                    cinterops {
                        firebase {
                            def pods = '${System.getProperty("user.home")}/Projects/kmpp/iosApp/Pods/'
                            includeDirs '${pods}Firebase/CoreOnly/Sources',
                                    '${pods}FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers'
                        }
                    }
                }
            }
    but it does not link anything
    c
    s
    +2
    8 replies · 5 participants
  • c

    coletz

    01/07/2019, 10:34 AM
    So I am trying to implement with kotlin/native the function
    String.format(format: String, vararg values: Any?)
    , which in objc should be
    [NSString stringWithFormat:@"%d:%02d", values];
    . So on k/n I tried using
    NSString.stringWithFormat()
    but it accepts only the
    format
    argument, I can't find how to insert the string that needs to be formatted. Not sure if I'm doing something wrong tbh
    s
    2 replies · 2 participants
  • g

    GarouDan

    02/09/2019, 9:56 PM
    Hi guys, I’m trying to build the starter android / ios project with kotlin but I’m getting an error like
    No such module 'app'
    I’ve already tried several variations and don’t work. It looks like the project is generating a main.framework instead of a app.framework. Either way I tried to change the references to main.framework to app.framework and then rename the folder inside the build/bin/ios/…. But I’m still with this error =/ How can I solve this problem and correctly build the project?
    s
    p
    6 replies · 3 participants
  • g

    gumil

    03/20/2019, 10:09 AM
    Anyone know the differences between the presets? iosX64 vs arm64 etc?
    g
    s
    18 replies · 3 participants
  • m

    Mohammadsss1

    03/21/2019, 10:55 PM
    I don’t know if my question weird, but is is possible to integrate a 3rd party library in Kotlin native (ex: Realm) and then use it as a common code for both iOS and Android?
    k
    6 replies · 2 participants
  • d

    Daniel Hauschildt

    03/24/2019, 5:24 PM
    Hi everyone. I tinkered around with kotlin native and ios/swift. Got it working properly with even Metal running. However, the roundtrip time compiling koltin, then linking and then compiling Swift code with ios is a lot longer than pure Swift development.
    o
    4 replies · 2 participants
  • d

    drofwarcs

    03/25/2019, 1:03 AM
    Was playing around with the updated K/N plugin for app code. Created a new project and was delighted to see...
    plugins {
        kotlin("multiplatform") version "1.3.30-eap-45"
        kotlin("xcode-compat") version "0.1"
    }
    and
    kotlin {
        xcode {
            setupFramework("KotlinNativeFramework")
        }
    }
    Is this expected to take the place of the
    packForXcode
    gradle tasks we have to create now? Any more info on what we can do with the
    xcode-compat
    gradle plugin?
    v
    l
    +1
    7 replies · 4 participants
  • m

    mben

    03/26/2019, 4:44 PM
    Hello, i have a question about .freeze() used in kotlin native is there any way to use in swift side? i have a problem with threads since i'm using a DispatchQueue.global().async to call one of my interactor (use of clean archi) functions and i need to freeze it before sending it to the queue
    o
    2 replies · 2 participants
  • g

    GarouDan

    04/10/2019, 12:00 AM
    I’m trying to build a mpp project with an iosX64 target but I’m receiving an error like this one:
    Bundle at path /Users/myUser/Library/Developer/CoreSimulator/Devices/DEVICE_NUMBER/data/Library/Caches/com.apple.mobile.installd.staging/temp.UblNHF/extracted/iosApp.app/Frameworks/main.framework did not have a CFBundleIdentifier in its Info.plist
    I did a research about this and they say this is related with a
    cocoapods
    gem, but I’m not really using something like this, the project, for now, is really simple, just some kind of a hello world. After a lot of attempts I was able to use
    iPhone 8
    but not
    iPhone Xr
    (but even with
    iPhone 8
    it doesn’t work always). Does someone know why this happens? PS.: I’m using
    outputKinds("framework")
    in my
    build.gradle.kts
    i
    v
    +2
    22 replies · 5 participants
  • g

    GarouDan

    04/13/2019, 9:36 PM
    Hi, I have a configuration like the following in my `build.gradle.kts`:
    kotlin {
        xcode {
            setupApplication("application")
        }
    }
    but my module name is something like
    myLongModuleName
    . What I’ve seen is that the generated output when running the
    buildForXcode
    task is something like
    myLongModuleName.kexe
    or
    myLongModuleName.kexe.dSYM
    . How could I change these output output names? Maybe for something like
    application.kexe
    ?
    s
    2 replies · 2 participants
  • m

    Mohammadsss1

    04/15/2019, 9:12 PM
    Can I use an iOS framework created from a MPP on production (App store) in a project with bitcode enabled? Will pass the review process?
    o
    2 replies · 2 participants
  • m

    Mohammadsss1

    04/16/2019, 2:40 PM
    Do MPP capable of building iOS frameworks without calling the build script (snippet) from Xcode? I mean by syncing the Gradle!
    s
    4 replies · 2 participants
  • m

    Mohammadsss1

    04/17/2019, 4:21 PM
    I have a framework named Salah exported from MPP for iOS which causes an exception when I call a
    fun
    inside it. I uploaded a release build to TestFlight. However, the crash report is missing the line and frame info. I am using Kotlin plugin 1.3.30 on Android studio
    s
    6 replies · 2 participants
  • m

    Mohammadsss1

    04/21/2019, 3:22 PM
    Hello, Can someone please direct me to a gradle script/MPP project that uses Apple lipo to create a fat framework. The purpose is to be able to use the same framework on a real device and simulator at the same time.
    s
    2 replies · 2 participants
  • d

    David

    04/29/2019, 3:20 PM
    I am trying to build an iOS-framework with the new multiplatform tools, but I have two issues: 1. Build a fat binary including arm32, arm64 and x64 architectures 2. Run unit tests on my code I have created a toy example (from the AppCode template code). What do I add to the gradle script to accomplish the above? Here is the basic gradle script:
    plugins {
        kotlin("multiplatform") version "1.3.30"
        kotlin("xcode-compat") version "0.1"
    }
    
    repositories {
        mavenCentral()
    }
    
    kotlin {
        xcode {
            setupFramework("MyFramework")
        }
    }
    The full code can be seen at: https://github.com/dtornqvist/KN-MyFramework
    1 reply · 1 participant
  • g

    galex

    05/01/2019, 4:29 AM
    Hello, is there an equivalent of our beloved kotlin let function in Swift?
    d
    3 replies · 2 participants
  • j

    Jared

    05/08/2019, 7:32 PM
    Can someone point me to a Kotlin iOS tutorial?
    l
    k
    2 replies · 3 participants
  • m

    Mohammadsss1

    05/13/2019, 10:34 PM
    Hello, I know that we can hook with Kotlin framework from Xcode using the new Cocoapods plugin inside the pod file like this :
    pod 'Shared', :path => '/Users/.../Shared'
    However, can we deploy it remotely? so anyone can benefit and build it it directly inside any iOS project? Something like
    pod 'Alamofire', '4.7.3'
    s
    j
    4 replies · 3 participants
  • j

    JoakimForslund

    05/28/2019, 1:04 PM
    Why is shouldAutorotate missing from UIViewController? Is there another way to tell a viewcontroller written in kotlin how rotation should behave?
    s
    8 replies · 2 participants
Powered by Linen
Title
j

JoakimForslund

05/28/2019, 1:04 PM
Why is shouldAutorotate missing from UIViewController? Is there another way to tell a viewcontroller written in kotlin how rotation should behave?
s

svyatoslav.scherbina

05/28/2019, 2:39 PM
It is not missing. This category member is naturally imported as an extension.
j

JoakimForslund

05/28/2019, 2:53 PM
Hmm, is there an example for this?
s

svyatoslav.scherbina

05/28/2019, 3:09 PM
Example for what?
j

JoakimForslund

05/28/2019, 3:21 PM
On how to setup a shouldAutorotate override
for a viewcontroller
s

svyatoslav.scherbina

05/28/2019, 3:25 PM
This category member is naturally imported as an extension.
You can’t override an extension in Kotlin.
j

JoakimForslund

05/28/2019, 3:41 PM
Allright, so there is no way to implement so that a view controller is locked into for example portrait in kotlin? Sorry I'm not really getting it
s

svyatoslav.scherbina

05/29/2019, 8:10 AM
There is no way to override
shouldAutorotate
in Kotlin. Not sure whether it is the same. Likely depends on your particular use case.
View count: 15