Skip to content

Commit

Permalink
Fix using .navigationDestination with subclasses and enums with
Browse files Browse the repository at this point in the history
associated types
  • Loading branch information
aabewhite committed Aug 26, 2024
1 parent b1abb0a commit bdf628b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Sources/SkipUI/SkipUI/Containers/Navigation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ import androidx.navigation.navArgument
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import kotlin.reflect.full.superclasses
import kotlinx.coroutines.delay
#endif

Expand Down Expand Up @@ -669,7 +670,7 @@ struct NavigationDestination {
return false
}
guard let destination = destinations[type] else {
for supertype in type.supertypes {
for supertype in type.superclasses {
if navigate(to: targetValue, type: supertype as? Any.Type) {
return true
}
Expand Down

0 comments on commit bdf628b

Please sign in to comment.