blog
blog copied to clipboard
π What you don't know is what you haven't learned
Consider this code where we have an `ObservableObject` with `fetch1` and async `fetch2`, and a `fetch` inside `ContentView` Here the observation in Xcode 14 - ViewModel.fetch1: run on main thread...
[Protect mutable state with Swift actors](https://developer.apple.com/videos/play/wwdc2021/10133) Actor reentrancy > Imagine we have two different concurrent tasks trying to fetch the same image at the same time. The first sees that...
```swift let image = NSImage(contentsOf: url) let imageView = NSImageView(image: image) image.animates = true ```
### iOS 13 Intents Extension & Intents UI Extension ### [Donate Shortcuts at the Right Time](https://developer.apple.com/documentation/sirikit/donating_shortcuts) > Siri can predict shortcuts to actions that a user may want to perform...
If we place `ScrollView` inside HStack or VStack, it takes all remaining space. To fit ScrollView to its content, we need to get its content size and constrain ScrollView size....
From iOS 14, TabView has the [PageTabViewStyle](https://developer.apple.com/documentation/swiftui/pagetabviewstyle) that turns `TabView` into the equivalent `UIPageViewController`. We can of course [implement our own Pager](https://onmyway133.com/posts/how-to-make-carousel-pager-view-in-swiftui/) but the simple `DragGesture` does not bring the...
Use [UIImageWriteToSavedPhotosAlbum](https://developer.apple.com/documentation/uikit/1619125-uiimagewritetosavedphotosalbum) > Adds the specified image to the userβs Camera Roll album. Let's make an `NSObject` delegate class so we can perform target action to notify about completion ```swift...
When testing React components, dealing with tasks that happen at different times is super important to make sure your tests give reliable results. [React Testing Library](https://testing-library.com/docs/react-testing-library/intro) gives you two important...
We can develop Nextjs 13 apps and export it to a Chrome extension. Start by init the project ```js npx create-next-app@latest ``` Here is the project structure with app router...
Use `animator` proxy and `animate` parameter ```swift var rect = window.frame rect.frame.origin.x = 1000 NSAnimationContext.runAnimationGroup({ context in context.timingFunction = CAMediaTimingFunction(name: .easeIn) window.animator().setFrame(rect, display: true, animate: true) }, completionHandler: { })...