mchirico / zDaily

Playground to hack and test ideas with Zoe
1 stars 2 forks source link

Day 42: More iOS #46

Open mchirico opened 3 years ago

mchirico commented 3 years ago

Video Day 42

Take your time... go slow... you're doing this for yourself, so you want quality.

Reference

https://github.com/mchirico/iOSurl

    @State var label: String = "Nothing yet..."
    @State var txt: String = "..."
    @State var selectedDate = Date()

Code Reference


//
//  ContentView.swift
//  Day42
//
//  Created by Mike Chirico on 11/23/20.
//

import SwiftUI

struct ContentView: View {

    @State var label: String = "Nothing yet..."
    @State var txt: String = "..."
    @State var selectedDate = Date()

    var body: some View {

        Text(self.txt)
            .padding()

        TextField(/*@START_MENU_TOKEN@*/"Placeholder"/*@END_MENU_TOKEN@*/, text: $txt)
            .padding(.vertical)
            .frame(width: 300.0, height: 132.0)
            .background(Color.blue)
            .foregroundColor(Color.yellow)
            .cornerRadius(15)
            .shadow(radius: 15)
            .font(Font.custom("Avenir-Black", size: 57))

        DatePicker(selection: $selectedDate, label: { /*@START_MENU_TOKEN@*/Text("Date")/*@END_MENU_TOKEN@*/ })

        Button(action: {
            self.txt = "\(self.selectedDate)"
        }) {
            Text("button")
                .padding([.leading,.trailing],30)
                .padding([.top,.bottom],20)
                .background(Color.green)
                .foregroundColor(Color.black)
                .cornerRadius(25)
                .shadow(radius: 25)
                .font(Font.custom("Avenir-Black", size: 17))
        }

        Button(action: {
            self.txt = "\(self.selectedDate)"
        }) {
            Text("button")
                .padding([.leading,.trailing],30)
                .padding([.top,.bottom],20)
                .background(Color.green)
                .foregroundColor(Color.black)
                .cornerRadius(25)
                .shadow(radius: 25)
                .font(Font.custom("Avenir-Black", size: 17))
        }

    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}
tacomonkautobot[bot] commented 3 years ago

mchirico, Thanks for opening this issue!

mchirico commented 3 years ago

shft-ctl-cmd-4 (to capture screen)

ZoeChiri commented 3 years ago

keeps saying error

Screen Shot 2020-11-23 at 10 53 30 PM