Chase
banner
haymond.bsky.social
Chase
@haymond.bsky.social
Mobile app developer, trying to make life more fun for everyone

📱🏀🏃
Anyone know of a good a tool or something to help debug a slow UI?

I just spent two hours commenting out code and running my app over and over until I finally found a gesture modifier higher in the nav stack that was causing my view to slow down. There has to be a better way haha

#iOSDev #Xcode
July 15, 2025 at 5:42 PM
Prepping an app for iOS 26… some things work on iPhone but crash on iPad and vice versa…

I should probably just wait until the next beta to see if the crashes are fixed, but I’m so impatient

#iOSDev
July 14, 2025 at 5:43 PM
Why does today feel like a second Monday? It keeps dragging on
February 25, 2025 at 10:08 PM
Doing some C programming after 2 years of only doing Swift. Starting to really hate these semicolons 😂
January 11, 2025 at 8:18 PM
Reposted by Chase
Merry Christmas from us to you 🎄🎁💙 We launched Trending Topics today, and you can find it by tapping the search icon on the bottom bar of the app or the right sidebar on desktop.
December 26, 2024 at 1:09 AM
Can someone explain when to use an @EnvironmentObject versus an @ObservedObject in SwiftUI? My app seems to freeze when I have too many layers using the same @ObservedObject, so im assuming thats when I should use an @EnvironmentObject.

#SwiftUI
November 20, 2024 at 7:57 PM
Helping a new employee set up their XCode to build the project is the worst. Why can’t the packages just build 😂
November 18, 2024 at 3:31 PM
What are your favorite code snippets you have set up in Xcode?

#iOSDev #macOSDev #Xcode
November 8, 2024 at 12:59 PM
In swiftUI why can’t I .disable() an item in a Picker?
November 7, 2024 at 7:24 PM
Spent way to long trying to get a menu item in swiftUI to have a checkmark on the left of the text, and a symbol on the right. Then I found an article that said “use a Picker inside a Menu to get checkmarks on the left of a menu”. Felt so good to find something that works exactly like I need it it
October 30, 2024 at 9:05 PM
Does Xcode command line tools do anything useful I should know about? I’ve never done anything with it
#iOS #macOS #XCode
October 29, 2024 at 3:23 AM
Reposted by Chase
By far, one of the best features in Xcode is `Show callers…` Can save you a lot of time if you make sure that you are actually calling a method before trying to find out why it doesn’t work as intended. 🤓
October 26, 2024 at 6:17 PM
Anyone have any fun weekend project they are working on? #mobileDev #iOS #macOS
October 26, 2024 at 2:52 PM
I’ve been trying to take better breaks during my workday—activating the creative side of my brain or doing some exercise. It’s helped my day feel more relaxing

What do you all do to recharge during breaks? Especially curious how other mobile devs stay fresh

#iOSDev #AndroidDev #MentalHealth
October 23, 2024 at 6:04 PM
As an iOS dev with very little back-end experience, diving into AWS and spending an entire day debugging a Lambda was a shift. I can’t express how good it felt to finally fix the issue and see that entry show up in DynamoDB!

#SmallWins
October 22, 2024 at 8:59 PM
Want to give a shout out to the YouTube channel Kavsoft. They somehow only get 1k to 2k views per video, but deserve lots more. Each video shows an interesting UI element you can add to your SwiftUI project. If you haven’t seen this channel before, give it a look.

youtu.be/B8JGLwg_yxg
App-Wide Overlays | SwiftUI
YouTube video by Kavsoft
youtu.be
October 21, 2024 at 6:59 PM
Mac devs: has anyone been using Stage Manager? I’ve been giving it a try but not sure if it’s really more helpful than just using the dock. I’m curious—does anyone here actually like using it? How does it fit into your workflow?

#MacOS #MacDeveloper
October 19, 2024 at 6:50 PM
Reposted by Chase
Introducing the Benchmark Package: Complementing Unit Tests with Performance Checks
In the world of software development, the old adage “make it work, make it right, make it fast” serves as a guiding principle for creating robust, efficient applications. This journey starts with ensuring that our code functions as intended, a task where unit and integration testing have proven indispensable. However, ensuring functionality is only part of the equation. The true measure of an application’s excellence extends into its performance - how fast and efficiently it operates under various conditions. Herein lies the critical but often overlooked third step: _making it fast_. In the realm of professional trading software, the role of a comprehensive benchmarking framework integrated with Continuous Integration (CI) parallels the importance of unit and integration testing. Just as unit and integration tests are essential for ensuring the functional correctness of software, benchmarking within a CI pipeline is crucial for continuously validating the non-functional aspects, such as high throughput, low latency, predictable performance and consistent resource usage. This is vital for maintaining the competitive edge in a fast-paced financial environment where the extreme market data rates and performance requirements means that even small variations in response time - on the scale of microseconds - can significantly impact trade outcomes. Performance is an important part of the overall product regardless of the application domain, no end user wants to wait on a computer or other electronic device, instant response to user operations truly helps provide a delightful end user experience. After examining the existing infrastructure within the Swift ecosystem, we concluded that there were no existing solutions meeting our needs for multi-platform and rich metrics support, CI integration, and developer-friendliness. Therefore, we decided to develop a Benchmark package and open source it, believing it could help advance performance for the Swift community and benefit all of us. ### The Role Of Benchmarks Have you ever encountered a _performance problem_ that slipped through to end users which resulted in a bug report? Do you systematically measure and validate performance metrics when making changes to your Swift package? Swift aims for performance that rivals C-based languages, emphasizing predictable and consistent execution. Achieving this involves optimizing the use of constrained resources like CPU, memory, and network bandwidth, which significantly influence application workloads across server-side, desktop, and mobile environments. Key performance metrics include CPU usage, memory allocation and management, network I/O, and system calls, among others. These metrics are essential for foundational software, where controlling resource usage and minimizing footprint are as critical as maintaining runtime performance. The Benchmark package readily supports these metrics, along with OS-specific ones for Linux and macOS, providing a comprehensive toolkit for Swift developers to monitor and enhance their applications’ efficiency. Constructing a set of benchmarks and consistently running them provides an indication when something is not performing as expected, just as a unit test flags if some functional expectation is broken. Then complementary tools (e.g. Instruments, DTrace, Heaptrack, Leaks, Sample, …) are used to for root-cause analysis to analyze and fix the underlying problem. This is analogous to unit tests, where a failed test indicates that something is wrong, and other more specialized tools are used to fix the problem (e.g., a debugger, TSAN/ASAN, adding asserts, debug printouts, …). ### Benchmarking Infrastructure The open-source Benchmark package helps you automate performance testing and makes it easy for individual developers to run a quick performance validation locally before pushing changes. The Benchmark package is implemented as a SwiftPM command plugin and adds a dedicated command to interact with benchmarks: > `swift package benchmark` Introductory getting started information is available both on the package GitHub page as well as in the Swift Package Index DocC documentation. A minimalistic benchmark measuring the performance of `Date` would simply be: import Benchmark import Foundation let benchmarks = { Benchmark("Foundation-Date") { benchmark in for _ in benchmark.scaledIterations { blackHole(Foundation.Date()) } } } It is suitable both for microbenchmarks mostly concerned with CPU usage as well as for more complex long-running benchmarks and supports measuring a wide range of samples over a long time thanks to using the HDR Histogram package. Benchmark provides support for an extensive set of built-in metrics: * `cpuUser` - CPU user space time spent for running the test * `cpuSystem` - CPU system time spent for running the test * `cpuTotal` - CPU total time spent for running the test (system + user) * `wallClock` - Wall clock time for running the test * `throughput` - The throughput in operations / second * `peakMemoryResident` - The resident memory usage - sampled during runtime * `peakMemoryResidentDelta` - The resident memory usage - sampled during runtime (excluding start of benchmark baseline) * `peakMemoryVirtual` - The virtual memory usage - sampled during runtime * `mallocCountSmall` - The number of small malloc calls according to jemalloc * `mallocCountLarge` - The number of large malloc calls according to jemalloc * `mallocCountTotal` - The total number of mallocs according to jemalloc * `allocatedResidentMemory` - The amount of allocated resident memory by the application (not including allocator metadata overhead etc) according to jemalloc * `memoryLeaked` - The number of small+large mallocs - small+large frees in resident memory (just a possible leak) * `syscalls` - The number of syscalls made during the test – macOS only * `contextSwitches` - The number of context switches made during the test – _macOS only_ * `threads` - The maximum number of threads in the process under the test (not exact, sampled) * `threadsRunning` - The number of threads actually running under the test (not exact, sampled) – macOS only * `readSyscalls` - The number of I/O read syscalls performed e.g. read(2) / pread(2) – _Linux only_ * `writeSyscalls` - The number of I/O write syscalls performed e.g. write(2) / pwrite(2) – _Linux only_ * `readBytesLogical` - The number of bytes read from storage (may be from pagecache!) – _Linux only_ * `writeBytesLogical` - The number bytes written to storage (may be cached) – _Linux only_ * `readBytesPhysical` - The number of bytes physically read from a block device – _Linux only_ * `writeBytesPhysical` - The number of bytes physically written to a block device – _Linux only_ * `retainCount` - The number of retain calls (ARC) * `releaseCount` - The number of release calls (ARC) * `retainReleaseDelta` - `abs(retainCount - releaseCount)` - if this is non-zero, it would typically mean the benchmark has a retain cycle (use Memory Graph Debugger to troubleshoot) Custom metrics are supported as well for application-specific measurements (e.g. cache hit/miss statistics). ### Writing Benchmarks There’s an introduction to writing benchmarks as well as a sample repository. A slightly more complicated benchmark measuring a part of the `Histogram` package: import Benchmark import Foundation import Histogram let benchmarks = { // Minimal benchmark with default settings Benchmark("Foundation-Date") { benchmark in for _ in benchmark.scaledIterations { blackHole(Foundation.Date()) } } // Slightly more complex with some customization let customBenchmarkConfiguration: Benchmark.Configuration = .init( metrics: [ .wallClock, .throughput, .syscalls, .threads, .peakMemoryResident ], scalingFactor: .kilo ) Benchmark("ValueAtPercentile", configuration: customBenchmarkConfiguration) { benchmark in let maxValue: UInt64 = 1_000_000 var histogram = Histogram<UInt64>(highestTrackableValue: maxValue, numberOfSignificantValueDigits: .three) for _ in 0 ..< 10_000 { blackHole(histogram.record(UInt64.random(in: 10 ... 1_000))) } let percentiles = [0.0, 25.0, 50.0, 75.0, 80.0, 90.0, 99.0, 100.0] benchmark.startMeasurement() // don't measure the setup cost above for i in benchmark.scaledIterations { blackHole(histogram.valueAtPercentile(percentiles[i % percentiles.count])) } benchmark.stopMeasurement() } } ### Benchmark Output And Analytics The default output is in a table format for human readability, but the package supports a range of different output formats with output suitable for analysis with other visualization tools. Sample default output when running benchmarks: ### Key Benchmark Workflows Are Supported * _Automated Pull Request performance regression checks_ by comparing the performance metrics of a pull request with the main branch and having the PR workflow check fail if there is a regression according to absolute or relative thresholds specified per benchmark * Automated Pull Request check vs. a pre-recorded _absolute baseline p90 threshold_ (see e.g., Swift Certificates for such a workflow with related Docker files), suitable for e.g., malloc regression tests * _Manual comparison of multiple performance baselines_ for iterative or A/B performance work by an individual developer * _Export of benchmark results in several formats_ for analysis or visualization * Running the Instruments profiler on the benchmark suite executable directly from Xcode ### Closing Thoughts The Swift community, including major public projects like Swift Foundation, SwiftPM, SwiftNIO, and Google Flatbuffers, has recently embraced the Benchmark package to focus on performance optimization. Discover how to leverage this tool for your own Swift applications by exploring the extensive documentation and join the conversation on the Swift forums to share insights and get answers to your questions. Or why not provide a PR to your favourite open source package that lacks performance tests? Take the first step to improve your software today, by adding its first benchmark to check performance!
swift.org
October 19, 2024 at 4:24 AM
How I've felt this week after being put on an AWS task with no prior AWS experience. #AWS
October 18, 2024 at 4:07 PM
Reposted by Chase
This is what the App Storms rankings look like for Canada (in terms of Social Networking apps). Bluesky is in 2nd place.
October 18, 2024 at 2:26 AM
Reposted by Chase
I made a starter pack of #Swift / ObjC devs who post about #iOSDev / #MacDev and app-building at least from time to time* - let me know if you'd like to be added (or removed) 🙂 bsky.app/starter-pack... 🍎🍏

Some aren't very active here, but maybe this will encourage them 😈

(*) yes, I know I don't 😛
September 17, 2024 at 4:16 PM