codelaby (@Codelaby) header
codelaby (@Codelaby) profile picture

Welcome to my coding journey! I share SwiftUI programming tips to help others learn and grow. Explore tutorials, code snippets, and more on my blog and Patreon.

Barcelona, España
Joined November 2009
Photo by codelaby (@Codelaby)Photo by codelaby (@Codelaby)Photo by codelaby (@Codelaby)Photo by codelaby (@Codelaby)Photo by codelaby (@Codelaby)Photo by codelaby (@Codelaby)Photo by codelaby (@Codelaby)Photo by codelaby (@Codelaby)Photo by codelaby (@Codelaby)Photo by codelaby (@Codelaby)
🗯️Unleash your inner geek with the Binary Clock Widget, available on the App Store for iPhone and iPad. 🔗 apps.apple.com/us/app/widget…
1
10
7,324
Two variations of the Apple Store-style highlight card in SwiftUI: ⛳️ extracting the average color from the image, then generating light, medium, and dark palette variations. #SwiftUI #iOSDev
1
6
206
2️⃣ Light tone behind the asset, medium background with dark or light text (WCAG contrast-checked)
1
52
Building Apple Store-style product highlight cards in SwiftUI: • Region-based color sampling via Core Image (CIAreaAverage) • Light, medium & dark HSB palettes • Split layout + WCAG contrast checks Full code & breakdown in the replies below
Playing around with an idea in #SwiftUI: grabbing the dominant color from an image and generating a palette (light, medium, dark) to adapt the card's design.
5
4
310
Playing around with an idea in #SwiftUI: grabbing the dominant color from an image and generating a palette (light, medium, dark) to adapt the card's design.
1
1
6
572
codelaby retweeted
just shipped: an easy tool for posting your top 10 of 2026 pick your top albums, songs, movies, books or tv shows taylor.fyi/top
260
2,959
1,924
20,915
3,245,338
Building adaptive card compositions in SwiftUI! ✨ Supporting Tail (Portrait) & Wide (Landscape) layouts with: 🔹 Variable blur masks & scrim overlays 🔹 Real-time average color extraction 🔹 WCAG contrast ratio calculations for accessible typography #SwiftUI #iOSDev #Swift
3
8
516
Concept idea: When the device is folded (Passport/Stand) or in Split View, a single tap shows a subtle toast suggesting to unfold for the full experience. Want to proceed anyway? Just tap again within 3 seconds to trigger the action. #iphoneDuo #SwiftUI
1
4
414
Exist symbols name for represent device pose?
1
2
353
Handling availability gracefully: a custom ViewModifier fallback for the vertical toolbar detector on #iPhoneDuo. #SwiftUI #iOSDev
1
17
912
Building a clean fallback for the vertical toolbar detector
1
111
#SwiftUI tip building horizontal onboarding inside a .sheet for #iPhoneDuo use .ignoresSafeArea() on your paging ScrollView, remember to inject viewport.safeAreaInsets back into your page content along with .contentMargins(for: .container) so everything stays properly aligned
5
34
2,464
Selection Mode .multiple(min: 0, max: 3)
53
Safe Area vs. Container Margins vs. Custom Safe Container Margins in SwiftUI 🔴🟢🔵 #SwiftUI #iponeDuo #iOS #ipadOS #macOS
5
37
2,377
Gracias al artículo de Arturo, he creado safeContainerMargins Define márgenes con fallback automático: ideal para las particularidades del iPhone Duo y evita que iPhone, iPad y macOS se queden a 0. xitter.gq/Codelaby/status/211975…
Si el contenido de tu pantalla tiene que alinearse con el título de navegación, ¿de dónde salen esos 16 puntos de padding? En SwiftUI, el margen del sistema depende del contenedor y de la posición de la vista. En el iPhone Duo, los dos lados pueden necesitar distancias distintas. Desde iOS 27.1, puedes aplicar los márgenes laterales del contenedor con `.contentMargins(for: .container, edges: .horizontal)`. Y si necesitas los valores para un carrusel, `GeometryProxy.contentMargins(for:edges:)` te da los `EdgeInsets`. Ahí encajan las dos APIs llamadas `contentMargins`. La guía `.container` resuelve cuánto espacio corresponde. `.scrollContent`, disponible desde iOS 17, indica dónde aplicarlo. Combinarlas permite alinear la primera tarjeta con el resto de la pantalla y conservar el desplazamiento hasta el borde. Mide cerca de la vista que va a usar el resultado. Si una vista antecesora ya aplicó el margen, la lectura puede dar cero. El área segura se gestiona aparte. Dejo el enlace en el hilo, con ejemplos y un fallback para versiones anteriores de iOS. #SwiftUI #Swift #iOSDevelopment
1
4
248