Category Archives: Development

Software development issues and solutions

Moq: how to VerifySet with an object that respects a condition

Sometimes you want to test that a service method sets up the correct object on another (singleton) service. For example, that an authentication service sets up a user object with the correct username to the app’s user context. With Moq you … Continue reading

Posted in C# | Tagged , , , | Leave a comment

Daylight may ruin your date

(No, this post doesn’t include dating advice. For such content, your best shot is probably YouTube. :-)) This is instead about Date values in Swift*. Which sometimes you might need to update by “components”. Such as by adding a specific number … Continue reading

Posted in Swift | Tagged , , , , , | Leave a comment

Swift optionals can save the day

Although generics in Swift are somehow limited at this time, there is a nice variance-related feature available when using optionals: you can assign a non-optional to an optional variable, an array of non-optionals to an array of optionals (these two are classics), … Continue reading

Posted in Swift | Tagged , , , | Leave a comment

Enum cases with associated values are powerful but we need follow-up patterns

Let’s assume we want to use Swift to develop a function to round floating point numbers, in different ways according to a context. For example, sometimes the result of such rounding could be the input value itself (like on a … Continue reading

Posted in Swift | Tagged , , , , , , | Leave a comment

Swift events: almost generic, almost solution(s)

I have been thinking about a possible better/generic solution for adding multi-cast delegate/event dispatching support to Swift class hierarchies since January, i.e. since more than 6 months ago. While in my opinion the solution below is still not better than … Continue reading

Posted in Swift | Tagged , , , , | Leave a comment

ToolTipService.ShowDuration within a specific WPF view

ToolTipService.ShowDuration attached property isn’t inherited from parent to child elements within the WPF visual tree, and therefore values for this property – to produce runtime effects – must be set on all the elements that have ToolTips for which we’d … Continue reading

Posted in WPF | Tagged , , ,

Drag gesture recognizer for iOS/macOS development (with initial location)

As everybody knows, when using a mouse on a computer a drag operation occurs when the mouse button is pressed, then the device is moved, and eventually the button is released. It’s a continuous and precise operation. In iOS we have … Continue reading

Posted in iOS | Tagged , , , , , , , | Leave a comment