Image manipulation using view transitions and transforms

Image Manipulation

I recently took on a code challenge that was delivered in an interesting fashion.   I was given a video that showed the manipulation of two images and was asked to create an iOS app that had the same behavior as the video.

ImageTransform

 

Requirements

After watching the video (many times), I extracted the following requirements for my app:

Continue reading

Advertisements

Exploring the Contactually API

Contactually Overview

As a software professional I am interested in maintaining good relationships with my connections.    While I never thought to use a CRM for such a purpose, that just might change after coming across Contactually.

contactually-logo

 

Contactually allows you to collect and merge contact information from various sources including e-mail, calendars and social networks (LinkedIn, Facebook, Twitter).   Contactually can help you with automatic reminders to follow-up with your connections, but that is just a small part of what the platform offers.  Some of the key features are centered around Buckets, Templates, Programs and Pipelines.

Continue reading

Exporting a video in iOS to reduce size and ensure maximum client compatibility

Movies that lay on their side

Have you ever taken a Portrait oriented movie with your iPhone or iPad and sent it to your friends who were using Windows?   I can understand their frustration when the video I so carefully recorded causes them to bend their neck to the side:

rotated_portrait

So what’s going on here?  The problem is that the .MOV file that I send them has a 90 degree rotation set as the preferred transform.   Some Windows clients (such as Windows Media Player, VLC media player, etc) do not take this transform into consideration when presenting the video.

The VideoExport Swift Project

I wanted to create a project that would allow me to address the issue with rotations and other compatibility concerns.

I published my results to scottcarter/VideoExport on Github.

Continue reading

Logging and bookmarks with Objective-C and Swift

Overview

This article discusses the techniques I use for bookmarking code and adding log statements for both Objective-C and Swift.

ObjC_Swift_logging

Temporary Bookmarks

When I develop code I often find a need to temporarily reference different sections that I’m working on, either within the same file or in many different files.   Prior to Xcode 4 there was apparently a means to set and jump to bookmarks with keyboard shortcuts as mentioned in the article Killer Xcode Tips and Tricks – Tips 1 to 10 (see tips 7 and 8).

Continue reading

Using a video composition to process certain videos causes an Xcode simulator hang

Video Export Project

I am working on a project that will process videos taken with the camera or pulled from the Photo Library and export them to MP4 format, reducing the dimensions and bit rate.

As part of this process I am using the code for SDAVAssetExportSession that is a AVAssetExportSession drop-in replacement with customizable audio and video settings.

Video Composition

I make use of an instance of AVAssetReaderVideoCompositionOutput that is added to AVAssetReader in SDAVAssetExportSession.m.  I set the videoComposition property of the former instance to a composition that allows me to set the render size and some appropriate transforms for scaling, etc. (CGAffineTransform).

Continue reading