blog icon indicating copy to clipboard operation
blog copied to clipboard

🍁 What you don't know is what you haven't learned

Results 195 blog issues
Sort by recently updated
recently updated
newest added

Need to use `Coordinator` conforming to `UITextViewDelegate` to apply changes back to `Binding` ```swift import SwiftUI import UIKit struct MyTextView: UIViewRepresentable { @Binding var text: String final class Coordinator: NSObject,...

iOS
swift
swiftUI

Every new architecture that comes out, either [iOS](https://github.com/onmyway133/fantastic-ios-architecture) or [Android](https://github.com/onmyway133/fantastic-android-architecture), makes me very excited. I'm always looking for ways to structure apps in a better way. But after some times,...

iOS
swift

Use `Solana.swift` and `Mnemonic` seed phrase. For production, change endpoint to mainnet ```swift import UIKit import Solana import KeychainAccess enum SolanaError: Swift.Error { case accountFailed case unauthorized } final class...

swift

Specify `minWidth` to ensure miminum width, and use `.layoutPriority(1)` for the most important pane. ```swift import SwiftUI struct MainView: View { @EnvironmentObject var store: Store var body: some View {...

swift
macOS
swiftUI

Note that - Explicit `id` is needed, although Book already conforms to Identifiable - `selection` needs a default value ```swift class BookViewModel: ObservableObject { @Published var books: [Book] = []...

swift
swiftUI

Sometimes we don't want to show progress view right away ```swift HUDProgressView() .transition( AnyTransition.asymmetric( insertion: AnyTransition.opacity.animation(Animation.default.delay(1)), removal: AnyTransition.opacity) ) ```

swift
swiftUI

For many apps that require user authentication, a common practice is to define a shared `UserManager` with an optional `User`. This is convenient but it requires us to constantly unwrap...

swift
swiftUI

Make it easy to access common cases, for example `UserDefaults` ```swift extension UserDefaults { enum Key: String { case hasBackup } subscript(key: Key) -> Bool { get { bool(forKey: key.rawValue)...

swift

Over the course of making several SwiftUI apps, I've discovered quite a few hidden magic of SwiftUI that are quite fun. Here are 6 interesting SwiftUI features in View Builder...

swift
swiftUI

When a function expects `AnyPublisher` but in mock, we have `Just` ```swift func getBooks() -> AnyPublisher { return Just([ Book(id: "1", name: "Book 1"), Book(id: "2", name: "Book 2"), ])...

swift
combine