Skip to content

Latest commit

 

History

22 Commits

Folders and files

Repository files navigation

Telegram iOS Contest - Drawing App

Drawing application with Apple Pencil and touch support built for a Telegram iOS Contest.

Awarded 4th place with an $800 prize.

Overview

This project is an older contest app modernized as a portfolio artifact. The app lets users choose a photo from the photo library, draw over it on a custom canvas, adjust brush color and width, add simple shapes/text, undo strokes, clear the canvas, and export the edited result back to Photos.

Contest Result

  • 4th place
  • $800 award
  • Built as an independent contest project

Technical Highlights

  • UIKit-based photo editing flow
  • Custom Core Graphics drawing canvas
  • Apple Pencil and touch input handling
  • Coalesced touch processing for smoother strokes
  • Stroke model and rendering pipeline separated from the view layer
  • Brush/color/opacity controls
  • Undo and clear support for drawing strokes
  • Photo Library import/export
  • Accessibility labels for primary editing controls

Architecture

The original contest project was a compact MVC UIKit app. It has been refactored toward a clearer MVVM-style structure while preserving the original product behavior.

TelegramContest/
  Domain/
    DrawingDocument.swift
    DrawingTool.swift
    Stroke.swift
    StrokePoint.swift
  Presentation/
    Canvas/
      CanvasState.swift
      CanvasViewModel.swift
  Rendering/
    DrawingRenderer.swift
    DrawingRendering.swift
    PathSmoother.swift
    StrokeRenderer.swift
  Input/
    PencilInputHandler.swift
  Persistence/
    ImageExporter.swift
  Controller/
  View/
  Extensions/
  Transition/

Current Responsibilities

  • CanvasView owns UIKit drawing lifecycle and forwards touch events.
  • CanvasViewModel owns drawing state and stroke lifecycle.
  • PencilInputHandler converts UIKit touches into domain-level StrokePoint values.
  • DrawingRenderer and StrokeRenderer isolate Core Graphics rendering.
  • DrawingDocument stores completed strokes and supports undo/clear.
  • ImageExporter owns view snapshot export.

Screenshots / Demo

Placeholder assets are included until real device screenshots are added.

Canvas placeholder Tools placeholder

Running the Project

  1. Open TelegramContest.xcodeproj in Xcode.
  2. Let Xcode resolve the Swift Package dependency for Lottie.
  3. Select the TelegramContest scheme.
  4. Build and run on an iPhone simulator or device.
  5. Grant Photos access when prompted.

Requirements

  • Xcode 14 or newer
  • iOS 13.0 or newer
  • Swift 5
  • Swift Package Manager dependency: lottie-ios

Known Caveats

  • This is an older contest project, not a production photo editor.
  • Text and shape editing are intentionally lightweight.
  • Undo currently applies to drawing strokes, not every editor object type.
  • The renderer redraws all strokes on every invalidation; a cached/tiled renderer would be the next performance step for very large drawings.

What I Improved During Cleanup

  • Introduced domain models for strokes, stroke points, tools, and documents.
  • Separated input handling, drawing state, and Core Graphics rendering.
  • Added coalesced touch collection and Pencil metadata capture.
  • Removed screen-height coordinate offsets from canvas rendering.
  • Replaced global canvas/color callbacks with instance-level bindings.
  • Replaced synchronous photo loading paths with asynchronous image requests.
  • Removed stale CocoaPods project references and hard-coded manual signing.
  • Added export isolation through ImageExporter.
  • Reduced force unwraps in drawing, color, gallery, transition, and asset-loading paths.
  • Added accessibility labels for core editor, color picker, gallery, and access controls.

What I Would Improve Today

  • Add unit tests for CanvasViewModel, stroke lifecycle, and color parsing.
  • Add UI tests for the gallery-to-editor-to-export flow.
  • Add a renderer cache so completed strokes are not fully redrawn on every touch update.
  • Add predicted Pencil touches and better force/width mapping.
  • Add a real document persistence format for editable drawings.
  • Extend undo/redo to text, shapes, color changes, and object transforms.
  • Replace hard-coded layout constants with a more adaptive design system.
  • Add real screenshots and a short screen recording.

About

Built by Ivan Nichypar.

Senior iOS Engineer focused on complex UI systems, SwiftUI/UIKit, accessibility, performance, custom interactions, Apple Pencil/touch input, and product-quality mobile UX.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages