Implementing Swift Package Manager –Creating Packages

This entry is part 2 of 14 in the series Swift Package Manager

What Makes A Package?

Packages are actually resolved and implemented by the built-in Swift build system at the time the package consumer project is opened (but they are linked at project build time), and rely on the executable Package.swift file, provided by the package creator.

It should be noted that, because the packages are not actually resolved and built during the project build process, their logs are not introduced to the main project build log. In a later post, I will discuss how I deal with this.

Read more

Implementing Swift Package Manager –Introduction

This entry is part 1 of 14 in the series Swift Package Manager

This Comes From Personal Experience, Working On Ship Code

The genesis for this series came about, as I decided to convert the majority of my repos to use SPM. I had a number of issues and stumbling blocks, and decided that documenting the process might be helpful to others.

This work will cover the newer type of SPM integration, that is embedded into Xcode, and applies to all Apple operating systems. SPM has been around for a few years, but previously, tended to be a bit “niche,” applying mostly to server-side Swift.

It should be noted that the screengrabs and walkthroughs will be using Xcode version 11.5, so the exact workflows are likely to change, over time.

Read more

Improving an SDK With Core Bluetooth – Error Handling

This entry is part 6 of 7 in the series Improving an SDK With Core Bluetooth

We’ve actually already done most of the work for this item, but let’s see if there’s anything more we can do (at this point).

Remember that one of our current restrictions is to have no changes in the apps, themselves, so anything that we do has to be in the SDK-src directory. At this point, the Apps-src directory is still at the same version it was when we started (Tag itcb-09).

Everything that we’ve done, to this point, has been in the SDK.

Read more

Improving an SDK With Core Bluetooth –What’s Going On?

This entry is part 2 of 7 in the series Improving an SDK With Core Bluetooth

Before we dive in, let’s take a bit of time to review how Core Bluetooth handles communications between Centrals and Peripherals.

THE PERIPHERAL MANAGES THE SERVICES, CHARACTERISTICS, AND DESCRIPTORS

As was noted in the previous series, the Peripheral is responsible for setting the values of Characteristics, and managing the lifetimes of Services.

The Central will have CBPeripheral, CBService, CBCharacteristic, and CBDescriptor instances, but they will all be read-only “proxies” of the CBPeripheralManager, CBMutableService, CBMutableCharacteristic, and CBMutableDescriptor instances managed by the Peripheral.

What’s nice, is that Core Bluetooth abstracts all the nitty-gritty of Bluetooth transport for us, and gives us a fairly manageable API.

Read more

Improving an SDK With Core Bluetooth – Confirmed Delivery

This entry is part 5 of 7 in the series Improving an SDK With Core Bluetooth

One thing that we can do, is make sure that the Peripheral actually gets our question. Right now, we simply rely on the fact that we sent it to confirm its receipt.

We would like to wait until the Peripheral actually tells us that it received the question before we assume that it has been sent.

Read more