Diagram Library for iOS: Getting Started

A brief guide on how to set up a project and add the diagram library in Xcode.

In order to integrate local xcframework from SwiftDiagram distribution into your project, open the project’s Targets, find the Frameworks, Libraries and Embedded Content section, and drag the Diagramming.xcframework from downloaded SwiftDiagram folder:

Add and Link the diagram

Open the storyboard where you want to add DiagramView. Click the + button on top-right to open the Object Library. Type UIView in the search field and drag the View item to the storyboard scene.

Add View Object

In Identity Inspector, enter DiagramView as Class name, and Diagramming as Module name.

Identity Inspector

Select the Editor -> Assistant menu command, and Ctrl+drag the DigramView instance to the ViewController swift file to create a referencing outlet. Add an “import Diagramming” clause to the top of the swift file.

Outlet

The application can now build diagrams programmatically, or let users draw ones interactively.