Cocoa Source Code

In this page, you can find some chunks of my Cocoa/Swift source code.

All the code is provided in small Xcode projects. Each project is designed to implement one feature only, so as to increase the readability of the code. Almost every one of the below listed projects represents a small part of the educational app, that i am currently working on. My progress towards the app completion is slow, due to the limited time i can devote to programming. Although i cannot reveal more details about the app, i am very happy that i am in position to share some of the solutions of the various smaller programming problems i ecountered so far.

Other Mac OS X developers and Cocoa enthousiasts are welcome to download and use the source in any way they like.

I assume that you’re a programmer / developer with sufficient Cocoa knowledge to know how to read, understand and make use of the source. Due to my limited free time, i will not be able to provide any further support, but i will be happy to hear your comments about the provided code. The source code is well documented.

Happy reading and happy coding!!!


  1. Sample Drawing App
    (Posted on: May 8, 2017)

    Sample Drawing App provides a view with a background color and basic drawing capability. User can draw by clicking or clicking and dragging the mouse button. No color choosing, no ability to erase a drawing. No ability also to store the drawing to a file, for restoring later.
    Concentrate your reading in methods mouseDown, mouseDrag and mouseUp of the DrawingCanvas.swift file. These 3 events contain most of the application logic.
    Note: this code was created using OS X 10.12 (Sierra) and Xcode 8.2.1.
  2. Paper View App
    (Posted on: Oct 30, 2017)

    Sample App that provides a view with a background that resemples a real notebook paper. There is no user interaction; the user cannnot draw anything in the view.
    Concentrate your reading in methods drawBackground, drawHorizontalLines and drawVerticalLines of the PaperView.swift file. These 3 methods create the background with the paper look.
    Note: this code was created using OS X 10.13 (High Sierra) and Xcode 9.0.1.