Running and debugging your targets in Visual Studio Code is not prepared by default. Especially for us Swift developers this might come unexpected, especially in comparison to Xcode. In VS Code we require extensions and configs for this purpose.
Update from 2022: the Swift Server Work Group released their own official VS Code extension which dramatically improves the debugging user experience. Here is the new, updated blog post.
Within this blog post, we will set up debugging for a Swift Package Manager project.…
The initial idea behind InferIt was to create some mixture of a constraint solver and a dependency manager: you would just tell it what to install and it would gather as much information as possible to install it.
The goal is to fulfill a requirement. InferIt would then try to resolve all variables by trying to fulfill several requirements. If a requirement has been met, the value can be propagated.…
Async operators debounce, throttle or delay that functional reactive programming libraries as RxSwift and ReactiveSwift provide are super useful and expressive. Though their biggest benefit lays within composability.
This playground tries to achieve the same using plain functions with little help of a global scheduler for a greater testing experience. For better composability it relies on Overture in version 0.2.0.
Originally written at 2018-06-10
Example var count = 0 let countChars = with({ count += $0 }, pipe( map(get(\String.…
A simple example implementation of the Redux pattern with multiple reducers and listeners.
The name is derived from Swift + Redux = 🏎🦆
Originally written at 2018-06-10
Definitions public final class Store<State, Action> { public typealias Reducer = (Action, inout State) -> Void public private(set) var state: State private var reducers: [Reducer] = [] private var callbacks: [Weak<Listener<State>>] = [] public init(initial state: State) { self.state = state } public func select(_ changes: @escaping (State) -> Void) -> Any { let subscription = Listener(on: changes) callbacks.…
Archery is about doing something with your project’s metadata. The new version 0.3.0 puts everything on steroids and allows you to script your metadata. A detailed overview of all changes can be found on GitHub.
Archerfile Loaders At first you will notice the new option to load additional contents into your Archerfile an incredibly open field of new possibilities. The most obvious use case is to collect metadata from multiple configuration files.…
Today I released the new 2.7.0 update to SDE for VS Code and the companion project sourcekite has been updated, too.
The new sourcekite 0.5.0 now supports Swift 5, but drops support for Swift 3. If you still need support for Swift 3.1, I also tagged 0.4.2.
Since 2.6.0, SDE already supported Apple‘s official sourcekit-lsp by using the "sde.languageServerMode": "langserver" and the swift.languageServerPath setting. As announced in Apples SourceKit-LSP and SDE Roadmap SDE 2.…
Apple recently announced to develop a language server for Swift and C-family languages. Or said more clearly: Apple started development to support every editor implementing the language server protocol like VS Code, Sublime Text, Jet Brains‘ IDEs and Atom.
Later they published the source code in GitHub including support for VS Code and Sublime Text. It will work on Linux but is currently limited to Swift snapshots and the VS Code extension hasn’t been published yet.…
Writing things down is part of my learning process. These thoughts came up while reading through Yegor Bugayenko’s book Elegant Objects about a more declarative and less procedural approach of object oriented programming. This is more a personal document than a book review or summary and as I already knew some topics, I do not mention several chapters or details, I might explain concepts different than the original author and many examples from Java, Ruby or C++ cannot be applied to Swift as they would already solve the issue.…
A Swift Playground aiming to provide some functional helpers to parse arguments for command line tools. It uses Overture and is build for high composability, flexibility and little impact on your project’s freedom to evolve.
A central use case was Archery’s: only actually interpreted arguments shall be consumed. Any others shall be collected (remaining) or should prevent execution (exhaust), depending on the current command.
First of all an example usage.…
Do you work with legacy RxJS code? Have you ever revisited your first few observables in your application? Do you need to fix bugs in an app of your learning phase? Are you still learning best practices for writing reactive code? This guide is for you. Even if you don’t have anything to do with Angular, you may find this interesting. I will show you a way of how to improve your reactive streams in order to understand their functionality in many isolated, but tiny steps.…