Skip to content

Instantly share code, notes, and snippets.

View pitt500's full-sized avatar

Pedro Rojas pitt500

View GitHub Profile
import SwiftUI
struct ContentView: View {
@State private var sliderValue: Double = 0.0
@State private var backgroundColor: Color = .red
let colors: [Color] = [.red, .orange, .yellow, .green, .blue, .purple, .pink, .mint, .indigo, .teal, .cyan, .brown, .black]
var body: some View {
ZStack {
@pitt500
pitt500 / TCA_README_ES.md
Last active March 5, 2024 14:55
An Spanish translation of The Composable Architecture's README.md

The Composable Architecture

CI

The Composable Architecture (o simplemente TCA) es una librería para construir aplicaciones de una manera consistente y entendible, teniendo en mente composición, pruebas y ergonomía. Puede ser utilizada en SwiftUI, UIKit, y en cualquier plataforma de Apple (iOS, macOS, tvOS, y watchOS).

  • [¿Qué es *The Composable A
@pitt500
pitt500 / ResultBuilderDemo.swift
Last active February 27, 2024 03:01
Demo explaining Result Builders, check out this link for more context: https://youtu.be/kZ7JPFUVv1w
// Created by Pedro Rojas (aka Pitt)
// Link to learn more about this code: https://youtu.be/kZ7JPFUVv1w
import SwiftUI
import WebKit
@resultBuilder
struct HtmlBuilder {
static func buildBlock() -> [HtmlTag] {
[]
import SwiftUI
import SensitiveContentAnalysis
struct ContentView: View {
enum AnalysisState {
case notStarted
case analyzing
case isSensitive
case notSensitive
import UIKit
// 1. Import SwiftUI
import SwiftUI
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// 2. Initialize SwiftUI View
@pitt500
pitt500 / TCA_CounterDemo.swift
Created September 17, 2022 22:00
More context about this demo here: https://youtu.be/SfFDj6qT-xg
import SwiftUI
import ComposableArchitecture
struct State: Equatable {
var counter = 0
}
enum Action: Equatable {
case increaseCounter
//
// ContentView.swift
// DemoSheet
//
// Created by Pedro Rojas on 20/08/22.
//
import SwiftUI
struct ContentView: View {
@pitt500
pitt500 / TodoList+FixedSorting.swift
Last active August 3, 2022 14:46
For more context about this algorithm, check out this video: https://youtu.be/M3eJIo9h0fg
import SwiftUI
struct Todo: Identifiable {
let id: UUID
var title = "Untitled"
var isComplete = false
static var sample: [Todo] {
[
@pitt500
pitt500 / TodoList.swift
Last active August 3, 2022 14:46
For more context about this code, check out this video: https://youtu.be/Yk-KPDa4w8E
import SwiftUI
struct Todo: Identifiable {
let id: UUID
var title = "Untitled"
var isComplete = false
static var sample: [Todo] {
[
import SwiftUI
struct Todo: Identifiable {
let id: UUID
var title: String = "Untitled"
var isComplete: Bool = false
static var sample: [Todo] {
[
Todo(