Giter Club home page Giter Club logo

resplendentutilities's Introduction

ResplendentUtilities

A block of Objective-C code, uncompiled, in source form that accomplish various tasks in various roles.

Categories

NSDate+Utility

122 seconds returns 2m, and so forth up to days.

[_timeLabel setText:_idea.createdAt.daysOrHoursOrMinutesOrSecondsString];

NSManagedObject+Utility

Convenience method that automatically diff's with the receiver to prevent unruly dirty flags in Core Data. You can then easily enumerate JSON objects, setting each property on each Core Data object to it's value on the server, call save, and know your NSFetchedResultController's delegate will only get a single callback with the change.

NSManagedObject* i = [NSEntityDescription insertNewObjectForEntityName:@"myEnt" inManagedObjectContent:m];
[i updateValue:[mediaDic objectForKey:@"type"] propertyName:@"mediaType"];

UIButton+Utility

C function which sets a UIButton's frame to it's normal, selected, or highlighted image size at given coordinates.

setButtonSizeToImageAndCoordinates(_friendsButton, _photosButton.frame.origin.x, 0);

Best when called in -layoutSubviews to keep a UIButton matching the size of an image which might've changed the last time through the draw pipeline.

+(UIButton*)buttonCrossWithFrame:(CGRect)buttonFrame crossColor:(UIColor*)crossColor crossSize:(CGSize)crossSize

Creates an X button which is truly a clickable X rather than a rectangular frame containing a drawn X. Think different.

UIImage+Resizing

C function which resizes an UIImage to a target size, whilst keeping the aspect ratio the same. Note, this can leave undrawn, or transparent space. Helpful for reducing photos passed by UIImagePickerController.

UIImage* resizedImagePreservingAspectRatio(UIImage* sourceImage, CGSize targetSize)

UIView + CoreGraphics

resplendentutilities's People

Contributors

benmaer avatar benmaerfi avatar sheldonth avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.