Рубрика: ‘iPhone’
Рубрики: iOS on Jan.27, 2012
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) [...]
Теги: CALayer, iOS, NSBezierPath, rounded-rectangular, UIBezierPath
Рубрики: iOS on Jan.24, 2012
I create simple project for iOS, “One minute”. This project create video from photos on iOS device. Results of app:
Теги: AVAssetWriter, AVAssetWriterInput, AVCaptureDeviceInput, AVCaptureVideoDataOutput, AVFoundation, iOS, QuartzCore, Video
Рубрики: iOS on Jan.10, 2012
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 [...]
Теги: hex, HTML color to UIColor, UIColor
Рубрики: iOS on Jan.04, 2012
Enable MSAA Anti-Aliasing in GLKit. Just enable: 12GLKView *view = (GLKView *)self.view; view.drawableMultisample = GLKViewDrawableMultisample4X; Without MSAA: With MSAA: GLKit_MSAA_Sample
Теги: Anti-Aliasing, GLKit, GLKView, iOS, MSAA, OpenGL
Рубрики: iOS, iPad, iPhone, OOP on Dec.22, 2011
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 [...]
Теги: Category, iOS, iPad, iPhone, objective-c, OOP, pattern, scroll, UIImageView, UIKit, UIScrollView
Рубрики: Apple, iPad, iPhone, Mac OS X on Dec.17, 2011
I tried create loop by AVQueuePlayer, this method has delays between end and start play. for looping AVQueuePlayer i use this code: 123456[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playerItemDidReachEnd:) [...]
Теги: AVFoundation, AVMutableComposition, AVPlayer, AVPlayerActionAtItemEndNone, AVPlayerItem, AVPlayerLayer, AVQueuePlayer, AVURLAsset, iOS, NSNotificationCenter
Рубрики: iPad, iPhone, Mac OS X on Dec.17, 2011
if you will use or used AVPlayer or you want just know about changes, you can check AudioRouteChange. Simple solution: Add framework AudioToolbox and add import to file 1#import <AudioToolbox/AudioToolbox.h> Insert into init method or any other 1AudioSessionAddPropertyListener (kAudioSessionProperty_AudioRouteChange, callbackHeadphone_func, self); Listener callback 12345678910111213141516171819202122232425void callbackHeadphone_func ( void *inClientData, AudioSessionPropertyID inID, UInt32 inDataSize, const void *inData [...]
Теги: AudioSessionAddPropertyListener, AudioToolbox, iPhone, kAudioSessionProperty_AudioRouteChange
Рубрики: iPhone on Oct.29, 2011
Example: 1234567891011121314151617181920212223242526272829303132333435363738394041- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. if (self.cPicker == nil) { [self.view setBackgroundColor:[UIColor grayColor]]; self.cPicker = [[VBColorPicker alloc] initWithFrame:CGRectMake(0, 0, 202, 202)]; [...]
Теги: iOS, iPhone, objective-c, OOP, UIColor, UIImage, Ukraine, work, Кодинг
Рубрики: iPad, iPhone, Mac OS X on Oct.22, 2011
Sorting by block 12345678910111213141516171819NSArray *stringsArray = [NSArray arrayWithObjects: @"string 1", @"String 21", [...]
Теги: iOS, objective-c, sort, __block
Рубрики: iPad, iPhone, Mac OS X on Oct.22, 2011
Doc about font metric Getting Font Metrics
Теги: iOS, UIFont