SwiftUI: NavigationDestinationLink deprecated

前端 未结 5 527
有刺的猬
有刺的猬 2020-12-01 09:54

After installing Xcode 11 beta 5 this morning, I noticed that NavigationDestinationLink was deprecated in favor of NavigationLink.

Also, t

5条回答
  •  死守一世寂寞
    2020-12-01 10:44

    The solution is to create custom back button for your detail view and pop detail view manually.

    .navigationBarItems(leading:
                    Button(action: {
                        self.showDetail = false
                    }) {
                        Image(systemName: "chevron.left").foregroundColor(.red)
                            .font(.system(size: 24, weight: .semibold))
                        Text("Back").foregroundColor(.red)
                        .font(.system(size: 19))
                    }
                )
    

提交回复
热议问题