Canvas Dx is an FDA authorized machine learning-based system to diagnose Autism in children aged 18 months to 6 years old. The parent or caregiver uses a simple app to answer questions and record and upload two home videos—all from the comfort of their own home.
I led the iOS project for four years and contributed to it for more than six. Throughout this time, I either implemented or, through various technology transitions, refactored each feature. The features were designed through a team process that included the Android and Server engineers. The vast majority of the time, I led the discussion, brought the initial research, and/or took on the role of documenting the solution for final team approval.
The basic user facing features of the app include:
- User registration flow.
- Password and biometric login.
- Overview and progress display.
- Video recording with custom compression and UI.
- Background upload of video.
- Video rejection user flow.
- Parent questionnaire.
- Contact support.
- Display and sharing of the final report, user guide, privacy policy, and terms of service.
- Universal deep links.
- Playback of instructional videos.
- Forced update screens directing the user to update via the AppStore or to update their iOS version.
* A previous iteration of this codebase was used to publish the Cognoa Enterprise app.
Over the long life and evolution of Canvas Dx, I was responsible for transitioning it:
- From a prototype to a well-factored project.
- From a standalone app to multiple frameworks consumed by multiple apps.
- From Objective-C to Swift.
- From Storyboard-based navigation to coordinator-based server-directed navigation.
- From UIKit to SwiftUI using the MVVM pattern.
- From completion handler-based async patterns to Swift Concurrency async/await APIs.
- From CocoaPods dependency management to Swift Package Manager.
Server driven UI
To meet the fast-changing business needs of the startup, the app was built around a server-driven UI and navigation system. Any server response could direct the user to a specific screen. The server had complete control over the content and UI elements of the screen through a library of native views, controls, and actions. This system provided many benefits, including: less duplication of code, better testing, and consistency of implementation between the iOS and Android implementations.
Various UI elements included and configured by the server:
- Buttons with a library of styles that could execute a library of actions.
- TextFields with formatting and content validation performed both locally and through a server request.
- Images.
- Text which may include styling and links.
- Menus whose items could execute a library of actions.
- Groups used for complex layouts.
- Task Buttons updated with client-side progress of uploads or questionnaire status.
- HLS video conversion and playback.
- Navigation Control: Add to, or replace, screens in the current navigation stack.
Testing
I established the testing automation infrastructure and CircleCI configuration. The automated testing setup includes a repo shared between platform teams, which included server responses and sample data. I wrote various code generation tools used to access the test data, collected metadata notated on tests, and generated the regulatory compliance report that documented that the testing was successful. Swift Danger was used to ensure PRs included the necessary GitHub references used in our automated logging and regulatory documentation system. The dependency management was originally setup with CocoaPods and I used this for our internal frameworks as well. Later this was transitioned to Swift Package Manager.
Project Automation and Setup
The Canvas Dx iOS app was the culmination of many years and iterations. The codebase was also used to produce multiple apps and frameworks used within additional apps. These included:
- Cognoa Enterprise: A non-regulated autism screener, informational resource, and child development activities planner.
- Cognoa Research: Used in the clinical study to validate and verify the efficacy of the system and resulting diagnosis.
- Video Recorder: The core video upload framework was used in a custom app distributed through the Enterprise Program using MDM. The app was used by research coordinators through the clinical trial to record and upload the study subjects during the use of the Cognoa Research app.
- Autism Therapy Prototype: The core user account and authentication framework and video upload framework were used in a Unity-based game being developed to provide therapy for some aspects of autism. The Unity layer was developed by an outside vendor and consumed the Cognoa frameworks through an Objective-C and C# adapter I wrote.
Regulatory Documentation
Canvas Dx is an FDA-regulated device, including the iOS and Android apps of the same name. As a part of the regulatory process, I was a key member of documenting the technical design of the app in the form of a Software Design Specification (SDS). Through this process, we described all key aspects of the system in varying levels of detail depending on risk levels to the patients. This was an in-depth process that gave me insight into the importance of communicating technical solutions in a clear, understandable, and precise way.