Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
Sailassist
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
CpjJwWHV
Sailassist
Commits
cc2e8395
Commit
cc2e8395
authored
Oct 27, 2023
by
sugita mamoru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Preview修正
parent
c0c0163f
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
5 additions
and
91 deletions
+5
-91
ContentView.swift
Seilassist/Sailassist/ContentView.swift
+1
-0
InputIdPassWordView.swift
Seilassist/Sailassist/Login/View/InputIdPassWordView.swift
+1
-1
InputUserNameView.swift
Seilassist/Sailassist/Login/View/InputUserNameView.swift
+2
-0
LoginTypeSelectView.swift
Seilassist/Sailassist/Login/View/LoginTypeSelectView.swift
+1
-0
SailassistApp.swift
Seilassist/Sailassist/SailassistApp.swift
+0
-90
No files found.
Seilassist/Sailassist/ContentView.swift
View file @
cc2e8395
...
...
@@ -40,4 +40,5 @@ struct ContentView: View {
#Preview {
ContentView
()
.
environmentObject
(
SceneDelegate
())
}
Seilassist/Sailassist/Login/View/InputIdPassWordView.swift
View file @
cc2e8395
...
...
@@ -10,7 +10,6 @@ import Combine
struct
InputIdPassWordView
:
View
{
@EnvironmentObject
var
loginViewParam
:
LoginViewParam
// @ObservedObject var loginViewParam: LoginViewParam = LoginViewParam()
let
itemHPadding
:
Double
=
16
let
dialogBottomPadding
:
Double
=
32
let
textFieldHeight
:
Double
=
49
...
...
@@ -94,4 +93,5 @@ struct InputIdPassWordView: View {
#Preview {
InputIdPassWordView
()
.
environmentObject
(
LoginViewParam
())
}
Seilassist/Sailassist/Login/View/InputUserNameView.swift
View file @
cc2e8395
...
...
@@ -84,4 +84,6 @@ struct InputUserNameView: View {
#Preview {
InputUserNameView
(
isLogin
:
.
constant
(
false
))
.
environmentObject
(
LoginViewParam
())
}
Seilassist/Sailassist/Login/View/LoginTypeSelectView.swift
View file @
cc2e8395
...
...
@@ -45,4 +45,5 @@ struct LoginTypeSelectView: View{
}
#Preview {
LoginTypeSelectView
(
isQrRead
:
.
constant
(
false
))
.
environmentObject
(
LoginViewParam
())
}
Seilassist/Sailassist/SailassistApp.swift
View file @
cc2e8395
...
...
@@ -25,16 +25,12 @@ class AppDelegate: NSObject, UIApplicationDelegate{
}
}
//@Observable
class
SceneDelegate
:
UIResponder
,
UIWindowSceneDelegate
,
ObservableObject
{
weak
var
windowScene
:
UIWindowScene
?
var
tabWindow
:
UIWindow
?
var
overlayWindow
:
UIWindow
?
var
tag
:
Int
=
0
func
scene
(
_
scene
:
UIScene
,
willConnectTo
session
:
UISceneSession
,
options
connectionOptions
:
UIScene
.
ConnectionOptions
)
{
windowScene
=
scene
as?
UIWindowScene
setupOverlayWindow
()
}
...
...
@@ -57,34 +53,6 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate, ObservableObject {
self
.
tabWindow
=
tabWindow
}
func
setupOverlayWindow
(){
guard
let
windowScene
=
windowScene
else
{
return
}
let
window
=
UIWindow
(
windowScene
:
windowScene
)
window
.
isHidden
=
true
window
.
isUserInteractionEnabled
=
false
self
.
overlayWindow
=
window
}
fileprivate
func
alert
<
Content
:
View
>
(
config
:
Binding
<
AlertConfig
>
,
@ViewBuilder
content
:
@escaping
()
->
Content
,
viewTag
:
@escaping
(
Int
)
->
())
{
guard
let
alertWindow
=
overlayWindow
else
{
return
}
let
viewController
=
UIHostingController
(
rootView
:
AlertView
(
config
:
config
,
tag
:
tag
,
content
:
{
content
()
})
)
viewController
.
view
.
backgroundColor
=
.
clear
viewController
.
view
.
tag
=
tag
viewTag
(
tag
)
tag
+=
1
if
alertWindow
.
rootViewController
==
nil
{
alertWindow
.
rootViewController
=
viewController
alertWindow
.
isHidden
=
false
alertWindow
.
isUserInteractionEnabled
=
true
}
}
}
...
...
@@ -94,61 +62,3 @@ class PassThroughWindow: UIWindow{
return
rootViewController
?
.
view
==
view
?
nil
:
view
}
}
struct
AlertConfig
{
var
enableBackgroundBlur
:
Bool
=
true
var
disableOutsideTap
:
Bool
=
true
var
transitionType
:
TransitionType
=
.
slide
var
slideEdge
:
Edge
=
.
bottom
private
var
show
:
Bool
=
false
enum
TransitionType
{
case
slide
case
opacity
}
mutating
func
present
(){
show
=
true
}
mutating
func
dismiss
(){
show
=
false
}
}
fileprivate
struct
AlertView
<
Content
:
View
>
:
View
{
@Binding
var
config
:
AlertConfig
var
tag
:
Int
@ViewBuilder
var
content
:
()
->
Content
var
body
:
some
View
{
GeometryReader
(
content
:
{
geometry
in
Color
.
red
})
}
}
extension
View
{
@ViewBuilder
func
alert
<
Content
:
View
>
(
config
:
Binding
<
AlertConfig
>
,
@ViewBuilder
content
:
@escaping
()
->
Content
,
viewTag
:
@escaping
(
Int
)
->
())
->
some
View
{
self
}
}
fileprivate
struct
AlertModifier
<
AlertContent
:
View
>
:
ViewModifier
{
@Binding
var
config
:
AlertConfig
@ViewBuilder
var
alertContent
:
()
->
AlertContent
@Environment
private
var
sceneDelegate
:
SceneDelegate
@State
private
var
viewTag
:
Int
=
0
func
body
(
content
:
Content
)
->
some
View
{
content
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment