blog
blog copied to clipboard
๐ What you don't know is what you haven't learned
Before iOS 11, we used to use `CIDetector` and `CIDetectorTypeQRCode` to detect QR code [CIDetector](https://developer.apple.com/documentation/coreimage/cidetector) > An image processor that identifies notable features, such as faces and barcodes, in a...
We want to have a swifty UserDefaults API that works with subscript and in a type safe manner. ```swift extension Defaults.Keys { static let string = Defaults.Key("string", default: "0") }...
Today I was upgrading [Keychain](https://github.com/hyperoslo/Keychains) to swift 4, and take this opportunity to fix the test. The tests pass on macOS, but on iOS, I get `-25300` error for ```swift...
In iOS 18, we can make Control Widget in Widget extension ```swift import WidgetKit import SwiftUI @available(iOS 18.0, *) struct BookControlWidget: ControlWidget { var body: some ControlWidgetConfiguration { StaticControlConfiguration(kind: "Book")...
The [WidgetBundle](https://developer.apple.com/documentation/swiftui/widgetbundle) lets us expose multiple widgets from a single widget extension It uses [WidgetBundleBuilder](https://developer.apple.com/documentation/swiftui/widgetbundlebuilder) to constructs a widget bundleโs body. In iOS 18, if we include `ControlWidget` then we...
If youโre using `NSFetchedResultsController` in Core Data, it might take up a lot of memory, especially when working with large datasets. To keep your app running smoothly, itโs important to...
[NSDragOperation](https://developer.apple.com/documentation/appkit/nsdragoperation) represent which operations the dragging source can perform on dragging items. There are several types of drag operations, and each one has a different purpose and visual cue. ###...
[NSCollectionView](https://developer.apple.com/documentation/appkit/nscollectionview), available since macOS 10.5+, is a good choice to present a list of content. Let's make a SwiftUI wrapper for `NSCollectionView` with diffable data source and compositional layout ###...
When dealing with user input, such as in an autocomplete component, it's common to implement debouncing to reduce the number of API calls and improve the user experience. React Query's...
From iOS 17, SwiftUI Charts has [chartGesture](https://developer.apple.com/documentation/swiftui/view/chartgesture(_:)), together with [SpatialTapGesture](https://developer.apple.com/documentation/swiftui/spatialtapgesture) we can check tap location and convert that to Charts value ```swift Chart {} .chartGesture { chart in SpatialTapGesture() .onEnded...