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. Simple Drawing App
    (Posted on: May 8, 2017)

    Simple 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)

    Paper View App 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.
  3. Voice Recorder App
    (Posted on: Oct 25, 2018)

    Voice Recorder App provides a simple interface with two buttons and a log view. User can record his/her voice using the computer's microphone. The recording is saved in a temp file inside the app's default cache directory. The user starts the recording using the record button. Any subsequent recordings will overwrite the previous recordings. Log messages are written into the texView below the two buttons.
    Concentrate your reading in methods updateGUI, setupRecorder, setupPlayer, recordButtonClicked, playButtonClicked and the delegate methods audioRecorderDidFinishRecording and audioPlayerDidFinishPlaying of the ViewController.swift file. These methods contain the app's logic. Finally, the private property appState declared in the Enumerations.swift file represents all possible states of the application.
    Note: this code was created using OS X 10.13 (High Sierra) and Xcode 10.0.