# sealed interface

Published articles for sealed interface.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## How to correctly implement Pull-to-refresh on mobile

DevFeed: [How to correctly implement Pull-to-refresh on mobile](<https://devfeed.tech/articles/how-to-correctly-implement-pull-to-refresh-on-mobile-39368.md>)

Original publisher: [Read original article](<https://kt.academy/article/pull-to-refresh>)

Published: 2026-07-13T00:00:00Z

Content type: tutorial

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [Mobile](<https://devfeed.tech/topics/mobile.md>), [Compose](<https://devfeed.tech/topics/compose.md>), [ui](<https://devfeed.tech/topics/ui.md>), [App](<https://devfeed.tech/topics/app.md>)

Tags: [compose](<https://devfeed.tech/tags/compose.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [implement](<https://devfeed.tech/tags/implement.md>), [mobile](<https://devfeed.tech/tags/mobile.md>), [screen](<https://devfeed.tech/tags/screen.md>), [sealed-interface](<https://devfeed.tech/tags/sealed-interface.md>), [ui](<https://devfeed.tech/tags/ui.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

This tutorial explains how to implement pull-to-refresh for mobile screens that load data. It recommends keeping previously loaded data visible during refresh, showing errors without discarding existing data, and choosing an appropriate refresh control for empty states. It also demonstrates state representations and reusable loading logic in Compose.

### Source excerpt

One of the most important pattern on mobile, and how to implement it.

## Sealed Types

DevFeed: [Sealed Types](<https://devfeed.tech/articles/sealed-types-25064.md>)

Original publisher: [Read original article](<https://typealias.com/start/kotlin-sealed-types/>)

Author: author@typealias.com (Dave Leeds)

Published: 2024-01-16T00:00:00Z

Content type: tutorial

Language: en

Sources: [Dave Leeds on Kotlin - typealias.com](<https://devfeed.tech/sources/dave-leeds-on-kotlin-typealias-com.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [interfaces](<https://devfeed.tech/topics/interfaces.md>)

Tags: [classes](<https://devfeed.tech/tags/classes.md>), [enum](<https://devfeed.tech/tags/enum.md>), [exhaustive](<https://devfeed.tech/tags/exhaustive.md>), [exhaustive-matching](<https://devfeed.tech/tags/exhaustive-matching.md>), [interfaces](<https://devfeed.tech/tags/interfaces.md>), [introduction](<https://devfeed.tech/tags/introduction.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [learn-to-program](<https://devfeed.tech/tags/learn-to-program.md>), [programming](<https://devfeed.tech/tags/programming.md>), [sealed](<https://devfeed.tech/tags/sealed.md>), [sealed-class](<https://devfeed.tech/tags/sealed-class.md>), [sealed-interface](<https://devfeed.tech/tags/sealed-interface.md>), [subtype](<https://devfeed.tech/tags/subtype.md>), [types](<https://devfeed.tech/tags/types.md>), [when-conditional](<https://devfeed.tech/tags/when-conditional.md>), [when-expression](<https://devfeed.tech/tags/when-expression.md>)

### AI overview

A tutorial chapter explains how Kotlin sealed interfaces and classes restrict the set of possible types, helping ensure that all possibilities are handled in a when expression.

### Source excerpt

In Chapter 5, we saw how limiting our options can be a good thing. In that chapter, we used enum classes to limit our values, which allows Kotlin to ensure that we account for all possibilities in a when expression. We can get a similar benefit for our types by using sealed interfaces and classes. In this chapter, we'll visit Cecil's Ice Shop to learn all about sealed types. Let's get started!

## Sealed classes and interfaces in Kotlin

DevFeed: [Sealed classes and interfaces in Kotlin](<https://devfeed.tech/articles/sealed-classes-and-interfaces-in-kotlin-39339.md>)

Original publisher: [Read original article](<https://kt.academy/article/kfde-sealed>)

Published: 2023-09-04T00:01:00Z

Content type: tutorial

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [sealed class](<https://devfeed.tech/topics/sealed-class.md>), [sealed interface](<https://devfeed.tech/topics/sealed-interface.md>), [interface](<https://devfeed.tech/topics/interface.md>), [abstract class](<https://devfeed.tech/topics/abstract-class.md>), [Inheritance](<https://devfeed.tech/topics/inheritance.md>), [Polymorphism](<https://devfeed.tech/topics/polymorphism.md>)

Tags: [inheritance](<https://devfeed.tech/tags/inheritance.md>), [interface](<https://devfeed.tech/tags/interface.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [polymorphism](<https://devfeed.tech/tags/polymorphism.md>), [sealed](<https://devfeed.tech/tags/sealed.md>), [sealed-classes](<https://devfeed.tech/tags/sealed-classes.md>), [sealed-interface](<https://devfeed.tech/tags/sealed-interface.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

This Kotlin tutorial explains sealed classes and sealed interfaces as restricted hierarchies whose direct subclasses are controlled. It contrasts them with regular interfaces and abstract classes, describes their package and module requirements, and explains their use in exhaustive expressions.

### Source excerpt

What are sealed classes and interfaces in Kotlin and how do we use them.

## Class Modifiers in Dart: Sealed, Interface, Base

DevFeed: [Class Modifiers in Dart: Sealed, Interface, Base](<https://devfeed.tech/articles/class-modifiers-in-dart-sealed-interface-base-23989.md>)

Original publisher: [Read original article](<https://quickbirdstudios.com/blog/flutter-dart-class-modifiers/>)

Author: Marvin März

Published: 2023-06-23T11:29:43Z

Content type: tutorial

Language: en

Sources: [QuickBird Studios Blog](<https://devfeed.tech/sources/quickbird-studios-blog.md>)

Topics: [Dart](<https://devfeed.tech/topics/dart.md>), [Object-oriented programming (OOP)](<https://devfeed.tech/topics/oop.md>)

Tags: [abstract-class](<https://devfeed.tech/tags/abstract-class.md>), [class](<https://devfeed.tech/tags/class.md>), [classes](<https://devfeed.tech/tags/classes.md>), [dart](<https://devfeed.tech/tags/dart.md>), [flutter](<https://devfeed.tech/tags/flutter.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [interface](<https://devfeed.tech/tags/interface.md>), [oop](<https://devfeed.tech/tags/oop.md>), [pattern-matching](<https://devfeed.tech/tags/pattern-matching.md>), [post](<https://devfeed.tech/tags/post.md>), [sealed](<https://devfeed.tech/tags/sealed.md>), [sealed-interface](<https://devfeed.tech/tags/sealed-interface.md>)

### AI overview

This tutorial explains Dart 3 class modifiers, including the newly introduced sealed, interface, final, and base modifiers and changes to existing modifiers. It describes how modifiers control whether classes can be extended, mixed in, constructed, or implemented, and discusses their practical use cases.

### Source excerpt

With Dart 3 the class modifiers sealed, interface, final and base were introduced into the Dart language. They also updated how existing ones work. In this article, we show you why this change was made and how those new modifiers work. The post Class Modifiers in Dart: Sealed, Interface, Base appeared first on QuickBird Studios.

## How to implement Swift-friendly API with Kotlin Multiplatform Mobile

DevFeed: [How to implement Swift-friendly API with Kotlin Multiplatform Mobile](<https://devfeed.tech/articles/how-to-implement-swift-friendly-api-with-kotlin-multiplatform-mobile-23904.md>)

Original publisher: [Read original article](<https://medium.com/icerock/how-to-implement-swift-friendly-api-with-kotlin-multiplatform-mobile-e68521a63b6d?source=rss----b74ae24564e---4>)

Author: Aleksey Mikhailov

Published: 2021-08-07T16:49:33Z

Content type: tutorial

Language: en

Sources: [IceRock Development - Medium](<https://devfeed.tech/sources/icerock-development-medium.md>)

Topics: [Kotlin Multiplatform](<https://devfeed.tech/topics/kotlin-multiplatform.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Swift](<https://devfeed.tech/topics/swift.md>), [Mobile](<https://devfeed.tech/topics/mobile.md>), [enum](<https://devfeed.tech/topics/enum.md>), [Code](<https://devfeed.tech/topics/code.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [Gradle](<https://devfeed.tech/topics/gradle.md>)

Tags: [compiler](<https://devfeed.tech/tags/compiler.md>), [enum](<https://devfeed.tech/tags/enum.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [implementation](<https://devfeed.tech/tags/implementation.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-multiplatform](<https://devfeed.tech/tags/kotlin-multiplatform.md>), [kotlin-multiplatform-mobile](<https://devfeed.tech/tags/kotlin-multiplatform-mobile.md>), [kotlin-native](<https://devfeed.tech/tags/kotlin-native.md>), [mobile](<https://devfeed.tech/tags/mobile.md>), [sealed-interface](<https://devfeed.tech/tags/sealed-interface.md>), [swift](<https://devfeed.tech/tags/swift.md>)

### AI overview

This tutorial explains how Kotlin Multiplatform Mobile exposes Kotlin APIs to Swift through generated Objective-C APIs. It demonstrates usability issues with sealed interfaces at the Kotlin-Swift boundary and introduces IceRock's MOKO KSwift Gradle plugin, which analyzes Kotlin/Native library metadata to generate a more convenient Swift API.

### Source excerpt

Kotlin Multiplatform Mobile allows you to compile Kotlin code into native libraries for Android and iOS. If in the case of Android the library obtained from Kotlin will be integrated with an application written in Kotlin, then for iOS the integration will be with Swift. There is a loss of usability at the junction of Kotlin and Swift, due to the difference in languages. This is mainly because the Kotlin/Native compiler (which compiles Kotlin in the iOS framework and is part of the Kotlin Multiplatform) generates the public API of the framework in ObjectiveC. We access Kotlin from Swift through this generated ObjectiveC API, since Swift interacts with ObjectiveC. Further, I will show examples of API waste at the Kotlin-Swift junction and a tool that allows you to get a more convenient API for usage from Swift. Let's look at the example of using a sealed interface in Kotlin: sealed interface UIState<out T> { object Loading : UIState<Nothing> object Empty : UIState<Nothing> data class Data<T>(val value: T) : UIState<T> data class Error(val throwable: Throwable) : UIState<Nothing> } This is a convenient construct to describe states, which is actively used in the Kotlin code. Let's see how it looks from the Swift side. public protocol UIState { }public class UIStateLoading : KotlinBase, UIState { }public class UIStateEmpty : KotlinBase, UIState { }public class UIStateData<T> : KotlinBase, UIState where T : AnyObject { open var value: T? { get } }public class UIStateError : KotlinBase, UIState { open var throwable: KotlinThrowable { get } } From the Swift side Kotlin's sealed interface looks like a set of classes with a common protocol. Of course, in this case, one cannot hope to check the completeness of the switch implementation, since it is not an enum. For developers familiar with Swift, the enum is considered a more correct analog of the sealed interface, for example: enum UIState<T> { case loading case empty case data(T) case error(Error) } We can write such an enum