Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // ContentView.swift
- // Zad1.1
- //
- import SwiftUI
- struct ContentView: View {
- @State var dzien: String = ""
- @State var dzienwybor: String = ""
- var body: some View {
- VStack(alignment: .leading){
- Text("Podaj wybrany dzien tygodnia:")
- TextField("Wpisz dzien tygodnia", text: $dzien)
- Button(action: {self.dzienwybor = self.dzien}, label: {Text("Zatwierdz wybor")})
- Text("Wybrano: \(dzienwybor)")
- }.padding()
- }
- }
- struct ContentView_Previews: PreviewProvider {
- static var previews: some View {
- ContentView()
- }
- }
- //////////////////////////////////////////////////
- //
- // ContentView.swift
- // Zad1.2
- //
- import SwiftUI
- struct ContentView: View {
- @State var dzien: String = ""
- @State var dzienwybor: String = ""
- @State var dni: [String] = ["Pon", "Wt", "Sr", "Czw", "Pt", "Sb", "Nd"]
- var body: some View {
- VStack(alignment: .center){
- Text("Podaj wybrany dzien tygodnia:").foregroundColor(.green).rotation3DEffect(.degrees(45), axis: (x: 1, y: 0, z: 0))
- TextField("Wpisz dzien tygodnia", text: $dzien)
- .multilineTextAlignment(.center)
- Button(action: {if(self.dni.contains(self.dzien)){self.dzienwybor = self.dzien}}, label: {Text("Zatwierdz wybor")}).background(Color.gray)
- Text("Wybrano: \(dzienwybor)")
- }.padding()
- }
- }
- struct ContentView_Previews: PreviewProvider {
- static var previews: some View {
- ContentView()
- }
- }
- //////////////////////////////////////////////////
- // nie dziala
- // ViewController.swift
- // Lab1.3
- //
- // Created by student on 07/03/2023.
- // Copyright © 2023 PL. All rights reserved.
- //
- import UIKit
- class ViewController: UIViewController {
- @IBOutlet var Text1: UILabel!
- @IBOutlet var TextField1: UITextField!
- @IBOutlet var Text2: UILabel!
- override func viewDidLoad() {
- @IBAction func Button1(_ sender: Any) {
- }
- super.viewDidLoad()
- // Do any additional setup after loading the view.
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement