Skip to content

Instantly share code, notes, and snippets.

View pitt500's full-sized avatar

Pedro Rojas pitt500

View GitHub Profile
@pitt500
pitt500 / NavigationStack_CustomBackButton.swift
Last active July 8, 2022 04:43
Demo showing a custom back button implemented using SwiftUI's NavigationStack
import SwiftUI
struct ContentView: View {
@State private var path: [Fruit] = []
var body: some View {
NavigationStack(path: $path) {
List {
NavigationLink(Fruit.apple.name, value: Fruit.apple)
import SwiftUI
struct ContentView: View {
@State private var path: [Fruit] = []
var body: some View {
NavigationStack(path: $path) {
List {
NavigationLink(Fruit.apple.name, value: Fruit.apple)
import SwiftUI
struct ContentView: View {
@State private var path: [Fruit] = []
var body: some View {
NavigationStack(path: $path) {
List {
NavigationLink(Fruit.apple.name, value: Fruit.apple)
import SwiftUI
struct ContentView: View {
@State var path = NavigationPath()
var body: some View {
NavigationStack(path: $path) {
List {
import SwiftUI
struct Todo: Identifiable {
let id: UUID
var title: String = "Untitled"
var isComplete: Bool = false
static var sample: [Todo] {
[
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] {
[
@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 / 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
//
// ContentView.swift
// DemoSheet
//
// Created by Pedro Rojas on 20/08/22.
//
import SwiftUI
struct ContentView: 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