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
From the course: Moving Your iOS App to Android Using Kotlin
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
Lambdas7m 12s
-
Exceptions6m 29s
-
Interfaces4m 1s
-
Interface conflicts4m 45s
-
Classes: Properties1m 44s
-
Classes: Constructors4m 12s
-
Types of classes3m 15s
-
Inheritance: Functions2m 30s
-
Inheritance: Properties2m 49s
-
Enums5m 36s
-
Generics5m 24s
-
Extension basics4m 26s
-
Extension imports2m 24s
-
Extension Collisions2m 45s
-
Working with Java: Marshalling types2m 18s
-
Working with Java: In Kotlin2m 39s
-
Working with Java: From Kotlin3m 16s
-
-
-
-
-