Giter Club home page Giter Club logo

swiftuioverlaycontainer's People

Contributors

amoshsueh avatar fatbobman avatar vulgur avatar yjadair avatar zhulegend avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

swiftuioverlaycontainer's Issues

@State 修改后,ContainerView 中的 content 不更新。

代码如下:

import SwiftUI
import SwiftUIOverlayContainer

struct ContainerConfiguration: ContainerConfigurationProtocol {
  var displayType: ContainerViewDisplayType = .vertical
  var queueType: ContainerViewQueueType = .oneByOneWaitFinish
  var ignoresSafeArea: ContainerIgnoresSafeArea = .all
  var alignment: Alignment = .bottom
  var tapToDismiss: Bool = false
  var backgroundStyle: ContainerBackgroundStyle = .blur(.regular)
  var shadowStyle: ContainerViewShadowStyle = .radius(12)
  var dismissGesture: ContainerViewDismissGesture = .disable
  var autoDismiss: ContainerViewAutoDismiss = .disable
}

struct ContainerViewConfiguration: ContainerViewConfigurationProtocol {
  
}

struct ContentView: View {
  @State var text: String = "Test"
  @State var isPresented: Bool = false
  var body: some View {
    Text("Hello, world!")
      .padding()
      .overlayContainer("clone", containerConfiguration: ContainerConfiguration())
      .containerView(
        in: "clone",
        configuration: ContainerViewConfiguration(),
        isPresented: $isPresented,
        content:
          VStack {
            Button {
              text = UUID().uuidString
            } label: {
              Text("Change Text")
            }
            Text(text)
              .background(.red)
              .padding()
          }
      )
    Button {
      isPresented = true
    } label: {
      Text("Show")
    }
  }
}

UUID for content view

您好:

從文件上得知容器管理器目前提供的方法有:

  • show(view: Content, in container: String, using configuration: ContainerViewConfigurationProtocol, animated: Bool) -> UUID?
    在指定的容器中显示视图,返回值为视图的 ID
  • dismiss(view id: UUID, in container: String, animated flag: Bool)
    在指定的容器中,撤销指定 ID 的视图

假設我從 A view 呼叫 container manager 去 show B view,我會取得一個 uuid,那有什麼方法可以讓 B view 直接取得這個 uuid 讓 dismiss(view id: UUID, in container: String, animated flag: Bool) 可以順利執行呢?

p.s. 目前想到可以用 Closure 的方式,想問問看有沒有更好的方法,謝謝!

支援多層級的 Overlay views

SwiftUIOverlayContainer 目前看起來僅支援單一 layer 的 overlay,不知道未來能不能支援多層級的呈現方式,這樣設計畫面會更有彈性,謝謝提供這麼好的一個思路。

Tap to dismiss 没有退出动画

点击container空白处dismiss的话,没有退出动画,就是transition中的removal。
还有,我发现在container view里主动调用container.dismiss(),如果是在Button的action里调用就会有退出动画,但是在其他View的onTapGesture里调用的话就没有退出动画。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.