CodeChallenge for Banjomaps

by Dmitrii Zverev 20 June 2018

Given Tasks::

  • User should be able to spawn an infinite number of squares or circles filled with random colours or images
  • Application consists of one single screen
  • Create squares or circles which randomly fill with random colours or images when the user taps on the main background
  • Created shapes are placed at the user’s tapped location
  • Create a shape at a random size within appropriate ranges
  • Fill circle with an colour that is generated by calling the api from http://www.colourlovers.com/api/colors/random?format=json. use either RGB or Hex value
  • Fill square with an image that is generated by calling the api from http://www.colourlovers.com/api/patterns/random?format=json. use imageUrl value
  • If no connection is available from the above url, use code to generate random colours
  • double tapping the shape replaces the colour based on the above mentioned rules
  • You can not use any third party libraries

Given Extra tasks:

  • When a user taps the screen, add an animation for the shapes that appear
  • Remove all shapes when shakes device
  • Be able to move a shape around
  • A user can use a pinch action to enlarge or shrink the size of the shape
  • Working app for both iOS and Android AGAINST MY RELIGIOUS

In this challenge, I also demonstrated that I know how to use:

  • structs
  • enums
  • optionals
  • Codable
  • class extensions and sub-classes
  • Threads
  • URL Sessions
  • Error throwing Enums
  • closures
  • escaping
  • Haptic feedback
  • animation
  • Creating UIViews programmatically
  • Avoiding Massive View Controllers
  • writing code without single warning
  • .. and much more