This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from 'react'; | |
| import './App.css'; | |
| // topics touched: component, state, conditional rendering, event handler, prevent defalut. | |
| class Toogle extends Component { | |
| constructor(props) { | |
| super(props); | |
| // the initial state of 'isToogleOn' is 'true' | |
| this.state = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Interpolación de strings en Swift */ | |
| // Interpolando una constante | |
| let miNombre = "Luciano" | |
| let stringInterpolado = "Mi nombre es \(miNombre)" | |
| print(stringInterpolado) | |
| // Imprime: "Mi nombre es Luciano" | |
| // Interpolando una expresión | |
| let suma = 2 + 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| struct ColorPickerView: View { | |
| @State private var selectedColor = Color.blue | |
| var body: some View { | |
| VStack { | |
| ColorPicker("", selection: $selectedColor).padding(.bottom) | |
| ColorRectangle(selectedColor: $selectedColor) | |
| ColorRectangle(selectedColor: $selectedColor).colorInvert() | |
| }.padding() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| struct FontSliderCatalogue: View { | |
| @State private var selectedFontIndex: Int = 0 | |
| private var allFontNames: [String] { | |
| return UIFont.familyNames.flatMap { UIFont.fontNames(forFamilyName: $0) } | |
| } | |
| var body: some View { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| import AVFoundation | |
| struct SpeechText: View { | |
| @State private var text = "" | |
| var body: some View { | |
| ZStack { | |
| Color.pink.opacity(0.5).ignoresSafeArea() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| import AVFoundation | |
| struct SpeechText: View { | |
| @State private var text = "" | |
| var body: some View { | |
| ZStack { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| import NaturalLanguage | |
| struct TaggedTextView: View { | |
| let text = "This is your life. Do what you love and do it often." | |
| let text2 = "― Holstee Manifesto, The Wedding Day (extract)" | |
| let textButton = "Tag the text" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| import NaturalLanguage | |
| struct LangRecognizerView: View { | |
| @State private var text = "" | |
| @State private var currentLangLegend = "" | |
| @State private var currentLang = "" | |
| var body: some View { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| struct DaysLived: View { | |
| @State private var userBirthday = "" | |
| @State private var userDaysLived: Int? | |
| @State private var birthdate: Date? | |
| @State private var wrongDateFormat = false | |
| let alertMessage = """ | |
| Out of range or |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import XCTest | |
| final class AsyncTests: XCTestCase { | |
| func testDownloadWebDataWithConcurrency() async { | |
| // Create a URL for a webpage to download. | |
| let url = URL(string: "https://apple.com")! // test passed! :) | |
| // let url = URL(string: "https://applexfsda.com")! // test don't passed :( | |
| // Use an asynchronous function to download the webpage. |