Pull to refresh
11.29

Development for MacOS *

Developing for Apple desktop OS

Show first
Rating limit
Level of difficulty

High-performance network library using C++20 coroutines

Level of difficulty Medium
Reading time 17 min
Views 16K

Asynchronous programming is commonly employed for efficient implementation of network interactions in C++. The essence of this approach lies in the fact that the results of socket read/write functions are not immediately available but become accessible after some time. This approach allows for loading the processor with useful work during the wait for data. Various implementations of this approach exist, such as callbacks, actors, future/promise, coroutines. In C++, these implementations are available as libraries from third-party developers or can be implemented independently.

Coroutines are the most challenging to implement as they require writing platform-dependent code. However, the recent version of the C++ 20 language standard introduces support for coroutines at the compiler and standard library levels. Coroutines are functions that can suspend their execution, preserving their state, and later return to that state to resume the function's work. The compiler automatically creates a checkpoint with the coroutine's state.

For a comprehensive understanding of C++ 20 coroutines, refer to this article. Below, we examine a code example using coroutines and describe important points applied during implementation.

Read more
Total votes 6: ↑4 and ↓2 +2
Comments 14

Building your own CLI with Swift Programming Language

Level of difficulty Easy
Reading time 5 min
Views 3.2K

Command-line interfaces (CLI) are a common way to use applications. In iOS, we usually use scripting languages like Bash or Ruby to build those CLIs and automate mundane tasks. The most popular CLI for app signing and build automation is, without a doubt, Fastlane, which was initially written in Ruby. Fastlane is a great tool, convenient and fairly easy to use, and a lot of effort came into building it.

However, there's a great chance you considered moving away from Fastlane to avoid learning Ruby and to lower the entry threshold for your developers. Setting up a Ruby environment could be quite tedious and require additional devs' expertise to write and support those scripts.

Explore how to build your own command line tools with Swift in this article.

Read more
Total votes 2: ↑2 and ↓0 +2
Comments 5

Electron + web camera (cpp-ffmpeg)

Reading time 8 min
Views 3.5K

An example of using Electron + React JS and a native ffmpeg addon to access a webcamera

This guide may be helpful to someone who is trying to find a way
to work with Electron if they need to use a c++ library or code

I was looking for a more realistic example than a simple 'hello world' and i didn't succeed

Here are the links in advance:

- electron - https://github.com/khomin/electron_camera_ffmpeg

- addon - https://github.com/khomin/electron_ffmpeg_addon_camera

So let me share my experience...

Read more
Total votes 3: ↑3 and ↓0 +3
Comments 0

MacOS Kernel, How Good Is This Apple?

Reading time 19 min
Views 1.5K

0818_XNU_MacOS_Kernel/image1.png


At the very beginning of this year, Apple released the source code for macOS – Big Sur. It includes XNU, the kernel of the macOS operating system. A few years ago, PVS-Studio has already checked the kernel source code. It coincided with the analyzer release on macOS. It's been a while since then. The new kernel source code has been released. A second check? Why not?

Read more →
Total votes 1: ↑1 and ↓0 +1
Comments 0

Confusing extensions in Swift

Reading time 4 min
Views 2.1K
This post is a little bit the information aggregator. If you find a mistake, you could write to me about it I really appreciate that. Have a nice read.

Example with JSONDecoder


What would happen if we run the following piece of code?

struct Test<T>: Codable where T: Codable {
    enum CodingKeys: String, CodingKey {
        case value
    }
    
    let value: T
    let info: String
}

extension Test {
    init(from decoder: Decoder) throws {
        let container = try decoder.container(keyedBy: CodingKeys.self)
        self.value = try container.decode(T.self, forKey: .value)
        self.info = "Default init(from decoder:)"
    }
}

extension Test where T == String {
    init(from decoder: Decoder) throws {
        let container = try decoder.container(keyedBy: CodingKeys.self)
        self.value = try container.decode(T.self, forKey: .value)
        self.info = "Custom init(from decoder:)"
    }
}

let data = #"{"value":"Hello, World!"}"#.data(using: .utf8)!
let object = try? JSONDecoder().decode(Test<String>.self, from: data)
print(object.debugDescription)

Try thinking for 5 seconds about the result.

The result
Optional(
    Test<String>(
        value: "Hello, World!", 
        info: "Default init(from decoder:)"
    )
)


Read more →
Rating 0
Comments 0

How to find errors in a C# project working under Linux and macOS

Reading time 19 min
Views 714

Picture 8

PVS-Studio is a well-known static code analyzer that allows you to find a lot of tricky errors hidden in the source code. Beta testing of the new version has recently finished. It provides the possibility to analyze C# projects under Linux and macOS. The tool can also be integrated into the cross-platform IDE from JetBrains — Rider. This article will help you to get acquainted with these features using the example of checking the open source RavenDB project.
Read more →
Rating 0
Comments 0

Visual Studio for Mac: Take Control of Your IDE with Keybindings

Reading time 3 min
Views 1.4K
The great debates in computing all have one common theme. Whether it is tabs vs. spaces or Vi vs. Emacs, the thread linking all these debates together is keyboard efficiency. The truth is, we spend tons of hours working in an application, and keyboard shortcuts become automatic to us, the same muscle memory that great pianists or sports players have. If you suddenly give a virtuoso pianist a piano where the keys are half as wide and the sharp/flat keys are below as opposed to above the natural keys, they will struggle to make even the most basic melodies while they learn the new arrangement. Likewise, when it comes to keyboard shortcuts in your favorite IDE, any change can be disorienting quickly. Luckily, Visual Studio for Mac offers a ton of customizations to key bindings that will allow you get configure your key combinations to your liking.
Read more →
Total votes 5: ↑3 and ↓2 +1
Comments 0

Introducing solution-level NuGet Package Management in Visual Studio for Mac

Reading time 2 min
Views 1.4K
Visual Studio 2019 for Mac version 8.3 comes with many new features as summarized in this blog post. While the entirety of this release was greatly influenced by your feedback, having the ability to manage packages at the solution level was one of the capabilities that most of you expressed as lacking in Visual Studio for Mac. A new solution-level NuGet Package Manager is one of the exciting new features of Visual Studio 2019 for Mac version 8.3.

We’ve made improvements to help you discover packages more easily. This includes an improved experience while searching for new packages, gaining an understanding of what packages are already installed in your project, and finding packages that have updates available. In this blog post, we will focus on the package management experience for a Solution. However, most of the experiences including installing, updating, and viewing installed packages have a similar new experience at the project-level, too.

To launch the NuGet Package Manager for a Solution, you can go to the context menu for the Solution and select «Manage NuGet Package…»:

Read more →
Total votes 1: ↑1 and ↓0 +1
Comments 0

Visual Studio for Mac: Top Features of the New Editor

Reading time 4 min
Views 1K
Over the past year, the Visual Studio for Mac team updated the editors within the IDE to be faster, more fluent and more productive. We did this by building a macOS-native editor interface on top of the same editor backend as Visual Studio on Windows. In version 8.1 we introduced the new C# editor. This was followed by the new XAML editor in 8.2. And most recently, we updated our web languages to utilize the new editors in version 8.3, completing the process we set out to do a year ago. To celebrate this accomplishment, I wanted to share a bit of detail regarding the design and implementation of the new editors along with my five favorite new features in the Visual Studio for Mac code editors.

At the core of the updated editors within Visual Studio for Mac is the shared language service with Visual Studio on Windows. What this means is that the same backend that powers the Windows version of Visual Studio now powers the macOS version as well. This includes IntelliSense, Roslyn, text logic, and all the language services behind the scenes. The only portion not shared between Windows and macOS is the UI layer, which stays native for each platform. In the case of macOS, that means using macOS frameworks like Cocoa and CoreText to power the UI experience. By using a native UI, while also being able to utilize support for native input methods as well as support for right-to-left languages, font ligatures and other advanced graphical features.

Read more →
Total votes 3: ↑3 and ↓0 +3
Comments 0

Here’s How to Update Node.js Via Visual Studio, NPM, Windows/Mac

Reading time 4 min
Views 90K


I hope that you will find Node version 12 new capabilities compelling and soon you will upgrade your app to it.

In turn, you will get advanced debugging, intelligent coding with the powerful IntelliSense engine, interactive window, quick tracking of performance issues, unit testing, typescript integration, source control, cloud integration, and npm integration.

To get started in this walkthrough, this post captures the steps on how to update Node.js in Visual Studio, Windows/macOS, and NPM.
Read more →
Total votes 5: ↑5 and ↓0 +5
Comments 0

Microsoft Edge for macOS

Reading time 3 min
Views 1.9K

Last month, we announced the first preview builds of the next version of Microsoft Edge for Windows 10. Today, we are pleased to announce the availability of the Microsoft Edge Canary channel for macOS. You can now install preview builds from the Microsoft Edge Insider site for your macOS or Windows 10 PC, with more Windows version support coming soon.


Снимок экрана Microsoft Edge для macOS

Read more →
Total votes 13: ↑11 and ↓2 +9
Comments 1

Getting Ready for macOS’s Hardened Runtime and Notary

Reading time 2 min
Views 1.2K

With macOS Mojave, Apple introduced support for Hardened Runtime and Notary service. These two services are designed to improve application security on macOS. Recently Apple has stated:


“Beginning in macOS 10.14.5, all new or updated kernel extensions and all software from developers new to distributing with Developer ID must be notarized in order to run. In a future version of macOS, notarization will be required by default for all software.”



Today will help you to understand new rules from the Xamarin point of view.
Read more →
Total votes 7: ↑7 and ↓0 +7
Comments 0

Authors' contribution