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

In some case, we should not use base type like `UTType.text` but to be more specific like `UTType.utf8PlainText` ```swift import UniformTypeIdentifiers var dropTypes: [UTType] { [ .fileURL, .url, .utf8PlainText, .text...

swift
swiftUI

Use underscore `_focus` we get access to underlying `FocusState` object, but underscore `_` is private to a View hence can't be used in extension If we want to pass FocusState...

swift
swiftUI

Use `NSTextAttachment` inside `NSAttributedString` ```swift extension UILabel { func addTrailing(image: UIImage) { let attachment = NSTextAttachment() attachment.image = image let attachmentString = NSAttributedString(attachment: attachment) let string = NSMutableAttributedString(string: self.text!, attributes:...

iOS
swift

Apply `.move` on `reversed` array ```swift List(selection: $viewModel.selectedBook) { ForEach(viewModel.books.reversed()) { book in BookCell(book: book) } .onMove { source, dest in var reversed = Array(viewModel.books.reversed()) reversed.move(fromOffsets: source, toOffset: dest) viewModel.books...

swift
swiftUI

Use CoreImage to generate QR image ```swift import SwiftUI import CoreImage.CIFilterBuiltins struct QRView: View { let qrCode: String @State private var image: UIImage? var body: some View { ZStack {...

swift
swiftUI

Use a `UIView` as source view and set it in background ```swift class ViewModel { lazy var sourceView = UIView() } struct SourceView: UIViewRepresentable { let viewModel: ViewModel func makeUIView(context:...

iOS
swiftUI

Interesting SwiftUI Q&A during WWDC22 ### What’s the difference between a custom ViewModifier vs View extension Q: What’s the difference between a custom ViewModifier (without DynamicProperty) that uses some built-in...

swift
swiftUI
wwdc

Specify optional value for `List(selection:)`. This keeps selection on macOS, but not on iPad. On iPad each row in the List needs to be `NavigationLink`, no need for `.tag`. The...

swift
macOS
swiftUI

- [Objcio Swift Talk](https://talk.objc.io/) - [Hacking With Swift](https://www.hackingwithswift.com/) - [AppCoda](https://www.appcoda.com/) - [Swift by Sundell](https://swiftbysundell.com/) - [Swift with Majid](https://swiftwithmajid.com/) - [Nil Coalescing](https://nilcoalescing.com/)

iOS

Below are my favorite WWDC videos. My focus is to use SwiftUI to make useful apps with great UX. I don't pay much attention to new frameworks as they come...

swift
swiftUI
wwdc