How to store Codable in AppStorage
Issue #949
AppStorage and SceneStorage accepts RawRepresentable where value is Int or String.
Creates a property that can read and write to a string user default, transforming that to RawRepresentable data type.
Discover all the tech
Issue #949
AppStorage and SceneStorage accepts RawRepresentable where value is Int or String.
Creates a property that can read and write to a string user default, transforming that to RawRepresentable data type.
Issue #948
iOS 17 has a new Stand by mode so SwiftUI introduces containerBackground for the system to decide when to draw background. It also automatically applies margin to widget so we may need to disable that
To update existing widgets, we can …
Issue #947
Sometimes Row Level Security is not enough and we want to do all logic server side, then we need a way for the server to get hold onto current user token.
From client, we can get session from supabase …
Issue #946
For security purposes, the auth schema is not exposed on the auto-generated API. We can make a profiles table in public namespace and mirror data from auth.users when user signs up.
I need id, username and raw_user_metadata so I will …
Issue #945
The default SwiftGen generate generated strings L10n file like this
extension L10n {
private static func tr(_ table: String, _ key: String, _ …Issue #944
SwiftUI in iOS 16 supports Layout protocol to arrange subviews
We need to implement 2 methods
Issue #943
In this tutorial, we’ll learn how to use Swift Charts to visualize ranking data.
We use default AxisMarks and AxisMarks to let Swift Charts interpolate x and y grid lines. For y axis, I want to have finer grain control over the …
Issue #942
Expose supabase with createClient
useSupabase.ts
import { createClient } from '@supabase/supabase-js'
const supabaseUrl = process.env. …Issue #941
In this tutorial we will be creating a React app with Parcel 2 with Typescript and Tailwind
Install the following dependencies. Parcel supports TypeScript out of the box without any additional configuration.
Issue #940
We can develop Nextjs 13 apps and export it to a Chrome extension.
Start by init the project
npx create-next-app@latestHere is the project …
Issue #939
Instead of letting the Image decide the size, we can put it as background or overlay. I use clipped and contentShape to avoid the fill image obscuring touch event
Issue #938
To let app and extension to talk to the same database, we need to use AppGroup. Here is how to use replacePersistentStore
Replaces one persistent store with another
Issue #937
First, you need to enable iCloud Documents capability. Go to target settings -> Signing & Capabilities -> iCloud
`
Then inside your Info.plist, add this with your iCloud identifier and app name
Issue #936
From https://github.com/antonioerdeljac/next13-spotify
import { forwardRef } from "react";
import { twMerge } from "tailwind-merge"; …Issue #935
I prefer UI Component that works with Nextjs and Tailwind CSS
Issue #934
There are a few keychain wrappers around but for simple needs, you can write it yourself
Here is a basic implementation. I use actor to go with async/await, and a struct KeychainError to contain status code in case we want to deal with …
Issue #933
By default, Nextjs route is case sensitive, so localhost:3000/About and localhost:3000/about are different routes.
To make uppercase routes become lowercase routes, we can add a middleware.tsx file to the src so it is same level as pages …
Issue #932
Add Share extension and Action extension respectively in Xcode. We can use the same code to both extension
I usually make a ShareView in SwiftUI with ShareViewModel to control the logic
Issue #931
Portrait 1290 x 2796
Portrait 1242 x 2688
iOS 640 x 920 tvO 1920 x1080 pixels macOS 1280 x 800 pixels
Issue #930
Declare AppShortcutsProvider, note that appShortcuts uses @AppShortcutsBuilder syntax
import AppIntents
struct OurShortcutsProvider …I’m a thinker and storyteller with a passion for exploring the intersection of creativity and technology
🧑💻 I love crafting high quality and useful apps
🔥 I love open source. My GitHub open source has 2.3k followers with packages that are integrated by 45k+ apps and over 3.4m+ downloads on CocoaPods.
✍️ I write here on my blog and on Medium, which has over 2.7k+ followers with tons of articles and 90k+ monthly views.
🖥 Follow me for sharings about Swift, SwiftUI, iOS and macOS development.