Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Converted by Storyboard to SwiftUI Converter - https://swiftify.com/converter/storyboard2swiftui
- import SwiftUI
- import Introspect
- // TODO: install `SwiftUI-Introspect` package from https://github.com/siteline/SwiftUI-Introspect
- // --------------------------------------------------------------------------------
- // NavAppearanceModifier
- // --------------------------------------------------------------------------------
- struct NavAppearanceModifier: ViewModifier {
- init() {
- let navBarAppearance = UINavigationBarAppearance()
- navBarAppearance.configureWithOpaqueBackground()
- UINavigationBar.appearance().isTranslucent = false
- UINavigationBar.appearance().standardAppearance = navBarAppearance
- UINavigationBar.appearance().compactAppearance = navBarAppearance
- UINavigationBar.appearance().scrollEdgeAppearance = navBarAppearance
- }
- func body(content: Content) -> some View {
- content
- }
- }
- extension View {
- func navigationAppearance() -> some View {
- self.modifier(NavAppearanceModifier())
- }
- }
- // --------------------------------------------------------------------------------
- // NavAppearanceModifier1
- // --------------------------------------------------------------------------------
- struct NavAppearanceModifier1: ViewModifier {
- init() {
- let navBarAppearance = UINavigationBarAppearance()
- navBarAppearance.configureWithOpaqueBackground()
- UINavigationBar.appearance().isTranslucent = false
- UINavigationBar.appearance().standardAppearance = navBarAppearance
- UINavigationBar.appearance().compactAppearance = navBarAppearance
- UINavigationBar.appearance().scrollEdgeAppearance = navBarAppearance
- }
- func body(content: Content) -> some View {
- content
- }
- }
- extension View {
- func navigationAppearance1() -> some View {
- self.modifier(NavAppearanceModifier1())
- }
- }
- // --------------------------------------------------------------------------------
- // NavAppearanceModifier2
- // --------------------------------------------------------------------------------
- struct NavAppearanceModifier2: ViewModifier {
- init() {
- let navBarAppearance = UINavigationBarAppearance()
- navBarAppearance.configureWithOpaqueBackground()
- UINavigationBar.appearance().isTranslucent = false
- UINavigationBar.appearance().standardAppearance = navBarAppearance
- UINavigationBar.appearance().compactAppearance = navBarAppearance
- UINavigationBar.appearance().scrollEdgeAppearance = navBarAppearance
- }
- func body(content: Content) -> some View {
- content
- }
- }
- extension View {
- func navigationAppearance2() -> some View {
- self.modifier(NavAppearanceModifier2())
- }
- }
- // --------------------------------------------------------------------------------
- // MJRootViewController
- // --------------------------------------------------------------------------------
- struct MJRootView: View {
- var body: some View {
- NavigationView {
- ZStack(alignment: .topLeading) {
- GeometryReader { geometry in
- List {
- Spacer() // TODO: replace with the actual content
- }
- }
- }
- .frame(dynamicWidth: 414, dynamicHeight: 808)
- .background(Color(.white))
- .edgesIgnoringSafeArea(.all)
- .navigationTitle("Title")
- .navigationBarTitleDisplayMode(.automatic)
- }
- }
- }
- struct MJRootView_Previews: PreviewProvider {
- static var previews: some View {
- MJRootView()
- .previewDevice(PreviewDevice(rawValue: "iPhone 11"))
- .previewInterfaceOrientation(.portrait)
- .preferredColorScheme(.dark)
- }
- }
- // --------------------------------------------------------------------------------
- // MappaSensori
- // --------------------------------------------------------------------------------
- struct MappaSensoriView: View {
- var body: some View {
- NavigationView {
- ZStack(alignment: .topLeading) {
- GeometryReader { geometry in
- ScrollView {
- Image("CasaDefault2")
- .resizable()
- .aspectRatio(contentMode: .fill)
- .frame(dynamicWidth: 320, dynamicHeight: 364)
- .clipped()
- .offset(dynamicX: 0, dynamicY: 3)
- }
- .introspectScrollView(customize: { scrollView in
- scrollView.clipsToBounds = true
- scrollView.delaysContentTouches = false
- scrollView.indicatorStyle = .white
- scrollView.maximumZoomScale = 3.0
- scrollView.minimumZoomScale = 0.3
- scrollView.showsHorizontalScrollIndicator = false
- scrollView.showsVerticalScrollIndicator = false
- })
- .frame(dynamicWidth: 414, dynamicHeight: 759)
- .background(Color(.white))
- }
- }
- .frame(dynamicWidth: 414, dynamicHeight: 808)
- .background(Color(.white))
- .edgesIgnoringSafeArea(.all)
- .navigationBarTitleDisplayMode(.automatic)
- .navigationBarItems(leading: Button(action: {}) {
- },
- trailing: Button(action: {}) {
- Text("Edit")
- })
- .onAppear {
- _ = NavAppearanceModifier()
- }
- }
- }
- }
- struct MappaSensoriView_Previews: PreviewProvider {
- static var previews: some View {
- MappaSensoriView()
- .previewDevice(PreviewDevice(rawValue: "iPhone 11"))
- .previewInterfaceOrientation(.portrait)
- .preferredColorScheme(.dark)
- }
- }
- // --------------------------------------------------------------------------------
- // UIViewController
- // --------------------------------------------------------------------------------
- struct UIView: View {
- var body: some View {
- ZStack(alignment: .topLeading) {
- GeometryReader { geometry in
- Image("P_pulsante2.png")
- .resizable()
- .aspectRatio(contentMode: .fit)
- .frame(dynamicWidth: 240, dynamicHeight: 128)
- .clipped()
- .offset(dynamicX: 92, dynamicY: 339)
- }
- }
- .frame(dynamicWidth: 414, dynamicHeight: 896)
- .background(Color(.white))
- .edgesIgnoringSafeArea(.all)
- }
- }
- struct UIView_Previews: PreviewProvider {
- static var previews: some View {
- UIView()
- .previewDevice(PreviewDevice(rawValue: "iPhone 11"))
- .previewInterfaceOrientation(.portrait)
- .preferredColorScheme(.dark)
- }
- }
- // --------------------------------------------------------------------------------
- // AmbientiListTableController
- // --------------------------------------------------------------------------------
- struct AmbientiListTableView: View {
- @State private var <#items#> = Array<<#Type#>>()
- @State private var <#selectedItem#>: <#Type#>?
- var body: some View {
- NavigationView {
- ZStack(alignment: .topLeading) {
- GeometryReader { geometry in
- List {
- ForEach(<#items#>) { <#item#> in
- AmbientiListCell()
- .listRowInsets(EdgeInsets())
- .contentShape(Rectangle())
- .modifier(SelectionModifier(checked: <#selectedItem#> == <#item#>))
- .onTapGesture {
- <#selectedItem#> = <#item#>
- }
- }
- }
- .introspectTableView(customize: { tableView in
- tableView.alwaysBounceHorizontal = true
- tableView.alwaysBounceVertical = true
- tableView.clipsToBounds = true
- tableView.separatorInset = UIEdgeInsets(top: 0.0, left: 0.0, bottom: 40.0, right: 0.0)
- tableView.separatorStyle = .default
- })
- .frame(dynamicWidth: 414, dynamicHeight: 757)
- .listStyle(.plain)
- }
- }
- .frame(dynamicWidth: 414, dynamicHeight: 808)
- .background(Color(.white))
- .edgesIgnoringSafeArea(.all)
- .navigationTitle("Ambients list")
- .navigationBarTitleDisplayMode(.automatic)
- .navigationBarItems(leading: Button(action: {}) {
- Image(systemName: "plus")
- })
- .onAppear {
- _ = NavAppearanceModifier2()
- }
- }
- }
- }
- struct AmbientiListTableView_Previews: PreviewProvider {
- static var previews: some View {
- AmbientiListTableView()
- .previewDevice(PreviewDevice(rawValue: "iPhone 11"))
- .previewInterfaceOrientation(.portrait)
- .preferredColorScheme(.dark)
- }
- }
- // --------------------------------------------------------------------------------
- // SensorInfoZoomImage
- // --------------------------------------------------------------------------------
- struct SensorInfoZoomImageView: View {
- var body: some View {
- NavigationView {
- ZStack(alignment: .topLeading) {
- GeometryReader { geometry in
- ScrollView {
- Image("dht22_sch")
- .resizable()
- .aspectRatio(contentMode: .fit)
- .frame(dynamicWidth: 414, dynamicHeight: 896)
- }
- .introspectScrollView(customize: { scrollView in
- scrollView.clipsToBounds = true
- scrollView.maximumZoomScale = 10.0
- })
- .frame(dynamicWidth: 414, dynamicHeight: 896)
- }
- }
- .frame(dynamicWidth: 414, dynamicHeight: 896)
- .edgesIgnoringSafeArea(.all)
- .navigationBarTitleDisplayMode(.automatic)
- }
- }
- }
- struct SensorInfoZoomImageView_Previews: PreviewProvider {
- static var previews: some View {
- SensorInfoZoomImageView()
- .previewDevice(PreviewDevice(rawValue: "iPhone 11"))
- .previewInterfaceOrientation(.portrait)
- .preferredColorScheme(.dark)
- }
- }
- // --------------------------------------------------------------------------------
- // PickerDuration
- // --------------------------------------------------------------------------------
- struct PickerDurationView: View {
- var body: some View {
- NavigationView {
- ZStack(alignment: .topLeading) {
- GeometryReader { geometry in
- //Picker("", selection: $bindingVariable) {}
- Text("How long the output PIN will remain active")
- .frame(dynamicWidth: 320, dynamicHeight: 60, alignment: .center)
- .clipped()
- .font(.system(size: 16, weight: .regular))
- .multilineTextAlignment(.center)
- .offset(dynamicX: 47, dynamicY: 114)
- Image("square_pulse")
- .resizable()
- .frame(dynamicWidth: 206, dynamicHeight: 54)
- .offset(dynamicX: 110, dynamicY: 377)
- Text("Label")
- .frame(dynamicWidth: 350, dynamicHeight: 65, alignment: .center)
- .font(.system(size: 21, weight: .regular))
- .multilineTextAlignment(.center)
- .offset(dynamicX: 32, dynamicY: 214)
- }
- }
- .frame(dynamicWidth: 414, dynamicHeight: 808)
- .background(Color(.white))
- .edgesIgnoringSafeArea(.all)
- .navigationBarTitleDisplayMode(.automatic)
- }
- }
- }
- struct PickerDurationView_Previews: PreviewProvider {
- static var previews: some View {
- PickerDurationView()
- .previewDevice(PreviewDevice(rawValue: "iPhone 11"))
- .previewInterfaceOrientation(.portrait)
- .preferredColorScheme(.dark)
- }
- }
- // --------------------------------------------------------------------------------
- // DatePicker
- // --------------------------------------------------------------------------------
- struct DatePickerView: View {
- var body: some View {
- NavigationView {
- ZStack(alignment: .topLeading) {
- GeometryReader { geometry in
- //DatePicker(selection: $selectedDate, in: dateClosedRange, displayedComponents: .date, label: { Text("Due Date") })
- Text("How long the output PIN will remain active")
- .frame(dynamicWidth: 320, dynamicHeight: 60, alignment: .center)
- .clipped()
- .font(.system(size: 16, weight: .regular))
- .multilineTextAlignment(.center)
- .foregroundColor(Color(red: 0.0, green: 0.47843137, blue: 1.0))
- .offset(dynamicX: 47, dynamicY: 114)
- Text("Duration: 12:00")
- .frame(dynamicWidth: 350, dynamicHeight: 59, alignment: .center)
- .font(.system(size: 21, weight: .regular))
- .multilineTextAlignment(.center)
- .offset(dynamicX: 32, dynamicY: 214)
- Image("square_pulse")
- .resizable()
- .frame(dynamicWidth: 206, dynamicHeight: 54)
- .offset(dynamicX: 104, dynamicY: 377)
- }
- }
- .frame(dynamicWidth: 414, dynamicHeight: 808)
- .background(Color(.white))
- .edgesIgnoringSafeArea(.all)
- .navigationBarTitleDisplayMode(.automatic)
- }
- }
- }
- struct DatePickerView_Previews: PreviewProvider {
- static var previews: some View {
- DatePickerView()
- .previewDevice(PreviewDevice(rawValue: "iPhone 11"))
- .previewInterfaceOrientation(.portrait)
- .preferredColorScheme(.dark)
- }
- }
- // --------------------------------------------------------------------------------
- // SendMessage
- // --------------------------------------------------------------------------------
- struct SendMessageView: View {
- @State private var Message: String = ""
- @State private var MessageName: String = ""
- @State private var MessageNumber: String = ""
- var body: some View {
- NavigationView {
- ZStack(alignment: .topLeading) {
- GeometryReader { geometry in
- ScrollView(.horizontal, showsIndicators: false) {
- TextField("Name", text: $MessageName)
- .textFieldStyle(RoundedBorderTextFieldStyle())
- .introspectTextField(customize: { textField in
- textField.adjustsFontSizeToFitWidth = true
- textField.clipsToBounds = true
- textField.minimumFontSize = 17.0
- })
- .frame(dynamicWidth: 141, dynamicHeight: 30)
- .font(.system(size: 14, weight: .regular))
- .offset(dynamicX: 15, dynamicY: 20)
- Text("Message name")
- .frame(dynamicWidth: 146, dynamicHeight: 21, alignment: .leading)
- .clipped()
- .font(.system(size: 17, weight: .regular))
- .foregroundColor(Color(red: 0.0, green: 0.0, blue: 0.0))
- .offset(dynamicX: 259, dynamicY: 24)
- TextField("number", text: $MessageNumber)
- .textFieldStyle(RoundedBorderTextFieldStyle())
- .introspectTextField(customize: { textField in
- textField.adjustsFontSizeToFitWidth = true
- textField.clipsToBounds = true
- textField.minimumFontSize = 17.0
- })
- .frame(dynamicWidth: 141, dynamicHeight: 30)
- .font(.system(size: 14, weight: .regular))
- .offset(dynamicX: 15, dynamicY: 65)
- .keyboardType(.numberPad)
- Text("Message index")
- .frame(dynamicWidth: 146, dynamicHeight: 21, alignment: .leading)
- .clipped()
- .font(.system(size: 17, weight: .regular))
- .foregroundColor(Color(red: 0.0, green: 0.0, blue: 0.0))
- .offset(dynamicX: 259, dynamicY: 69)
- TextField("Message", text: $Message)
- .textFieldStyle(RoundedBorderTextFieldStyle())
- .introspectTextField(customize: { textField in
- textField.adjustsFontSizeToFitWidth = true
- textField.clipsToBounds = true
- textField.minimumFontSize = 17.0
- })
- .frame(dynamicWidth: 142, dynamicHeight: 30)
- .font(.system(size: 14, weight: .regular))
- .offset(dynamicX: 14, dynamicY: 112)
- .keyboardType(.asciiCapable)
- Text("Message")
- .frame(dynamicWidth: 146, dynamicHeight: 21, alignment: .leading)
- .clipped()
- .font(.system(size: 17, weight: .regular))
- .foregroundColor(Color(red: 0.0, green: 0.0, blue: 0.0))
- .offset(dynamicX: 259, dynamicY: 116)
- Text("#")
- .frame(dynamicWidth: 280, dynamicHeight: 21, alignment: .center)
- .clipped()
- .font(.system(size: 17, weight: .regular))
- .multilineTextAlignment(.center)
- .offset(dynamicX: 66, dynamicY: 310)
- Text("This message will be sent to Arduino")
- .frame(dynamicWidth: 320, dynamicHeight: 61, alignment: .center)
- .clipped()
- .font(.system(size: 17, weight: .regular))
- .multilineTextAlignment(.center)
- .offset(dynamicX: 46, dynamicY: 240)
- }
- .introspectScrollView(customize: { scrollView in
- scrollView.alwaysBounceHorizontal = true
- scrollView.clipsToBounds = true
- scrollView.showsHorizontalScrollIndicator = false
- })
- .frame(dynamicWidth: 414, dynamicHeight: 808)
- }
- }
- .frame(dynamicWidth: 414, dynamicHeight: 808)
- .background(Color(red: 1.0, green: 1.0, blue: 1.0))
- .edgesIgnoringSafeArea(.all)
- .navigationTitle("Message configuration")
- .navigationBarTitleDisplayMode(.automatic)
- .navigationBarItems(trailing: Button(action: {}) {
- Text("Save")
- })
- }
- }
- }
- struct SendMessageView_Previews: PreviewProvider {
- static var previews: some View {
- SendMessageView()
- .previewDevice(PreviewDevice(rawValue: "iPhone 11"))
- .previewInterfaceOrientation(.portrait)
- .preferredColorScheme(.dark)
- }
- }
- // --------------------------------------------------------------------------------
- // SelettoreGenerico
- // --------------------------------------------------------------------------------
- struct SelettoreGenericoView: View {
- var body: some View {
- NavigationView {
- ZStack(alignment: .topLeading) {
- GeometryReader { geometry in
- //Picker("", selection: $bindingVariable) {}
- Text("Label")
- .frame(dynamicWidth: 320, dynamicHeight: 81, alignment: .center)
- .clipped()
- .font(.system(size: 20, weight: .regular))
- .multilineTextAlignment(.center)
- .offset(dynamicX: 46, dynamicY: 125)
- Text("Label")
- .frame(dynamicWidth: 320, dynamicHeight: 186, alignment: .center)
- .clipped()
- .font(.system(size: 20, weight: .regular))
- .multilineTextAlignment(.center)
- .offset(dynamicX: 46, dynamicY: 0)
- }
- }
- .frame(dynamicWidth: 414, dynamicHeight: 808)
- .background(Color(.white))
- .edgesIgnoringSafeArea(.all)
- .navigationBarTitleDisplayMode(.automatic)
- .navigationBarItems(leading: Button(action: {}) {
- HStack(spacing: 0) {
- Image(systemName: "chevron.left")
- Text("Back")
- }
- })
- }
- }
- }
- struct SelettoreGenericoView_Previews: PreviewProvider {
- static var previews: some View {
- SelettoreGenericoView()
- .previewDevice(PreviewDevice(rawValue: "iPhone 11"))
- .previewInterfaceOrientation(.portrait)
- .preferredColorScheme(.dark)
- }
- }
- // --------------------------------------------------------------------------------
- // AvvioApp
- // --------------------------------------------------------------------------------
- struct AvvioAppView: View {
- var body: some View {
- ZStack(alignment: .topLeading) {
- GeometryReader { geometry in
- ScrollView(.horizontal, showsIndicators: false) {
- Group {
- Text("A")
- .frame(dynamicWidth: 320, dynamicHeight: 81, alignment: .center)
- .clipped()
- .font(.custom("Noteworthy-Bold", size: 92))
- .multilineTextAlignment(.center)
- .offset(dynamicX: 46, dynamicY: 95)
- Text("Andrea Scavuzzo")
- .frame(dynamicWidth: 320, dynamicHeight: 21, alignment: .center)
- .clipped()
- .font(.system(size: 17, weight: .regular))
- .multilineTextAlignment(.center)
- .foregroundColor(Color(red: 0.0, green: 0.47843137, blue: 1.0))
- .offset(dynamicX: 46, dynamicY: 805)
- Text("www.andruino.it")
- .frame(dynamicWidth: 320, dynamicHeight: 21, alignment: .center)
- .clipped()
- .font(.system(size: 12, weight: .regular))
- .multilineTextAlignment(.center)
- .foregroundColor(Color(red: 0.0, green: 0.47843137, blue: 1.0))
- .offset(dynamicX: 46, dynamicY: 820)
- Image("100")
- .resizable()
- .aspectRatio(contentMode: .fit)
- .frame(dynamicWidth: 414, dynamicHeight: 41)
- .offset(dynamicX: 0, dynamicY: 761)
- Text("Push enabled")
- .frame(dynamicWidth: 320, dynamicHeight: 21, alignment: .center)
- .clipped()
- .font(.system(size: 10, weight: .regular))
- .multilineTextAlignment(.center)
- .foregroundColor(Color(red: 1.0, green: 0.23137255, blue: 0.1882353))
- .offset(dynamicX: 46, dynamicY: 740)
- Text("Connection")
- .frame(dynamicWidth: 320, dynamicHeight: 21, alignment: .center)
- .clipped()
- .font(.system(size: 10, weight: .regular))
- .multilineTextAlignment(.center)
- .foregroundColor(Color(red: 1.0, green: 0.23137255, blue: 0.1882353))
- .offset(dynamicX: 46, dynamicY: 726)
- Text("AppleWatch is now supported")
- .frame(dynamicWidth: 320, dynamicHeight: 21, alignment: .center)
- .clipped()
- .font(.system(size: 10, weight: .regular))
- .multilineTextAlignment(.center)
- .foregroundColor(Color(red: 1.0, green: 0.23137255, blue: 0.1882353))
- .offset(dynamicX: 46, dynamicY: 688)
- Text("Wired and wireless Arduino home sensors for iPhone")
- .frame(dynamicWidth: 393, dynamicHeight: 72, alignment: .center)
- .clipped()
- .font(.system(size: 18, weight: .regular))
- .multilineTextAlignment(.center)
- .foregroundColor(Color(red: 0.0, green: 0.47843137, blue: 1.0))
- .offset(dynamicX: 10, dynamicY: 206)
- Text("5.0")
- .frame(dynamicWidth: 322, dynamicHeight: 48, alignment: .center)
- .clipped()
- .font(.system(size: 17, weight: .regular))
- .multilineTextAlignment(.center)
- .foregroundColor(Color(red: 0.0, green: 0.47843137, blue: 1.0))
- .offset(dynamicX: 46, dynamicY: 66)
- Text("Label")
- .frame(dynamicWidth: 398, dynamicHeight: 21, alignment: .center)
- .font(.system(size: 17, weight: .regular))
- .multilineTextAlignment(.center)
- .foregroundColor(Color(red: 0.6666667, green: 0.6666667, blue: 0.6666667))
- .offset(dynamicX: 8, dynamicY: 61)
- }
- Group {
- Text("Lite")
- .frame(dynamicWidth: 320, dynamicHeight: 28, alignment: .center)
- .clipped()
- .font(.system(size: 13, weight: .regular))
- .multilineTextAlignment(.center)
- .foregroundColor(Color(red: 1.0, green: 0.23137255, blue: 0.1882353))
- .offset(dynamicX: 46, dynamicY: 161)
- Text("ndruino")
- .frame(dynamicWidth: 320, dynamicHeight: 26, alignment: .center)
- .clipped()
- .font(.custom("Noteworthy-Bold", size: 21))
- .multilineTextAlignment(.center)
- .offset(dynamicX: 46, dynamicY: 176)
- Image(systemName: "faceid")
- .resizable()
- .aspectRatio(contentMode: .fit)
- .frame(dynamicWidth: 69, dynamicHeight: 61)
- .clipped()
- .offset(dynamicX: 173, dynamicY: 375)
- Image("Andruino_Watch_preview")
- .resizable()
- .aspectRatio(contentMode: .fit)
- .frame(dynamicWidth: 86, dynamicHeight: 76)
- .offset(dynamicX: 164, dynamicY: 613)
- }
- }
- .introspectScrollView(customize: { scrollView in
- scrollView.clipsToBounds = true
- scrollView.showsHorizontalScrollIndicator = false
- scrollView.showsVerticalScrollIndicator = false
- })
- .frame(dynamicWidth: 414, dynamicHeight: 896)
- .background(Color(.white))
- }
- }
- .frame(dynamicWidth: 414, dynamicHeight: 896)
- .background(Color(.white))
- .edgesIgnoringSafeArea(.all)
- }
- }
- struct AvvioAppView_Previews: PreviewProvider {
- static var previews: some View {
- AvvioAppView()
- .previewDevice(PreviewDevice(rawValue: "iPhone 11"))
- .previewInterfaceOrientation(.portrait)
- .preferredColorScheme(.dark)
- }
- }
- // --------------------------------------------------------------------------------
- // PolicyWeb
- // --------------------------------------------------------------------------------
- struct PolicyWebView: View {
- var body: some View {
- NavigationView {
- ZStack(content: {})
- .frame(dynamicWidth: 414, dynamicHeight: 896)
- .background(Color(.white))
- .edgesIgnoringSafeArea(.all)
- .navigationBarTitleDisplayMode(.automatic)
- }
- }
- }
- struct PolicyWebView_Previews: PreviewProvider {
- static var previews: some View {
- PolicyWebView()
- .previewDevice(PreviewDevice(rawValue: "iPhone 11"))
- .previewInterfaceOrientation(.portrait)
- .preferredColorScheme(.dark)
- }
- }
- // --------------------------------------------------------------------------------
- // GraphView
- // --------------------------------------------------------------------------------
- struct GraphView: View {
- var body: some View {
- ZStack(alignment: .topLeading) {
- GeometryReader { geometry in
- //Picker("", selection: $bindingVariable) {}
- ZStack(content: {})
- .frame(dynamicWidth: 414, dynamicHeight: 726)
- }
- }
- .frame(dynamicWidth: 414, dynamicHeight: 764)
- .background(Color(.white))
- .edgesIgnoringSafeArea(.all)
- }
- }
- struct GraphView_Previews: PreviewProvider {
- static var previews: some View {
- GraphView()
- .previewDevice(PreviewDevice(rawValue: "iPhone 11"))
- .previewInterfaceOrientation(.portrait)
- .preferredColorScheme(.dark)
- }
- }
- // --------------------------------------------------------------------------------
- // ColorCollectionView
- // --------------------------------------------------------------------------------
- struct ColorCollectionView: View {
- var body: some View {
- NavigationView {
- ZStack(alignment: .topLeading) {
- GeometryReader { geometry in
- List {
- Spacer() // TODO: replace with the actual content
- }
- }
- }
- .frame(dynamicWidth: 414, dynamicHeight: 808)
- .background(Color(.white))
- .edgesIgnoringSafeArea(.all)
- .navigationTitle("Title")
- .navigationBarTitleDisplayMode(.automatic)
- }
- }
- }
- struct ColorCollectionView_Previews: PreviewProvider {
- static var previews: some View {
- ColorCollectionView()
- .previewDevice(PreviewDevice(rawValue: "iPhone 11"))
- .previewInterfaceOrientation(.portrait)
- .preferredColorScheme(.dark)
- }
- }
- // --------------------------------------------------------------------------------
- // Colors
- // --------------------------------------------------------------------------------
- struct ColorsView: View {
- @State private var <#items#> = Array<<#Type#>>()
- @State private var <#selectedItem#>: <#Type#>?
- var body: some View {
- List {
- ForEach(<#items#>) { <#item#> in
- ColorsCell()
- .listRowInsets(EdgeInsets())
- .contentShape(Rectangle())
- .modifier(SelectionModifier(checked: <#selectedItem#> == <#item#>))
- .onTapGesture {
- <#selectedItem#> = <#item#>
- }
- }
- }
- .introspectTableView(customize: { tableView in
- tableView.alwaysBounceHorizontal = true
- tableView.alwaysBounceVertical = true
- tableView.clipsToBounds = true
- tableView.separatorStyle = .default
- })
- .frame(dynamicWidth: 414, dynamicHeight: 808)
- .listStyle(.plain)
- }
- }
- struct ColorsView_Previews: PreviewProvider {
- static var previews: some View {
- ColorsView()
- }
- }
- // --------------------------------------------------------------------------------
- // NetworkConfig
- // --------------------------------------------------------------------------------
- struct NetworkConfigView: View {
- @State private var <#items#> = Array<<#Type#>>()
- @State private var <#selectedItem#>: <#Type#>?
- var body: some View {
- List {
- ForEach(<#items#>) { <#item#> in
- // It seems that you do not have a UITableViewCell added from the storyboard.
- // If you have added the TableViewCell through a XiB, please convert the XiB and copy the result here.
- }
- }
- .introspectTableView(customize: { tableView in
- tableView.alwaysBounceHorizontal = true
- tableView.alwaysBounceVertical = true
- tableView.clipsToBounds = true
- tableView.separatorStyle = .none
- })
- .frame(dynamicWidth: 320, dynamicHeight: 912)
- .listStyle(.plain)
- }
- }
- struct NetworkConfigView_Previews: PreviewProvider {
- static var previews: some View {
- NetworkConfigView()
- }
- }
- // --------------------------------------------------------------------------------
- // ListaSensori
- // --------------------------------------------------------------------------------
- struct ListaSensoriView: View {
- @State private var <#items#> = Array<<#Type#>>()
- @State private var <#selectedItem#>: <#Type#>?
- var body: some View {
- List {
- ForEach(<#items#>) { <#item#> in
- CustomCell()
- .listRowInsets(EdgeInsets())
- .contentShape(Rectangle())
- .modifier(SelectionModifier(checked: <#selectedItem#> == <#item#>))
- .onTapGesture {
- <#selectedItem#> = <#item#>
- }
- CustomCellSensor()
- .listRowInsets(EdgeInsets())
- .contentShape(Rectangle())
- .modifier(SelectionModifier(checked: <#selectedItem#> == <#item#>))
- .onTapGesture {
- <#selectedItem#> = <#item#>
- }
- CustomCellPushButton()
- .listRowInsets(EdgeInsets())
- .contentShape(Rectangle())
- .modifier(SelectionModifier(checked: <#selectedItem#> == <#item#>))
- .onTapGesture {
- <#selectedItem#> = <#item#>
- }
- CustomCellPwmSlider()
- .listRowInsets(EdgeInsets())
- .contentShape(Rectangle())
- .modifier(SelectionModifier(checked: <#selectedItem#> == <#item#>))
- .onTapGesture {
- <#selectedItem#> = <#item#>
- }
- CustomCellTimer()
- .listRowInsets(EdgeInsets())
- .contentShape(Rectangle())
- .modifier(SelectionModifier(checked: <#selectedItem#> == <#item#>))
- .onTapGesture {
- <#selectedItem#> = <#item#>
- }
- CustomCellBlinds()
- .listRowInsets(EdgeInsets())
- .contentShape(Rectangle())
- .modifier(SelectionModifier(checked: <#selectedItem#> == <#item#>))
- .onTapGesture {
- <#selectedItem#> = <#item#>
- }
- }
- }
- .introspectTableView(customize: { tableView in
- tableView.alwaysBounceHorizontal = true
- tableView.alwaysBounceVertical = true
- tableView.clipsToBounds = true
- })
- .frame(dynamicWidth: 414, dynamicHeight: 808)
- .listStyle(.plain)
- }
- }
- struct ListaSensoriView_Previews: PreviewProvider {
- static var previews: some View {
- ListaSensoriView()
- }
- }
- // --------------------------------------------------------------------------------
- // Debug_json
- // --------------------------------------------------------------------------------
- struct Debug_jsonView: View {
- @State private var <#items#> = Array<<#Type#>>()
- @State private var <#selectedItem#>: <#Type#>?
- var body: some View {
- List {
- ForEach(<#items#>) { <#item#> in
- DebugListCell()
- .listRowInsets(EdgeInsets())
- .contentShape(Rectangle())
- .modifier(SelectionModifier(checked: <#selectedItem#> == <#item#>))
- .onTapGesture {
- <#selectedItem#> = <#item#>
- }
- }
- }
- .introspectTableView(customize: { tableView in
- tableView.alwaysBounceHorizontal = true
- tableView.alwaysBounceVertical = true
- tableView.clipsToBounds = true
- tableView.separatorStyle = .default
- })
- .frame(dynamicWidth: 414, dynamicHeight: 808)
- .listStyle(.plain)
- }
- }
- struct Debug_jsonView_Previews: PreviewProvider {
- static var previews: some View {
- Debug_jsonView()
- }
- }
- // --------------------------------------------------------------------------------
- // Language
- // --------------------------------------------------------------------------------
- struct LanguageView: View {
- @State private var <#items#> = Array<<#Type#>>()
- @State private var <#selectedItem#>: <#Type#>?
- var body: some View {
- List {
- ForEach(<#items#>) { <#item#> in
- LanguageCell()
- .listRowInsets(EdgeInsets())
- .contentShape(Rectangle())
- .modifier(SelectionModifier(checked: <#selectedItem#> == <#item#>))
- .onTapGesture {
- <#selectedItem#> = <#item#>
- }
- }
- }
- .introspectTableView(customize: { tableView in
- tableView.alwaysBounceHorizontal = true
- tableView.alwaysBounceVertical = true
- tableView.clipsToBounds = true
- })
- .frame(dynamicWidth: 414, dynamicHeight: 896)
- .listStyle(.grouped)
- }
- }
- struct LanguageView_Previews: PreviewProvider {
- static var previews: some View {
- LanguageView()
- }
- }
- // --------------------------------------------------------------------------------
- // NewSensorListTableController
- // --------------------------------------------------------------------------------
- struct NewSensorListTableView: View {
- @State private var <#items#> = Array<<#Type#>>()
- @State private var <#selectedItem#>: <#Type#>?
- var body: some View {
- List {
- ForEach(<#items#>) { <#item#> in
- NewSensorListCell()
- .listRowInsets(EdgeInsets())
- .contentShape(Rectangle())
- .modifier(SelectionModifier(checked: <#selectedItem#> == <#item#>))
- .onTapGesture {
- <#selectedItem#> = <#item#>
- }
- }
- }
- .introspectTableView(customize: { tableView in
- tableView.alwaysBounceHorizontal = true
- tableView.alwaysBounceVertical = true
- tableView.clipsToBounds = true
- tableView.separatorStyle = .default
- })
- .frame(dynamicWidth: 414, dynamicHeight: 808)
- .listStyle(.plain)
- }
- }
- struct NewSensorListTableView_Previews: PreviewProvider {
- static var previews: some View {
- NewSensorListTableView()
- }
- }
- // --------------------------------------------------------------------------------
- // AndruinoServerPhp
- // --------------------------------------------------------------------------------
- struct AndruinoServerPhpView: View {
- @State private var <#items#> = Array<<#Type#>>()
- var body: some View {
- List {
- ForEach(<#items#>) { <#item#> in
- // It seems that you do not have a UITableViewCell added from the storyboard.
- // If you have added the TableViewCell through a XiB, please convert the XiB and copy the result here.
- }
- }
- .introspectTableView(customize: { tableView in
- tableView.alwaysBounceHorizontal = true
- tableView.alwaysBounceVertical = true
- tableView.clipsToBounds = true
- tableView.separatorStyle = .none
- })
- .frame(dynamicWidth: 414, dynamicHeight: 896)
- .listStyle(.plain)
- }
- }
- struct AndruinoServerPhpView_Previews: PreviewProvider {
- static var previews: some View {
- AndruinoServerPhpView()
- }
- }
- // --------------------------------------------------------------------------------
- // Configuration
- // --------------------------------------------------------------------------------
- struct ConfigurationView: View {
- @State private var <#items#> = Array<<#Type#>>()
- @State private var <#selectedItem#>: <#Type#>?
- var body: some View {
- List {
- ForEach(<#items#>) { <#item#> in
- // It seems that you do not have a UITableViewCell added from the storyboard.
- // If you have added the TableViewCell through a XiB, please convert the XiB and copy the result here.
- }
- }
- .introspectTableView(customize: { tableView in
- tableView.alwaysBounceHorizontal = true
- tableView.alwaysBounceVertical = true
- tableView.clipsToBounds = true
- tableView.separatorStyle = .none
- })
- .frame(dynamicWidth: 320, dynamicHeight: 632)
- .listStyle(.plain)
- }
- }
- struct ConfigurationView_Previews: PreviewProvider {
- static var previews: some View {
- ConfigurationView()
- }
- }
- // --------------------------------------------------------------------------------
- // LoggerTableController
- // --------------------------------------------------------------------------------
- struct LoggerTableView: View {
- @State private var <#items#> = Array<<#Type#>>()
- @State private var <#selectedItem#>: <#Type#>?
- var body: some View {
- List {
- ForEach(<#items#>) { <#item#> in
- LoggerCell()
- .listRowInsets(EdgeInsets())
- .contentShape(Rectangle())
- .modifier(SelectionModifier(checked: <#selectedItem#> == <#item#>))
- .onTapGesture {
- <#selectedItem#> = <#item#>
- }
- }
- }
- .introspectTableView(customize: { tableView in
- tableView.alwaysBounceHorizontal = true
- tableView.alwaysBounceVertical = true
- tableView.clipsToBounds = true
- tableView.separatorStyle = .default
- })
- .frame(dynamicWidth: 414, dynamicHeight: 896)
- .listStyle(.plain)
- }
- }
- struct LoggerTableView_Previews: PreviewProvider {
- static var previews: some View {
- LoggerTableView()
- }
- }
- // --------------------------------------------------------------------------------
- // LoggerTableCtrlSensors
- // --------------------------------------------------------------------------------
- struct LoggerTableCtrlSensorsView: View {
- @State private var <#items#> = Array<<#Type#>>()
- @State private var <#selectedItem#>: <#Type#>?
- var body: some View {
- List {
- ForEach(<#items#>) { <#item#> in
- LoggerSensorCell()
- .listRowInsets(EdgeInsets())
- .contentShape(Rectangle())
- .modifier(SelectionModifier(checked: <#selectedItem#> == <#item#>))
- .onTapGesture {
- <#selectedItem#> = <#item#>
- }
- }
- }
- .introspectTableView(customize: { tableView in
- tableView.alwaysBounceHorizontal = true
- tableView.alwaysBounceVertical = true
- tableView.clipsToBounds = true
- tableView.separatorStyle = .default
- })
- .frame(dynamicWidth: 414, dynamicHeight: 896)
- .listStyle(.plain)
- }
- }
- struct LoggerTableCtrlSensorsView_Previews: PreviewProvider {
- static var previews: some View {
- LoggerTableCtrlSensorsView()
- }
- }
- // --------------------------------------------------------------------------------
- // FormulaSensore
- // --------------------------------------------------------------------------------
- struct FormulaSensoreView: View {
- @State private var <#items#> = Array<<#Type#>>()
- var body: some View {
- List {
- ForEach(<#items#>) { <#item#> in
- // It seems that you do not have a UITableViewCell added from the storyboard.
- // If you have added the TableViewCell through a XiB, please convert the XiB and copy the result here.
- }
- }
- .introspectTableView(customize: { tableView in
- tableView.alwaysBounceHorizontal = true
- tableView.alwaysBounceVertical = true
- tableView.clipsToBounds = true
- tableView.separatorStyle = .default
- })
- .frame(dynamicWidth: 414, dynamicHeight: 808)
- .listStyle(.plain)
- }
- }
- struct FormulaSensoreView_Previews: PreviewProvider {
- static var previews: some View {
- FormulaSensoreView()
- }
- }
- // --------------------------------------------------------------------------------
- // PreferenzeSensore
- // --------------------------------------------------------------------------------
- struct PreferenzeSensoreView: View {
- @State private var <#items#> = Array<<#Type#>>()
- var body: some View {
- List {
- ForEach(<#items#>) { <#item#> in
- // It seems that you do not have a UITableViewCell added from the storyboard.
- // If you have added the TableViewCell through a XiB, please convert the XiB and copy the result here.
- }
- }
- .introspectTableView(customize: { tableView in
- tableView.alwaysBounceHorizontal = true
- tableView.alwaysBounceVertical = true
- tableView.clipsToBounds = true
- tableView.separatorStyle = .default
- })
- .frame(dynamicWidth: 320, dynamicHeight: 912)
- .listStyle(.plain)
- }
- }
- struct PreferenzeSensoreView_Previews: PreviewProvider {
- static var previews: some View {
- PreferenzeSensoreView()
- }
- }
- // --------------------------------------------------------------------------------
- // SensorInfo
- // --------------------------------------------------------------------------------
- struct SensorInfoView: View {
- @State private var <#items#> = Array<<#Type#>>()
- @State private var <#selectedItem#>: <#Type#>?
- var body: some View {
- List {
- ForEach(<#items#>) { <#item#> in
- // It seems that you do not have a UITableViewCell added from the storyboard.
- // If you have added the TableViewCell through a XiB, please convert the XiB and copy the result here.
- }
- }
- .introspectTableView(customize: { tableView in
- tableView.alwaysBounceHorizontal = true
- tableView.alwaysBounceVertical = true
- tableView.clipsToBounds = true
- tableView.separatorStyle = .default
- })
- .frame(dynamicWidth: 414, dynamicHeight: 808)
- .listStyle(.plain)
- }
- }
- struct SensorInfoView_Previews: PreviewProvider {
- static var previews: some View {
- SensorInfoView()
- }
- }
- // --------------------------------------------------------------------------------
- // ListaGiorniSettamana
- // --------------------------------------------------------------------------------
- struct ListaGiorniSettamanaView: View {
- @State private var <#items#> = Array<<#Type#>>()
- @State private var <#selectedItem#>: <#Type#>?
- var body: some View {
- List {
- ForEach(<#items#>) { <#item#> in
- LanguageCell()
- .listRowInsets(EdgeInsets())
- .contentShape(Rectangle())
- .modifier(SelectionModifier(checked: <#selectedItem#> == <#item#>))
- .onTapGesture {
- <#selectedItem#> = <#item#>
- }
- }
- }
- .introspectTableView(customize: { tableView in
- tableView.alwaysBounceHorizontal = true
- tableView.alwaysBounceVertical = true
- tableView.clipsToBounds = true
- })
- .frame(dynamicWidth: 414, dynamicHeight: 808)
- .listStyle(.grouped)
- }
- }
- struct ListaGiorniSettamanaView_Previews: PreviewProvider {
- static var previews: some View {
- ListaGiorniSettamanaView()
- }
- }
- // --------------------------------------------------------------------------------
- // GraphView_config
- // --------------------------------------------------------------------------------
- struct GraphView_configView: View {
- @State private var <#items#> = Array<<#Type#>>()
- var body: some View {
- List {
- ForEach(<#items#>) { <#item#> in
- // It seems that you do not have a UITableViewCell added from the storyboard.
- // If you have added the TableViewCell through a XiB, please convert the XiB and copy the result here.
- }
- }
- .introspectTableView(customize: { tableView in
- tableView.alwaysBounceHorizontal = true
- tableView.alwaysBounceVertical = true
- tableView.clipsToBounds = true
- })
- .frame(dynamicWidth: 414, dynamicHeight: 764)
- .listStyle(.plain)
- }
- }
- struct GraphView_configView_Previews: PreviewProvider {
- static var previews: some View {
- GraphView_configView()
- }
- }
- // --------------------------------------------------------------------------------
- // VariabileSlider
- // --------------------------------------------------------------------------------
- struct VariabileSliderView: View {
- @State private var <#items#> = Array<<#Type#>>()
- var body: some View {
- List {
- ForEach(<#items#>) { <#item#> in
- // It seems that you do not have a UITableViewCell added from the storyboard.
- // If you have added the TableViewCell through a XiB, please convert the XiB and copy the result here.
- }
- }
- .introspectTableView(customize: { tableView in
- tableView.alwaysBounceHorizontal = true
- tableView.alwaysBounceVertical = true
- tableView.clipsToBounds = true
- tableView.separatorStyle = .default
- })
- .frame(dynamicWidth: 414, dynamicHeight: 808)
- .listStyle(.plain)
- }
- }
- struct VariabileSliderView_Previews: PreviewProvider {
- static var previews: some View {
- VariabileSliderView()
- }
- }
- // --------------------------------------------------------------------------------
- // SensoreDigitale
- // --------------------------------------------------------------------------------
- struct SensoreDigitaleView: View {
- @State private var <#items#> = Array<<#Type#>>()
- var body: some View {
- List {
- ForEach(<#items#>) { <#item#> in
- // It seems that you do not have a UITableViewCell added from the storyboard.
- // If you have added the TableViewCell through a XiB, please convert the XiB and copy the result here.
- }
- }
- .introspectTableView(customize: { tableView in
- tableView.alwaysBounceHorizontal = true
- tableView.alwaysBounceVertical = true
- tableView.clipsToBounds = true
- tableView.separatorStyle = .default
- })
- .frame(dynamicWidth: 414, dynamicHeight: 808)
- .listStyle(.plain)
- }
- }
- struct SensoreDigitaleView_Previews: PreviewProvider {
- static var previews: some View {
- SensoreDigitaleView()
- }
- }
- // --------------------------------------------------------------------------------
- // AppConfig
- // --------------------------------------------------------------------------------
- struct AppConfigView: View {
- @State private var <#items#> = Array<<#Type#>>()
- var body: some View {
- List {
- ForEach(<#items#>) { <#item#> in
- // It seems that you do not have a UITableViewCell added from the storyboard.
- // If you have added the TableViewCell through a XiB, please convert the XiB and copy the result here.
- }
- }
- .introspectTableView(customize: { tableView in
- tableView.alwaysBounceHorizontal = true
- tableView.alwaysBounceVertical = true
- tableView.clipsToBounds = true
- tableView.separatorStyle = .default
- })
- .frame(dynamicWidth: 320, dynamicHeight: 1000)
- .listStyle(.plain)
- }
- }
- struct AppConfigView_Previews: PreviewProvider {
- static var previews: some View {
- AppConfigView()
- }
- }
- // --------------------------------------------------------------------------------
- // BoardListTableController
- // --------------------------------------------------------------------------------
- struct BoardListTableView: View {
- @State private var <#items#> = Array<<#Type#>>()
- @State private var <#selectedItem#>: <#Type#>?
- var body: some View {
- List {
- ForEach(<#items#>) { <#item#> in
- BoardListCell()
- .listRowInsets(EdgeInsets())
- .contentShape(Rectangle())
- .modifier(SelectionModifier(checked: <#selectedItem#> == <#item#>))
- .onTapGesture {
- <#selectedItem#> = <#item#>
- }
- }
- }
- .introspectTableView(customize: { tableView in
- tableView.alwaysBounceHorizontal = true
- tableView.alwaysBounceVertical = true
- tableView.clipsToBounds = true
- tableView.separatorStyle = .default
- })
- .frame(dynamicWidth: 414, dynamicHeight: 808)
- .listStyle(.plain)
- }
- }
- struct BoardListTableView_Previews: PreviewProvider {
- static var previews: some View {
- BoardListTableView()
- }
- }
- // --------------------------------------------------------------------------------
- // SensorListTableController
- // --------------------------------------------------------------------------------
- struct SensorListTableView: View {
- @State private var <#items#> = Array<<#Type#>>()
- @State private var <#selectedItem#>: <#Type#>?
- var body: some View {
- List {
- ForEach(<#items#>) { <#item#> in
- SensorListCell()
- .listRowInsets(EdgeInsets())
- .contentShape(Rectangle())
- .modifier(SelectionModifier(checked: <#selectedItem#> == <#item#>))
- .onTapGesture {
- <#selectedItem#> = <#item#>
- }
- }
- }
- .introspectTableView(customize: { tableView in
- tableView.alwaysBounceHorizontal = true
- tableView.alwaysBounceVertical = true
- tableView.clipsToBounds = true
- tableView.separatorStyle = .default
- })
- .frame(dynamicWidth: 414, dynamicHeight: 808)
- .listStyle(.plain)
- }
- }
- struct SensorListTableView_Previews: PreviewProvider {
- static var previews: some View {
- SensorListTableView()
- }
- }
- // --------------------------------------------------------------------------------
- // TabBarController
- // --------------------------------------------------------------------------------
- struct TabBarView: View {
- var body: some View {
- TabView {
- MappaSensoriView()
- .tabItem {
- VStack {
- Image("home38")
- Text("Map")
- }
- }
- ()
- .tabItem {
- VStack {
- Image("list38")
- Text("List")
- }
- }
- AmbientiListTableView()
- .tabItem {
- VStack {
- Image("4case")
- Text("Ambients")
- }
- }
- ()
- .tabItem {
- VStack {
- Image("setting38")
- Text("Settings")
- }
- }
- ()
- .tabItem {
- VStack {
- Image("iot")
- Text("Arduino boards")
- }
- }
- ()
- .tabItem {
- VStack {
- Image("sensori")
- Text("Global sensors list")
- }
- }
- ()
- .tabItem {
- VStack {
- Image("graph3_38")
- Text("Graphs")
- }
- }
- }
- .introspectTabBarController(customize: { tabBarController in
- tabBarController.tabBar.backgroundColor = UIColor(red: 0.0, green: 0.0, blue: 0.0, alpha: 0.0)
- })
- }
- }
- // --------------------------------------------------------------------------------
- // GraphTabBViewController
- // --------------------------------------------------------------------------------
- struct GraphTabBView: View {
- var body: some View {
- TabView {
- GraphView()
- .tabItem {
- VStack {
- Image("graph3_38")
- Text("Graph")
- }
- }
- ()
- .tabItem {
- VStack {
- Image("setting38")
- Text("Configuration")
- }
- }
- }
- .introspectTabBarController(customize: { tabBarController in
- tabBarController.tabBar.isTranslucent = false
- })
- }
- }
- // --------------------------------------------------------------------------------
- // AmbientiListCell
- // --------------------------------------------------------------------------------
- struct AmbientiListCell: View {
- var body: some View {
- Text("Label")
- .frame(dynamicWidth: 291, dynamicHeight: 23, alignment: .leading)
- .font(.system(size: 24, weight: .regular))
- .offset(dynamicX: 92, dynamicY: 9)
- Text("Label")
- .frame(dynamicWidth: 262, dynamicHeight: 19, alignment: .leading)
- .font(.system(size: 15, weight: .regular))
- .foregroundColor(Color(red: 1.0, green: 0.58431375, blue: 0.0))
- .offset(dynamicX: 113, dynamicY: 62)
- Image("CasaDefault2")
- .resizable()
- .aspectRatio(contentMode: .fill)
- .frame(dynamicWidth: 70, dynamicHeight: 70)
- .clipped()
- .offset(dynamicX: 9, dynamicY: 10)
- Text("Label")
- .frame(dynamicWidth: 262, dynamicHeight: 19, alignment: .leading)
- .font(.system(size: 15, weight: .regular))
- .foregroundColor(Color(red: 1.0, green: 0.58431375, blue: 0.0))
- .offset(dynamicX: 113, dynamicY: 36)
- }
- }
- // --------------------------------------------------------------------------------
- // ColorsCell
- // --------------------------------------------------------------------------------
- struct ColorsCell: View {
- var body: some View {
- Text("Label")
- .frame(dynamicWidth: 1294, dynamicHeight: 1000, alignment: .leading)
- .font(.system(size: 17, weight: .regular))
- }
- }
- // --------------------------------------------------------------------------------
- // CustomCell
- // --------------------------------------------------------------------------------
- struct CustomCell: View {
- var body: some View {
- Text("11:50")
- .frame(dynamicWidth: 167, dynamicHeight: 24, alignment: .leading)
- .clipped()
- .font(.system(size: 15, weight: .regular))
- .offset(dynamicX: 237, dynamicY: 57)
- Text("dig0")
- .frame(dynamicWidth: 184, dynamicHeight: 24, alignment: .leading)
- .clipped()
- .font(.system(size: 14, weight: .regular))
- .offset(dynamicX: 8, dynamicY: 57)
- .opacity(0.75)
- // TODO: Unsupported element class: UIActivityindicatorView
- Image("clock")
- .resizable()
- .frame(dynamicWidth: 22, dynamicHeight: 22)
- .offset(dynamicX: 244, dynamicY: 33)
- Image("5_battery_5_color_3d")
- .resizable()
- .aspectRatio(contentMode: .fit)
- .frame(dynamicWidth: 17, dynamicHeight: 17)
- .offset(dynamicX: 23, dynamicY: 34)
- Image("rf_no_signal3")
- .resizable()
- .aspectRatio(contentMode: .fit)
- .frame(dynamicWidth: 15, dynamicHeight: 15)
- .offset(dynamicX: 5, dynamicY: 35)
- Text("Name")
- .frame(dynamicWidth: 223, dynamicHeight: 25, alignment: .leading)
- .clipped()
- .font(.system(size: 20, weight: .bold))
- .offset(dynamicX: 3, dynamicY: 5)
- Image("crono2")
- .resizable()
- .frame(dynamicWidth: 20, dynamicHeight: 20)
- .offset(dynamicX: 149, dynamicY: 33)
- Toggle(isOn: $SwitchCell, label: {})
- .frame(dynamicWidth: 52, dynamicHeight: 31, alignment: .topLeading)
- .offset(dynamicX: 304, dynamicY: 28)
- .aspectRatio(contentMode: .fill)
- .labelsHidden()
- Text("Low")
- .frame(dynamicWidth: 144, dynamicHeight: 40, alignment: .trailing)
- .clipped()
- .font(.system(size: 18, weight: .bold))
- .multilineTextAlignment(.trailing)
- .offset(dynamicX: 260, dynamicY: -4)
- }
- }
- // --------------------------------------------------------------------------------
- // CustomCellSensor
- // --------------------------------------------------------------------------------
- struct CustomCellSensor: View {
- var body: some View {
- Text("L: 21")
- .frame(dynamicWidth: 174, dynamicHeight: 21, alignment: .trailing)
- .clipped()
- .font(.system(size: 15, weight: .regular))
- .multilineTextAlignment(.trailing)
- .offset(dynamicX: 162, dynamicY: 49)
- .opacity(0.6)
- Text("16 C°")
- .frame(dynamicWidth: 104, dynamicHeight: 42, alignment: .trailing)
- .clipped()
- .font(.system(size: 18, weight: .bold))
- .multilineTextAlignment(.trailing)
- .offset(dynamicX: 300, dynamicY: -3)
- Image("link3")
- .resizable()
- .frame(dynamicWidth: 15, dynamicHeight: 15)
- .offset(dynamicX: 48, dynamicY: 29)
- Text("var55")
- .frame(dynamicWidth: 186, dynamicHeight: 22, alignment: .leading)
- .clipped()
- .font(.system(size: 14, weight: .regular))
- .offset(dynamicX: 8, dynamicY: 48)
- .opacity(0.75)
- Text("Name")
- .frame(dynamicWidth: 249, dynamicHeight: 25, alignment: .leading)
- .clipped()
- .font(.system(size: 20, weight: .bold))
- .offset(dynamicX: 3, dynamicY: 5)
- Text("H: 28")
- .frame(dynamicWidth: 174, dynamicHeight: 21, alignment: .trailing)
- .clipped()
- .font(.system(size: 15, weight: .regular))
- .multilineTextAlignment(.trailing)
- .offset(dynamicX: 162, dynamicY: -1)
- .opacity(0.6)
- Image("rf_no_signal3")
- .resizable()
- .aspectRatio(contentMode: .fit)
- .frame(dynamicWidth: 15, dynamicHeight: 15)
- .offset(dynamicX: 5, dynamicY: 29)
- Image("5_battery_5_color_3d")
- .resizable()
- .aspectRatio(contentMode: .fit)
- .frame(dynamicWidth: 17, dynamicHeight: 17)
- .offset(dynamicX: 23, dynamicY: 29)
- Button(action: {
- GraphIconAction()
- }) {
- Image("graph5").layoutPriority(1.0)
- .frame(dynamicWidth: 40, dynamicHeight: 40, alignment: .center)
- }
- .aspectRatio(contentMode: .fill)
- .foregroundColor(Color.white)
- .offset(dynamicX: 360, dynamicY: 30)
- .opacity(0.8)
- Stepper(value: $IncrementaLimite, in: -0.5...0.5, step: 0.5, label: {})
- .introspectStepper(customize: { stepper in
- stepper.autorepeat = true
- stepper.isContinuous = true
- })
- .frame(dynamicWidth: 96, dynamicHeight: 29)
- .offset(dynamicX: 205, dynamicY: 18)
- .labelsHidden()
- .opacity(0.75)
- Text("dig5")
- .frame(dynamicWidth: 43, dynamicHeight: 21, alignment: .leading)
- .clipped()
- .font(.system(size: 12, weight: .regular))
- .offset(dynamicX: 71, dynamicY: 9)
- }
- }
- // --------------------------------------------------------------------------------
- // CustomCellPushButton
- // --------------------------------------------------------------------------------
- struct CustomCellPushButton: View {
- var body: some View {
- Text("Name")
- .frame(dynamicWidth: 218, dynamicHeight: 25, alignment: .leading)
- .clipped()
- .font(.system(size: 20, weight: .bold))
- .offset(dynamicX: 3, dynamicY: 5)
- Text("Label")
- .frame(dynamicWidth: 111, dynamicHeight: 23, alignment: .leading)
- .clipped()
- .font(.system(size: 14, weight: .regular))
- .offset(dynamicX: 8, dynamicY: 43)
- .opacity(0.75)
- Text("Low")
- .frame(dynamicWidth: 144, dynamicHeight: 40, alignment: .trailing)
- .clipped()
- .font(.system(size: 18, weight: .bold))
- .multilineTextAlignment(.trailing)
- .offset(dynamicX: 260, dynamicY: -4)
- // TODO: Unsupported element class: UIActivityindicatorView
- Text("11:50")
- .frame(dynamicWidth: 143, dynamicHeight: 24, alignment: .leading)
- .clipped()
- .font(.system(size: 15, weight: .regular))
- .offset(dynamicX: 122, dynamicY: 60)
- Image("clock")
- .resizable()
- .frame(dynamicWidth: 22, dynamicHeight: 22)
- .offset(dynamicX: 129, dynamicY: 28)
- Button(action: {
- PushButtonCellAction()
- }) {
- Image("P_pulsante3.png").foregroundColor(Color(red: 0.1352964, green: 1.0, blue: 0.024918795)).layoutPriority(1.0)
- .frame(dynamicWidth: 44, dynamicHeight: 44, alignment: .center)
- }
- .aspectRatio(contentMode: .fill)
- .foregroundColor(Color.white)
- .offset(dynamicX: 307, dynamicY: 32)
- }
- }
- // --------------------------------------------------------------------------------
- // CustomCellPwmSlider
- // --------------------------------------------------------------------------------
- struct CustomCellPwmSlider: View {
- var body: some View {
- Text("Name")
- .frame(dynamicWidth: 400, dynamicHeight: 25, alignment: .leading)
- .clipped()
- .font(.system(size: 20, weight: .bold))
- .offset(dynamicX: 3, dynamicY: 7)
- Text("Label")
- .frame(dynamicWidth: 172, dynamicHeight: 23, alignment: .leading)
- .clipped()
- .font(.system(size: 14, weight: .regular))
- .offset(dynamicX: 8, dynamicY: 64)
- .opacity(0.75)
- Text("10%")
- .frame(dynamicWidth: 144, dynamicHeight: 40, alignment: .trailing)
- .clipped()
- .font(.system(size: 18, weight: .bold))
- .multilineTextAlignment(.trailing)
- .offset(dynamicX: 260, dynamicY: -3)
- Slider(value: $Slider, in: 0.0...255, step: 2.55)
- .introspectSlider(customize: { slider in
- slider.isContinuous = true
- })
- .frame(dynamicWidth: 346, dynamicHeight: 29)
- .offset(dynamicX: 54, dynamicY: 33)
- // TODO: Unsupported element class: UIActivityindicatorView
- }
- }
- // --------------------------------------------------------------------------------
- // CustomCellTimer
- // --------------------------------------------------------------------------------
- struct CustomCellTimer: View {
- var body: some View {
- Text("Name")
- .frame(dynamicWidth: 301, dynamicHeight: 25, alignment: .leading)
- .clipped()
- .font(.system(size: 20, weight: .bold))
- .offset(dynamicX: 3, dynamicY: 5)
- Text("Label")
- .frame(dynamicWidth: 173, dynamicHeight: 23, alignment: .leading)
- .clipped()
- .font(.system(size: 14, weight: .regular))
- .offset(dynamicX: 8, dynamicY: 43)
- .opacity(0.75)
- Text("0")
- .frame(dynamicWidth: 130, dynamicHeight: 40, alignment: .trailing)
- .clipped()
- .font(.system(size: 18, weight: .bold))
- .multilineTextAlignment(.trailing)
- .offset(dynamicX: 274, dynamicY: -2)
- Text("Timer Lun Mart Merc Giov")
- .frame(dynamicWidth: 167, dynamicHeight: 24, alignment: .leading)
- .font(.system(size: 16, weight: .regular))
- .offset(dynamicX: 237, dynamicY: 58)
- Image("clock")
- .resizable()
- .frame(dynamicWidth: 44, dynamicHeight: 41)
- .offset(dynamicX: 307, dynamicY: 23)
- }
- }
- // --------------------------------------------------------------------------------
- // CustomCellBlinds
- // --------------------------------------------------------------------------------
- struct CustomCellBlinds: View {
- var body: some View {
- Text("Name")
- .frame(dynamicWidth: 207, dynamicHeight: 25, alignment: .leading)
- .clipped()
- .font(.system(size: 20, weight: .bold))
- .offset(dynamicX: 3, dynamicY: 5)
- Text("Label")
- .frame(dynamicWidth: 172, dynamicHeight: 23, alignment: .leading)
- .clipped()
- .font(.system(size: 14, weight: .regular))
- .offset(dynamicX: 8, dynamicY: 60)
- .opacity(0.75)
- Text("0")
- .frame(dynamicWidth: 185, dynamicHeight: 26, alignment: .trailing)
- .clipped()
- .font(.system(size: 18, weight: .bold))
- .multilineTextAlignment(.trailing)
- .offset(dynamicX: 219, dynamicY: 60)
- Text("0")
- .frame(dynamicWidth: 185, dynamicHeight: 26, alignment: .trailing)
- .clipped()
- .font(.system(size: 18, weight: .bold))
- .multilineTextAlignment(.trailing)
- .offset(dynamicX: 219, dynamicY: 5)
- //Picker("", selection: $bindingVariable) {}
- // TODO: Unsupported element class: UIActivityindicatorView
- }
- }
- // --------------------------------------------------------------------------------
- // DebugListCell
- // --------------------------------------------------------------------------------
- struct DebugListCell: View {
- var body: some View {
- Text("destra destra destra")
- .frame(dynamicWidth: 193, dynamicHeight: 21, alignment: .trailing)
- .font(.system(size: 17, weight: .regular))
- .multilineTextAlignment(.trailing)
- .offset(dynamicX: 205, dynamicY: 14)
- Text("Sinistra label")
- .frame(dynamicWidth: 348, dynamicHeight: 21, alignment: .leading)
- .font(.system(size: 17, weight: .regular))
- .offset(dynamicX: 11, dynamicY: 15)
- Toggle(isOn: $interruttore, label: {})
- .frame(dynamicWidth: 49, dynamicHeight: 31, alignment: .topLeading)
- .offset(dynamicX: 346, dynamicY: 9)
- .aspectRatio(contentMode: .fill)
- .labelsHidden()
- }
- }
- // --------------------------------------------------------------------------------
- // LanguageCell
- // --------------------------------------------------------------------------------
- struct LanguageCell: View {
- var body: some View {
- Text("Label")
- .frame(dynamicWidth: 207, dynamicHeight: 21, alignment: .leading)
- .clipped()
- .font(.system(size: 17, weight: .regular))
- .offset(dynamicX: 53, dynamicY: 11)
- Image("En")
- .resizable()
- .frame(dynamicWidth: 33, dynamicHeight: 33)
- .offset(dynamicX: 9, dynamicY: 5)
- }
- }
- // --------------------------------------------------------------------------------
- // NewSensorListCell
- // --------------------------------------------------------------------------------
- struct NewSensorListCell: View {
- var body: some View {
- Image("dht22")
- .resizable()
- .aspectRatio(contentMode: .fit)
- .frame(dynamicWidth: 60, dynamicHeight: 60)
- .offset(dynamicX: 8, dynamicY: 11)
- Text("Tipo_sensore")
- .frame(dynamicWidth: 302, dynamicHeight: 21, alignment: .leading)
- .font(.system(size: 17, weight: .regular))
- .offset(dynamicX: 76, dynamicY: 31)
- Text("Mode")
- .frame(dynamicWidth: 110, dynamicHeight: 21, alignment: .leading)
- .font(.system(size: 15, weight: .regular))
- .foregroundColor(Color(red: 1.0, green: 0.23137255, blue: 0.1882353))
- .offset(dynamicX: 90, dynamicY: 58)
- Text("Mode")
- .frame(dynamicWidth: 132, dynamicHeight: 21, alignment: .trailing)
- .font(.system(size: 15, weight: .regular))
- .multilineTextAlignment(.trailing)
- .foregroundColor(Color(red: 1.0, green: 0.58431375, blue: 0.0))
- .offset(dynamicX: 226, dynamicY: 58)
- }
- }
- // --------------------------------------------------------------------------------
- // LoggerCell
- // --------------------------------------------------------------------------------
- struct LoggerCell: View {
- var body: some View {
- Text("Home ambient")
- .frame(dynamicWidth: 369, dynamicHeight: 24, alignment: .leading)
- .font(.system(size: 20, weight: .regular))
- .offset(dynamicX: 15, dynamicY: 8)
- Text("Label")
- .frame(dynamicWidth: 333, dynamicHeight: 21, alignment: .leading)
- .font(.system(size: 14, weight: .regular))
- .foregroundColor(Color(red: 1.0, green: 0.23137255, blue: 0.1882353))
- .offset(dynamicX: 23, dynamicY: 32)
- Text("Last connection:")
- .frame(dynamicWidth: 310, dynamicHeight: 21, alignment: .leading)
- .font(.system(size: 14, weight: .regular))
- .foregroundColor(Color(red: 1.0, green: 0.58431375, blue: 0.0))
- .offset(dynamicX: 23, dynamicY: 54)
- Text("Last connection:")
- .frame(dynamicWidth: 251, dynamicHeight: 21, alignment: .leading)
- .font(.system(size: 14, weight: .regular))
- .foregroundColor(Color(red: 1.0, green: 0.58431375, blue: 0.0))
- .offset(dynamicX: 188, dynamicY: 36)
- .hidden()
- }
- }
- // --------------------------------------------------------------------------------
- // LoggerSensorCell
- // --------------------------------------------------------------------------------
- struct LoggerSensorCell: View {
- var body: some View {
- Text("Label")
- .frame(dynamicWidth: 373, dynamicHeight: 21, alignment: .leading)
- .font(.system(size: 17, weight: .regular))
- .offset(dynamicX: 15, dynamicY: 10)
- Image("arrow-back-512")
- .resizable()
- .frame(dynamicWidth: 20, dynamicHeight: 20)
- .offset(dynamicX: 15, dynamicY: 61)
- Text("Label")
- .frame(dynamicWidth: 307, dynamicHeight: 21, alignment: .leading)
- .font(.system(size: 13, weight: .regular))
- .foregroundColor(Color(red: 1.0, green: 0.58431375, blue: 0.0))
- .offset(dynamicX: 45, dynamicY: 60)
- Text("Label")
- .frame(dynamicWidth: 132, dynamicHeight: 21, alignment: .trailing)
- .font(.system(size: 17, weight: .regular))
- .multilineTextAlignment(.trailing)
- .foregroundColor(Color(red: 0.0, green: 0.47843137, blue: 1.0))
- .offset(dynamicX: 244, dynamicY: 33)
- }
- }
- // --------------------------------------------------------------------------------
- // LanguageCell
- // --------------------------------------------------------------------------------
- struct LanguageCell: View {
- var body: some View {
- Text("Title")
- .frame(dynamicWidth: 342, dynamicHeight: 44, alignment: .leading)
- .clipped()
- .font(.system(size: 18, weight: .regular))
- .offset(dynamicX: 20, dynamicY: 0)
- }
- }
- // --------------------------------------------------------------------------------
- // BoardListCell
- // --------------------------------------------------------------------------------
- struct BoardListCell: View {
- var body: some View {
- Text("Board name")
- .frame(dynamicWidth: 199, dynamicHeight: 24, alignment: .leading)
- .font(.system(size: 20, weight: .regular))
- .offset(dynamicX: 18, dynamicY: 3)
- Text("On-line")
- .frame(dynamicWidth: 307, dynamicHeight: 21, alignment: .leading)
- .font(.system(size: 14, weight: .regular))
- .foregroundColor(Color(red: 1.0, green: 0.23137255, blue: 0.1882353))
- .offset(dynamicX: 28, dynamicY: 27)
- Text("Last connection:")
- .frame(dynamicWidth: 279, dynamicHeight: 21, alignment: .leading)
- .font(.system(size: 14, weight: .regular))
- .offset(dynamicX: 48, dynamicY: 47)
- Text("Last connection:")
- .frame(dynamicWidth: 308, dynamicHeight: 21, alignment: .leading)
- .font(.system(size: 12, weight: .regular))
- .foregroundColor(Color(red: 1.0, green: 0.58431375, blue: 0.0))
- .offset(dynamicX: 48, dynamicY: 67)
- Text("Last connection:")
- .frame(dynamicWidth: 308, dynamicHeight: 21, alignment: .leading)
- .font(.system(size: 12, weight: .regular))
- .foregroundColor(Color(red: 1.0, green: 0.58431375, blue: 0.0))
- .offset(dynamicX: 48, dynamicY: 87)
- Image("wifi_strenght4")
- .resizable()
- .frame(dynamicWidth: 35, dynamicHeight: 29)
- .offset(dynamicX: 317, dynamicY: 3)
- }
- }
- // --------------------------------------------------------------------------------
- // SensorListCell
- // --------------------------------------------------------------------------------
- struct SensorListCell: View {
- var body: some View {
- Text("Sensor name")
- .frame(dynamicWidth: 167, dynamicHeight: 21, alignment: .leading)
- .font(.system(size: 19, weight: .regular))
- .offset(dynamicX: 81, dynamicY: 34)
- Text("Sensor type")
- .frame(dynamicWidth: 170, dynamicHeight: 23, alignment: .leading)
- .font(.system(size: 14, weight: .regular))
- .foregroundColor(Color(red: 1.0, green: 0.58431375, blue: 0.0))
- .offset(dynamicX: 101, dynamicY: 56)
- Image("dht22")
- .resizable()
- .aspectRatio(contentMode: .fill)
- .frame(dynamicWidth: 57, dynamicHeight: 57)
- .offset(dynamicX: 16, dynamicY: 17)
- Text("board name")
- .frame(dynamicWidth: 255, dynamicHeight: 21, alignment: .leading)
- .font(.system(size: 17, weight: .regular))
- .foregroundColor(Color(red: 0.0, green: 0.47843137, blue: 1.0))
- .offset(dynamicX: 16, dynamicY: 68)
- Text("On-line")
- .frame(dynamicWidth: 96, dynamicHeight: 21, alignment: .trailing)
- .font(.system(size: 14, weight: .regular))
- .multilineTextAlignment(.trailing)
- .foregroundColor(Color(red: 1.0, green: 0.23137255, blue: 0.1882353))
- .offset(dynamicX: 256, dynamicY: 34)
- }
- }
- // --------------------------------------------------------------------------------
- // SelectionModifier
- // --------------------------------------------------------------------------------
- struct SelectionModifier: ViewModifier {
- var checked: Bool = false
- func body(content: Content) -> some View {
- Group {
- if checked {
- content
- .background(Color(UIColor.systemGroupedBackground))
- } else {
- content
- }
- }
- }
- }
- // --------------------------------------------------------------------------------
- // Dynamic Size Helper
- // --------------------------------------------------------------------------------
- struct DynamicSize {
- static private let baseViewWidth: CGFloat = 414.0
- static private let baseViewHeight: CGFloat = 808.0
- static func getHeight(_ height: CGFloat) -> CGFloat {
- return (height / baseViewHeight) * UIScreen.main.bounds.height
- }
- static func getWidth(_ width: CGFloat) -> CGFloat {
- return (width / baseViewWidth) * UIScreen.main.bounds.width
- }
- static func getOffsetX(_ x: CGFloat) -> CGFloat {
- return (x / baseViewWidth) * UIScreen.main.bounds.width
- }
- static func getOffsetY(_ y: CGFloat) -> CGFloat {
- return (y / baseViewHeight) * UIScreen.main.bounds.height
- }
- }
- // --------------------------------------------------------------------------------
- // Frame and Offset Helper
- // --------------------------------------------------------------------------------
- extension View {
- func frame(dynamicWidth: CGFloat? = nil, dynamicHeight: CGFloat? = nil, alignment: Alignment = .center) -> some View {
- self.frame(width: DynamicSize.getWidth(dynamicWidth ?? 0), height: DynamicSize.getHeight(dynamicHeight ?? 0), alignment: alignment)
- }
- func offset(dynamicX: CGFloat = 0, dynamicY: CGFloat = 0) -> some View {
- self.offset(x: DynamicSize.getOffsetX(dynamicX), y: DynamicSize.getOffsetY(dynamicY))
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement