Text

Simple controller to present Path like sliding controllers

To use the class simply import TMViewDeckController.h and init the controller with any UIViewController:

[[TMViewDeckController alloc] initWithCenterController:navigationController];

Than you can slide the center controller to the side and present any controller below using one of these two methods:

slideCenterControllerToTheRightWithLeftController:leftController animated:withCompletion: slideCenterControllerToTheLeftWithRightController:animated:withCompletion:

To slide the center controller back just call:

slideCenterControllerBackAnimated:withCompletion:

Here is the code of the class TMViewDeckCategory

Text

UIImageView category to get image download progress

I’ve found a problem with getting download progress of downloaded image using AFNetworking UIImageView category (https://github.com/AFNetworking). The problem is the AFImageRequestOperation property is private.

So I’ve created new category to extend the AFNetworking’s one

Here is the code of the category UIImageView category

Text

Detect HW Volume buttons actions simply

I’ve created the simple class to detect using of HW Volume buttons.

  • detect pressing of Volume Up/Down buttons for example to capture the image using Volume-Up button
  • detect it while MusicApp is playing
  • keep Volume HUD hidden

Here is the source code with example: https://github.com/martinpilch/MMMVolumeButton

(based on RBVolumeButtons https://github.com/blladnar/RBVolumeButtons)

Text

Problem setting nil image to UIImageView with CALayer mask and transition

I’ve found a problem with setting the nil image to UIImageView subclass when the mask and transition animation is applied.

I’m using CALayer mask to make the image circle.

In setImage: override I’m adding the transition to animate change of the image.

When I’m setting the nil image, the layer is no more used (the image is no more circle) but the image doesn’t disappeared.

When I’m not using the CATransition everything is OK.

What could be the problem? I know how to avoid it but I’m looking for the reason.

You can follow the Apple Developer forum question

Here is the code of the UIImageView subclass

Photo
Photo
Photoset

Freeride in Beskydy Mountains

Photo
Today, Wood Camera made it to the #1 in Top Paid Apps in US AppStore! Finally!

Today, Wood Camera made it to the #1 in Top Paid Apps in US AppStore! Finally!

Photo
Keep smiling :)

Keep smiling :)

Tags: freeride snow
Photo
Tags: freeride snow
Text

How to calculate size of image fitted into UIImageView

When you set the contentMode of the UIImageView to UIViewContentModeScaleAspectFit you would like to know the size of the fitted image.

Here is simple category where you can see how to do it:

UIImageView+ImageSize

Photo
invasivecode:

Flags: very useful when debugging with Instruments

There is a very nice feature in Instruments that helps you to point your loupe to a very precise spot in your code.

I am writing an app that process images captured by the camera in real-time. I am using GCD to launch different queues both in asynchronous and synchrous mode and when it is time to debug, it’s a mess. Most of the time I need to know extactly what is doing what and where something is executing.

Using the breakpoints interrupting the execution and analyze the status of your variable, it is not always useful in a multi-threaded environment, because you alter the real flow of your application.

My mind went immediately to Instruments and I found a very cool tool that you can use to know when something is executing.

Performance Session

To use this feature, you need to add to your Xcode project the DTPerfomanceSession.framework and #import <DTPerformanceSession/DTSignalFlag.h> into the class you want to analyze.

Now, wherever you need to send a signal to Instruments from your app, you just add this line of code:

DTSendSignalFlag("com.invasivecode.mytracepoints.app.point", DT_POINT_SIGNAL, TRUE);


You can also mark the start and the end of something, inserting these lines at the beginning and at the end of your code chunk:

// Put this line at the beggining
DTSendSignalFlag("com.invasivecode.mytracepoints.app.start", DT_START_SIGNAL, TRUE);

// ... more code here

// put this at the end
DTSendSignalFlag("com.invasivecode.mytracepoints.app.end", DT_END_SIGNAL, TRUE);


Done that, you can now lunch your Instruments, select the tool or the set of tools (Allocation, Profiler, etc.) you need and start to analyze your code. When the execution hits the above macros, Instruments will show a flag in the timeline as illustrated here:



You can also click on each flag and it will provide you with some detail information:



You can imagine how this is useful during the debugging and especially in a multi-threaded environment, where lots of things are happening in parallel. If you combine this with small tricks like putting a short sleep in your code, you can really get very close to each bit of execution.

Geppy

invasivecode:

Flags: very useful when debugging with Instruments

There is a very nice feature in Instruments that helps you to point your loupe to a very precise spot in your code.

I am writing an app that process images captured by the camera in real-time. I am using GCD to launch different queues both in asynchronous and synchrous mode and when it is time to debug, it’s a mess. Most of the time I need to know extactly what is doing what and where something is executing.

Using the breakpoints interrupting the execution and analyze the status of your variable, it is not always useful in a multi-threaded environment, because you alter the real flow of your application.

My mind went immediately to Instruments and I found a very cool tool that you can use to know when something is executing.

Performance Session

To use this feature, you need to add to your Xcode project the DTPerfomanceSession.framework and #import <DTPerformanceSession/DTSignalFlag.h> into the class you want to analyze.

Now, wherever you need to send a signal to Instruments from your app, you just add this line of code:

DTSendSignalFlag("com.invasivecode.mytracepoints.app.point", DT_POINT_SIGNAL, TRUE);

You can also mark the start and the end of something, inserting these lines at the beginning and at the end of your code chunk:

// Put this line at the beggining
DTSendSignalFlag("com.invasivecode.mytracepoints.app.start", DT_START_SIGNAL, TRUE);

// ... more code here

// put this at the end
DTSendSignalFlag("com.invasivecode.mytracepoints.app.end", DT_END_SIGNAL, TRUE);

Done that, you can now lunch your Instruments, select the tool or the set of tools (Allocation, Profiler, etc.) you need and start to analyze your code. When the execution hits the above macros, Instruments will show a flag in the timeline as illustrated here:

Instruments flags

You can also click on each flag and it will provide you with some detail information:

Flag details

You can imagine how this is useful during the debugging and especially in a multi-threaded environment, where lots of things are happening in parallel. If you combine this with small tricks like putting a short sleep in your code, you can really get very close to each bit of execution.

Geppy

(Source: invasivecode)

Text

Simply display video content on AirPlay device

If you want to display content on monitor/TV connected to any AirPlay device, all you need to do is to handle device connection/disconnection notifications.

Take a look into the source code example: AirPlay

Text

Simple JSON response parsing in ObjC

Easy as hell! Just use Mantle framework. https://github.com/github/Mantle

Photo
First ride!

First ride!

Tags: snow ski