AppDeveloperKit – reusable, configurable Swift classes for iOS

Introducing AppDeveloperKit

I’ve completed the initial release of a project I’ve been working on called AppDeveloperKit.   It is a tool for iOS developers to assist in developing reusable, configurable Swift classes.

Properties are declared in classes and coded to affect appearance and behavior. The values for these properties are stored in a property list (plist) file. A macOS app provides a UI to edit these properties in real-time as an app is actively running on a device or simulator.  An iOS framework coordinates access to the plist file and communication to the macOS app.

 

Features

This is a list of the main features that AppDeveloperKit offers:

Continue reading

Advertisements

Leave Swift Error Propagation Enabled

A harmless Database update

I was debugging a Swift Mac app that I’m developing that uses Realm for a database.  The version of RealmSwift I was currently using was 2.10.0 as specified in my Podfile.

I opened Realm Browser to inspect a record in my database.   Having been recently updated to version 3.0.1, it alerted me that my database was using an older file format and offered to upgrade it.   I accepted without thinking much of it.

An unexpected error

Continue reading

Error reporting for complex unit tests

System level unit testing

I was recently putting together the structure for some system level unit tests of a Swift project.   The structure extended beyond a single file for these tests.   I currently have:

  • SystemTests – Base class for a suite of system level unit tests.
  • BasicSystemTests – Class for my first group of unit tests.  Derives from SystemTests.
  • Various utility classes, each specific to a major section of the project.

Here is an example chain of calls coming from a test case:

BasicSystemTests

   func testModified () {
        
        // Test modification to Project
        //
        createProject(name: "Test Project", bundleId: "TestBundleId", appDelegate: "TestAppDelegate", fsConfig: "TestFsConfig", description: "Test Project Description")
        

SystemTests


   func createProject(name: String, bundleId: String, appDelegate: String?, fsConfig: String?, description: String?) -> String? {
        
        // Is Add New button enabled?
        project.verifyAddNewButton(enabled: false)

ProjectTestUtils

    func verifyAddNewButton(enabled: Bool) {
        XCTAssertEqual(addNewButton.isEnabled, enabled, "Add New button enabled = \(enabled)")
    }
  

The problem – what is the path?

My test case has a bug.  When I run the test case, I see the following in Issue Navigator and the source code editor:

Continue reading

Debugging in LLDB with command regex

Overview

Add the following to ~/.lldbinit and examine Swift objects in LLDB with “mp myobject” for both iOS and macOS, including those in NSView for macOS.

command regex mp 's/(.+)/expr Swift.print(%1)/'

Read on for more info

Goodbye po

I wanted to share a quick tip I discovered that allowed me to more easily examine objects.

Continue reading

Thinking outside the box to debug: Charles Proxy, push and a forced crash

An issue on just one device

A couple of weeks ago, one of my colleagues reported that she found an issue with the iOS app for AAFES EXTRA, an app that I had developed for BlueSoHo for their client The Army & Air Force Exchange Service.

The iOS app was not displaying the expected updated content.  The Android app was working fine.  To make things more difficult, the problem was only occurring on one specific device and could not be replicated on any other devices, even of the same model.

Continue reading