Рубрика: ‘iOS’

AsyncURLConnection with pause/resume and progress +block’s

I rewrite one class with async connection, and add progress block and pause/resume. Example usage: 123456789101112131415NSString *comboUrl = @"http://support.apple.com/downloads/DL1484/en_US/MacOSXUpdCombo10.7.3.dmg"; AsyncURLConnection *aConnection = [AsyncURLConnection request:comboUrl                   completeBlock:^(NSData *data, NSString *url) {                       [data writeToFile:filename atomically:NO];       [...]

Теги: , , , , , , , ,

Комментарии отсутствуют

Create movie from array of images

Create movie from images seq. First part of method, initialize 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950- (void) writeImagesAsMovie:(NSArray *)array toPath:(NSString*)path {     NSString *documents = [NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex: 0];     documents = [documents stringByAppendingPathComponent:currentWorkspace];         //NSLog(path);     NSString *filename = [documents stringByAppendingPathComponent:[array objectAtIndex:0]];     UIImage *first = [UIImage imageWithContentsOfFile:filename];     [...]

Теги: , , , , , , ,

Комментарии отсутствуют

Masked Shape layer with gradient

Layer with CGPathRef and animated. And added masked gradient for layer. ViewLayers.h 1234567891011121314151617181920212223242526272829303132// //  ViewLayers.h //  layers // //  Created by Volodymyr Boichentsov on 1/28/12. //  Copyright (c) 2012 www.injoit.com. All rights reserved. // #import <uikit /UIKit.h> #import <quartzcore /QuartzCore.h> @interface ViewLayers : UIView {     CGRect firstRect;     CGRect secondRect;     [...]

Теги: , , , , , ,

Комментарий (1)

Good post about CAShapeLayer

Animating the drawing of a CGPath with CAShapeLayer Thanks for Ole Begemann.

Теги: , , ,

Комментарии отсутствуют

UIBezierPath

UIBezierPath is a convenient object for creating rounded-rectangular shapes. Starting from 3.2, this class becomes public, but the interface is dramatically changed to match that of NSBezierPath. 12345678910-(void)drawRect:(CGRect)rect {   UIBezierPath* roundedRect = [UIBezierPath roundedRectBezierPath:CGRectInset(rect, 5, 5)                                     [...]

Теги: , , , ,

Комментариев (2)

Convert one day to one minute

I create simple project for iOS, “One minute”. This project create video from photos on iOS device. Results of app:

Теги: , , , , , , ,

Комментарии отсутствуют

UIColor from hex

I added 2 new methods to category UIColor. 123456789101112131415161718+ (UIColor* ) colorWithHex:(int)color {     float red = (color & 0xff000000) >> 24;     float green = (color & 0x00ff0000) >> 16;     float blue = (color & 0x0000ff00) >> 8;     float alpha = (color & 0x000000ff);     return [UIColor [...]

Теги: , ,

Комментарии отсутствуют

GLKit and MSAA

Enable MSAA Anti-Aliasing in GLKit. Just enable: 12GLKView *view = (GLKView *)self.view; view.drawableMultisample = GLKViewDrawableMultisample4X; Without MSAA:   With MSAA: GLKit_MSAA_Sample

Теги: , , , , ,

Комментарий (1)

ScrollView with scroll’s indicators, which are shown all the time.

My simple solution by writing category for UIImageView, because scroller is imageview. How to use :) Just setup tag for your scrollview and you will get one with scroll indicators, which are shown all the time. 1234567891011121314151617181920212223242526272829303132#define noDisableVerticalScrollTag 836913 #define noDisableHorizontalScrollTag 836914 @implementation UIImageView (ForScrollView) – (void) setAlpha:(float)alpha {         if (self.superview.tag [...]

Теги: , , , , , , , , , ,

Комментарии отсутствуют