• Red-Black tree implementation in Swift

  • Augmented interval tree in Swift

    Augmented Interval tree is a data structure to search for overlapping intervals. I have nothing much to add to the [article written by Davis Molinari(http://www.davismol.net/2016/02/07/data-structures-augmented-interval-tree-to-search-for-interval-overlapping/), so here is a Swift version: Read more...
  • Playground

    Hey! Checkout my playground. Will update it with new code-math-motion-art experiments weekly. Read more...
  • $1 Unistroke recognizer

    The $1 Unistroke Recognizer is a 2-D single-stroke recognizer designed for rapid prototyping of gesture-based user interfaces. In machine learning terms, $1 is an instance-based nearest-neighbor classifier with a 2-D Euclidean distance function, i.e., a geometric template matcher. Read more...
  • Operations on 2d vectors using AdditiveArithmetic

    AdditiveArithmetic was first presented in Swift 5. The protocol provides a basis for additive arithmetics on scalar values. From mathematical point of view it provides generic solution for Additive group. Read more...
  • Operations on 2d vectors in Swift

    Lately I was playing with graphic experiments that required Math and Physics. Thinking about sharing some code and thoughts. I can do in two ways: Read more...
  • iOS Data Storage best practices

    This articles is a cheatsheet on organized and optimized data storage for iOS app. Read more...
  • Custom unwrapper

    The Optional type is an enumeration with two cases. .none is equivalent to the nil literal. .some(Wrapped) stores a wrapped value. You must unwrap the value of an Optional before you can use it. Read more...
  • Type erasure in swift

    When defining a protocol, it’s sometimes useful to declare one or more associated types as part of the protocol’s definition. An associated type gives a placeholder name to a type that is used as part of the protocol. The actual type to use for that associated type isn’t specified until... Read more...
  • UITextView with placeholder

    The idea was to make the simplest possible solution which allows to use placeholders of different colors, resizes to placeholders size, will not overwrite a delegate meanwhile keeping all UITextView functions work as expected. Read more...
  • Card UI interactive transition

    Managed to update Interactive Transition code sample. It needs some refactoring, pull requests are welcomed. Read more...
  • Mathematical Model for Road Cycling Power in Python

    Python illustration for Validation of a Mathematical Model for Road Cycling Power James C. Martin, Douglas L. Milliken, John E. Cobb, Kevin i. McFadden, and Andrew R. Coggan Read more...
  • UICollectionViewCell dynamic cell height (Swift 4)

    UICollectionView is an object that manages an ordered collection of data items and presents them using customizable layouts. (UICollectionview documentation) Read more...
  • List comprehensions and Swift

    A list comprehension is a syntactic construct available in some programming languages for creating a list based on existing lists. It follows the form of the mathematical set-builder notation (set comprehension) as distinct from the use of map and filter functions. Read more...
  • Sequence and Iterator

    Working with collections is one of every-day-tasks for most developers. Read more...
  • Functional Swift. Immutability

    The object is immutable if it cannot be modified after it’s creation. If the object can be modified, we say it is mutable. Read more...
  • Thoughts on Functional programming definition

    I googled “functional programming swift” and the similar. Most of the articles on this topic create more questions than answers. Authors often skip important definitions and principles, and starts directly from .map-.reduce tutorial. Skipping the concept steals important building blocks, which leads to unstable foundation. Read more...
  • Swift closures cheatsheet

    Closures are self-contained blocks of functionality that can be passed around and used in your code. Closures in Swift are similar to blocks in C and Objective-C and to lambdas in other programming languages. Swift’s closure expressions have a clean, clear style, with optimizations that encourage brief, clutter-free syntax in... Read more...
  • Swift functions cheatsheet

    The function is a self-containing block of code for performing the specific task. The function is a thing, that we use every day. It’s like a building block for our code. Read more...