SwiftUI - Custom Swipe Actions In List

后端 未结 3 726
一整个雨季
一整个雨季 2020-12-03 05:29

How can I use custom Swipe Actions in SwiftUI?

I tried to use the UIKit Framework to get these working in SwiftUI. But that doesn\'t work for me.

imp         


        
3条回答
  •  死守一世寂寞
    2020-12-03 05:57

    UPDATE

    As far as I can tell, the situation has not improved as of Xcode 12 beta 1 (released at WWDC 2020).

    ORIGINAL

    As of Xcode 11.3.1, SwiftUI doesn't support custom swipe actions for List items. Based on the history of Apple’s SDK evolution, we’re not likely to see support until the next major SDK version (at WWDC 2020) or later.

    You would probably be better off implementing a different user interface, like adding a toggle button as a subview of your list item, or adding a context menu to your list item.

提交回复
热议问题