
Projekt | QR Reader for Mac
Von Jan Weiß am 29.09.2025
Ever come across a QR code on your MacBook and wished you could scan it directly without reaching for your phone? This app makes that possible.
Features
- Scan QR codes using your MacBook’s built-in camera
- Keep a searchable history of scanned codes
- Enhanced support for:
- Website links (open directly in your browser)
- Contact data in vCard format
Future versions may include more data types — contributions are welcome!
How It Works
Simply launch the app, point your MacBook’s camera at a QR code, and the app will recognize it instantly. Your scans are stored in your history so you can revisit them at any time.

Contributing
If you’d like to add support for additional QR code data types:
- Implement a new
HistoryItemData
- Add it to
QRCodeUtils.historyItemDataFromQRCode
- Create a view that extends
HistoryItemViewBase
- Integrate your view into
HistoryItemView
We welcome pull requests and improvements from the community.
Development
The application is written in Swift and uses SwiftUI and only native packages. To run the project locally:
- Clone the repository
- Open the project in Xcode
- Build and run
That’s it — you’re ready to go!
Other thoughts
A long time ago, I learned a bit of JavaFX and Swing. Since then, I have been working on web projects and mainly developing user interfaces with the frontend framework Vue, though I am also familiar with Angular and React. With this background, I was excited to write my first native macOS application.
What surprised me immediately was how easy it was to create and style UI components. With very little code, I was able to build attractive layouts, apply colors (also supporting dark mode!), add shadows, and even implement subtle animations. Coming from a web-development background, I had mixed feelings about the lack of separation between templates and styles that I observed in the code examples online. The code I saw (and wrote) was essentially equivalent to defining CSS rules directly in an element’s style attribute. I’m sure there are cleaner approaches that I have yet to discover.
Another interesting aspect of the macOS development ecosystem is the simplicity and richness of the system APIs. Want to save a contact to the OS’s contact book or detect a QR code? There is a native package that can be imported with a single line, usually just two words (e.g., import Vision). In general, importing code is very straightforward, and code inside a module is automatically available everywhere. This simplicity does have a downside: it can make it less clear where a piece of code comes from and how different units are related.
While developing data classes to represent various scanned QR code data formats, I encountered an unpleasant aspect of Swift. I needed classes to represent scanned QR codes containing plain data, contact information, or website links. All QR code entries share certain properties, such as the date they were scanned or had to implement a certain method. I initially wanted to capture this relationship with an abstract class, (e.g., HistoryItem being extended by a ContactHistoryItem).
The first thing I discovered was that Swift does not have abstract classes; instead, it uses protocols, which worked fine for my use case. However, I then found that I could not use my protocol as a type for collections. I also tried created a generic HistoryItem holding a ContactHistoryItemData implementing the HistoryItemData protocol. But this also didn’t work. The common Swift approach seems to be a wrapper class to erase the type. As a result, I ended up with a HistoryItem holding an AnyHistoryItemData that contains an object conforming to the HistoryItemData protocol. Having to implement type erasure instead of using generics felt somewhat unsatisfying and slightly clouded my impression of the language.
If I am missing any important details, please let me know! I am looking forward to your feedback and hope to learn some tricks for designing Swift code more effectively and elegantly.
Link to the repository: github.com/realJanWeiss/QR-reader-for-Mac