From the course: Moving Your iOS App to Android Using Kotlin

Unlock this course with a free trial

Join today to access over 22,400 courses taught by industry experts.

Extension imports

Extension imports

- [Instructor] The next thing to focus on is extensions from other classes, and this is a really simple concept here. We have this 08b_Extensions in a separate folder and I just wanted to show you what happens when we start working with extensions from other files. I'll create a new extension on Image. We'll call it "digitize," and I'll just have it return a string. It wants me to do an import for this, so this is my own image, and I'll just return a digitizing message. Going back to the extensions, Command + bracket will bring you back, and Command + forward bracket will bring you forward. We've come back into our example, and in here, I'll make another image. Var image2 is equal to a new image. I'll say it has width of 100, height of 100, and "some URL." What will happen sometimes... I'm going to cut these for a moment and just show you. If you come here and no code hinting comes up, if you hit Command + P, that will show you what arguments need to go in. Unfortunately, the code…

Contents