Ivan Rublev

4pods

PersistentStorageSerializable

Number of protocols from this pod helps to serialize swift class or structure to persistent storage like User Defaults or Keychain. The class/structure must contain properties of simple data type only. These types are: Data, String, Int, Float, Double, Bool, URL, Date, Array, or Dictionary. Adopt the PersistentStorageSerializable protocol from your struct. Then call pullFromUserDefaults() or pushToUserDefaults() on instance of your struct.

License: MIT

  • Swift

VRAppSettings

This superclass makes it easier to handle the user's preferences (app's settings). It's intended to be used in iOS primarily. A successor to this class keeps the app settings in properties and stores itself in the defaults system. Although the settings values will not be accessible through the NSUserDefaults class directly, but only via the setters and getters of the VRAppSettings successor. That gives common place for app's setting definition. The possibility to make range and consistency checks of the setting values in setters and getters. The refactoring tool can be used to change the setting's name across the project.

License: MIT

  • Objective C

VRFoundationToolkit

Extends NSFoundation with categories, macros & classes.

Categories

  • NSArray+VRArgument - sequentially passes each element of array to provided selector of target object or class.
  • NSArray+VRCheckMembers - checks if all members of array are of specified class.
  • NSArray+VRIndexes - returns indexes set of passed objects.
  • NSBundle+VRDisplayName - obtains localized display name of bundle with fallback to non-nil string precompiler constant if name is not accessible.
  • NSDate+VRDurations - calculates how much days, hours, minutes between two dates. Returns end of day. Compare two dates by specified NSCalendarUnit units. Return NSDateComponents for specified NSCalendarUnit units. Returns default NSCalendar.
  • NSFileManager+VRDocumentsDirectory - quick access for Documents directory and Temporary directory paths. Random file names generation. etc.
  • NSMutableDictionary+VRExchangeKeys - exchanges keys in dictionary.
  • NSObject+VRPropertiesProcessing - process object properties with blocks. Hash, equality & encode/decode by properties for any object.
  • NSObject+VRProtocolConformation - checks if object/class responds to all selectors required by protocol. Useful as precondition check of object in delegate setter.
  • RTProtocol+VRMethods - returns methods defined in protocol.
  • NSString+VRmd5 - MD5 hash on string.
  • NSTimer+VRWithBlock - timer that executes block instead of selector.
  • NSOperationQueue+VRNamedBlock - add named block operation to queue.

Macros

  • VREnumXXX - generates enums with utility functions. NSStringFromXXX returns enum constant by value. isValidXXX checks range of enum value.
  • VRLOGxxx - multilevel logging & assertion macros. Could be connected to preferable logging system. VRPRECONDITIONxxx macros to implement light design by contract.
  • VRKeyName - stringifyes expression to key for -[NSCoder encodeObject:withKey:]. Useful to make names via help of XCode autocompletion.
  • VRSingleton - return singleton.
  • VROBJCTYPExxx - returns Objective-C type string representation of the passed variable (or type). VRISTYPEEQUALTOTYPE(V1, V2) compares Objective-C types of two passed values/types.
  • VRBundledName - returns NSString with reverse dns bundle name followed by passed NAME at the end of the string.
  • VRRandom - returns random float value calculated via result from random().

Classes

  • VRURLConnectionChecker - checks if default site or specified URL is accessible with completion and error blocks.

Functions

  • NSComparisonInvertedResult - inverts the comparison result.
  • VRCanPerform - checks if object conforms to protocol & responds to selector. Usefull for precondition check in delegate setters.

License: MIT

  • Objective C

VRMaskColoredButton

This is a UIButton class descendant that allows you to set the shape and the color of the button's images independently. Works better with flat designs.

License: MIT

  • Swift