blog
blog copied to clipboard
🍁 What you don't know is what you haven't learned
From https://github.com/antonioerdeljac/next13-spotify ```ts import { forwardRef } from "react"; import { twMerge } from "tailwind-merge"; export interface ButtonProps extends React.ButtonHTMLAttributes {} const Button = forwardRef(({ className, children, disabled, type =...
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`...
## AppStore screenshots [Screenshot specifications](https://developer.apple.com/help/app-store-connect/reference/screenshot-specifications/) ## iPhone 6.7" Portrait 1290 x 2796 ### iPhone 6.5" Portrait 1242 x 2688 ## In-App Purchase screenshots [In-app purchase information](https://developer.apple.com/help/app-store-connect/reference/in-app-purchase-information) iOS 640 x 920...
Add Share extension and Action extension respectively in Xcode. We can use the same code to both extension ## SwiftUI I usually make a `ShareView` in SwiftUI with `ShareViewModel` to...
## AppIntents Declare `AppShortcutsProvider`, note that `appShortcuts` uses `@AppShortcutsBuilder` syntax ```swift import AppIntents struct OurShortcutsProvider: AppShortcutsProvider { static var shortcutTileColor: ShortcutTileColor = .lightBlue @AppShortcutsBuilder static var appShortcuts: [AppShortcut] { AppShortcut(intent:...
We can use `ButtonStyleConfiguration` to detect `isPressed` state ```swift struct RecordButton: View { var body: some View { Button { } label: { Image(systemSymbol: .micFill) } .buttonStyle(RecordButtonStyle()) } } private...
For a plain SwiftUI project, Xcode will generate a Info.plist file once you start to edit the Info tab in target settings. There is a Launch screen (UILaunchScreen) key by...
For iOS, use [string](https://developer.apple.com/documentation/uikit/uipasteboard/1622092-string) > Setting this property replaces all current items in the pasteboard with the new item. If the first item has no value of the indicated type,...
Like [AppStorage](https://developer.apple.com/documentation/swiftui/appstorage), we can make a custom UserDefaults property wrapper that conforms to [DynamicProperty](https://developer.apple.com/documentation/swiftui/dynamicproperty) ```swift @propertyWrapper public struct UserDefault: DynamicProperty { @State private var value: Value let key: String let...
Use `AES.GCM` method with 128 bits key ```swift import CryptoKit public extension Optional { func tryUnwrap() throws -> Wrapped { if let value = self { return value } else...