e143bcd030
On iOS 26+, Menu bottom sheets now morph from their trigger button using UIViewController.preferredTransition = .zoom. This creates a fluid visual connection between the trigger and the presented sheet, complementing the Liquid Glass design language. The sourceViewTag prop is also available on the generic Dialog/BottomSheet layer so any dialog can opt into the zoom transition. https://claude.ai/code/session_011cNDhEb2cDgg5QbVuzEyH1
52 lines
1.2 KiB
Swift
52 lines
1.2 KiB
Swift
import ExpoModulesCore
|
|
|
|
public class BottomSheetModule: Module {
|
|
public func definition() -> ModuleDefinition {
|
|
Name("BottomSheet")
|
|
|
|
AsyncFunction("dismissAll") {
|
|
SheetManager.shared.dismissAll()
|
|
}
|
|
|
|
View(SheetView.self) {
|
|
Events([
|
|
"onAttemptDismiss",
|
|
"onSnapPointChange",
|
|
"onStateChange"
|
|
])
|
|
|
|
AsyncFunction("dismiss") { (view: SheetView) in
|
|
view.dismiss()
|
|
}
|
|
|
|
AsyncFunction("updateLayout") { (view: SheetView) in
|
|
view.updateLayout()
|
|
}
|
|
|
|
Prop("cornerRadius") { (view: SheetView, prop: Float) in
|
|
view.cornerRadius = CGFloat(prop)
|
|
}
|
|
|
|
Prop("minHeight") { (view: SheetView, prop: Double) in
|
|
view.minHeight = prop
|
|
}
|
|
|
|
Prop("maxHeight") { (view: SheetView, prop: Double) in
|
|
view.maxHeight = prop
|
|
}
|
|
|
|
Prop("preventDismiss") { (view: SheetView, prop: Bool) in
|
|
view.preventDismiss = prop
|
|
}
|
|
|
|
Prop("preventExpansion") { (view: SheetView, prop: Bool) in
|
|
view.preventExpansion = prop
|
|
}
|
|
|
|
Prop("sourceViewTag") { (view: SheetView, prop: Int?) in
|
|
view.sourceViewTag = prop
|
|
}
|
|
}
|
|
}
|
|
}
|