Skip to content

[DVStack] First build of DVStack System #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 37 commits into from
Jul 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
fadf4f1
[DVStack] Initial transmission from old repo
lilingxi01 Jun 21, 2021
4218465
[DVManager] Initial transmission from old repo
lilingxi01 Jun 21, 2021
4971f43
[DVStack] Add the docker.
lilingxi01 Jun 23, 2021
e134741
[DVStack] Add iOS-only constrain on `DefinedViewStackContainer`
lilingxi01 Jun 24, 2021
a51b89f
[DPage-iOS] Create Protocol
lilingxi01 Jun 28, 2021
0aa21a7
[DPage-iOS] Initial implementation of PageController
lilingxi01 Jun 28, 2021
6a5464b
[DVManager] Finish basic implementations on controlling page routers
lilingxi01 Jun 28, 2021
c18983e
[DVManager] Initial implementation of Manager Elements
lilingxi01 Jun 28, 2021
bb035b3
[DVStack] Add potential warning onto `DVStackDocker`
lilingxi01 Jun 28, 2021
69dc134
[DVStack] Improve the constrains and identification on `DefinedViewSt…
lilingxi01 Jun 28, 2021
dadd769
[DVStack] Finish the basic implementations of `DefinedViewStack` and …
lilingxi01 Jun 28, 2021
3324b00
[DVStack] Initial implementation of stand-alone `DefinedViewStackMana…
lilingxi01 Jun 28, 2021
0ca366e
[DPage] Remove deprecated docker methods and imports and modify the a…
lilingxi01 Jun 28, 2021
2466274
[DVManager] Add deprecated managers clean up procedure
lilingxi01 Jun 28, 2021
4cffc2e
[DVStack] Fix the bug of double swipe on last two views
lilingxi01 Jun 28, 2021
120172a
[DVManager] Documented and made up the needed warnings.
lilingxi01 Jun 29, 2021
4a83377
[DVStack] Add needed warnings.
lilingxi01 Jun 29, 2021
8b9e8d7
[DVStack] Finish the implementation of complex multiple stacks support.
lilingxi01 Jul 5, 2021
3f8d325
[DVStack] `DVStackManager` Rebuild a per-page pool and add status bar…
lilingxi01 Jul 5, 2021
ceaa0dd
[DVStack] `DVStackContainer`: Add a `count` property.
lilingxi01 Jul 5, 2021
893f316
[DVManager] Add status bar style support to `DVManagerElement`
lilingxi01 Jul 5, 2021
9c127d7
[DVStack] Add status bar style support to `DVStackDocker`.
lilingxi01 Jul 5, 2021
81ff0cb
[DVStack] `DVStackElement`: Add the support of status bar style and m…
lilingxi01 Jul 5, 2021
a9494a8
[DVStack] Remove a deprecated variable from `DVStackManager`.
lilingxi01 Jul 5, 2021
ab3b4b9
[DApp-iOS] Rebuild the status bar style internal API.
lilingxi01 Jul 5, 2021
eac1e4b
[DVStack] Fix a bug of stack element that the value may be re-init.
lilingxi01 Jul 5, 2021
15874c8
[DPage-iOS] Support the dynamic modification of status bar style.
lilingxi01 Jul 5, 2021
242182a
[DVManager] `DVManagerMain`: Re-organize the accessibility of the cla…
lilingxi01 Jul 5, 2021
84a6084
[DPage-iOS] Documented the `DefinedPage`.
lilingxi01 Jul 6, 2021
c778af6
[DPage-iOS] `DPage-iOS.Controller`: finish the initial development wi…
lilingxi01 Jul 6, 2021
a7954e4
[DVStack] Documented the `DVStackManager`.
lilingxi01 Jul 11, 2021
51a78cf
[DVStack] Documented the `DVStackDocker`.
lilingxi01 Jul 11, 2021
e475570
[DVStack] Documented the `DVStackContainer`.
lilingxi01 Jul 11, 2021
1849d8a
[DVManager] Documented the `DVManagerElement` and more.
lilingxi01 Jul 11, 2021
1f09aeb
[DPage-iOS] Add a todo for future development plan.
lilingxi01 Jul 11, 2021
776e145
[DVManager] Add a comment.
lilingxi01 Jul 11, 2021
c84a8ed
[DVStack] Add known bug comments.
lilingxi01 Jul 11, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions Sources/DefinedElements/Frameworks/App/iOS/DApp-iOS.Root.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#if os(iOS)

import Foundation
import SwiftUI

internal struct DefinedAppRoot<StartPage> : Scene where StartPage: DefinedPage {
var start: StartPage

init(from: StartPage) {
self.start = from
}

var body: some Scene {
WindowGroup {
EmptyView()
.onAppear(perform: {
UIApplication.startApplication(from: self.start)
})
}
}
}

#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#if os(iOS)

import Foundation
import SwiftUI

/// [DE Internal] A root view controller alternative to empower the ability of changing status bar style.
internal class DefinedStatusBarController: UIHostingController<DefinedViewStack> {
/// The current status bar style holder.
var statusBarStyle: UIStatusBarStyle = .darkContent

override var preferredStatusBarStyle: UIStatusBarStyle {
return statusBarStyle
}

/// Change the style holder inside the controller by given style.
///
/// - Parameter style: The target style.
func changeStatusBarStyle(_ style: UIStatusBarStyle) {
self.statusBarStyle = style
self.setNeedsStatusBarAppearanceUpdate()
}
}

internal extension UIApplication {
/// [DE Internal] Set the start page of the app and empower the ability of changing status bar style.
///
/// - Parameter from: The root page (start page for the root view stack) of an app.
class func startApplication<StartPage>(from page: StartPage) where StartPage: DefinedPage {
UIApplication.shared.windows.first?.rootViewController?.beginAppearanceTransition(false, animated: false)
UIApplication.shared.windows.first?.rootViewController = DefinedStatusBarController(rootView: DefinedViewStack(from: page))
}

/// [DE Internal] Set the status bar style over the entire app.
///
/// Handling the status bar style modification should be in `DefinedViewStack` system instead of here.
///
/// - Parameter style: The target style.
class func setStatusBarStyle(_ style: UIStatusBarStyle) {
if let viewController = UIApplication.getKeyWindow()?.rootViewController as? DefinedStatusBarController {
viewController.changeStatusBarStyle(style)
}
}

private class func getKeyWindow() -> UIWindow? {
return UIApplication.shared.windows.first{ $0.isKeyWindow }
}
}

#endif
Loading