Skip to content

ManuelBulos/PhotoBooth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PhotoBooth

MacOS App Coding Exercise

Install

Download the project or run:

$ git clone https://github.com/ManuelBulos/PhotoBooth.git

Run

Open photobooth.xcodeproj and hit run

After capturing a snapshot you'll be presented with the editing window:

Editing

When you are finished editing you can choose to save your work as .png or a .photobooth file. If you choose .photobooth you can open up that file again and keep editing (undoing previous lines and drawing new ones)

Saving

Technologies used

Frameworks

AVFoundation used for previewing computer's camera.

CoreGraphics used to handle path-based drawing

Third Parties

AEXML lightweight XML parsing. helps photobooth read polylines from svg files previously created using CGPoint arrays

PhotoBooth Document (.photobooth package)

The .photobooth extension is a UTI

Mac apps can add new uniform type identifiers for proprietary data formats. You declare new UTIs in the information property list (info.plist) file of a bundle.

This means that .photobooth is a directory (package) that contains 2 files:

  • the image in a .png format
  • the .svg file created from the CGPoints drawn inside the CGContext

This way we can open the png image, then parse the svg into an array of CGPoints and draw them again on top of that image.

I chose svg format because it's very easy to generate an XML file (SVG) from a given collection of CGPoints, we just need to map the x and y of each point to a polyline element on the XML File.

Unit Testing

To run the unit tests just Open photobooth.xcodeproj and select the class photoboothTests in the photoboothTests.swift file

IMPORTANT NOTE: the test named "testSavingAndReadingFiles" prompts you with a window, so make sure to select a directory from there.

Docs Reference

You can find more info about the project in the documentation

About

MacOS App Coding Exercise, Samsung NEXT. (got hired 💪)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •