How to animate layer shadowOpacity?

This will work properly: #import <QuartzCore/CAAnimation.h> CABasicAnimation *anim = [CABasicAnimation animationWithKeyPath:@”shadowOpacity”]; anim.fromValue = [NSNumber numberWithFloat:1.0]; anim.toValue = [NSNumber numberWithFloat:0.0]; anim.duration = 1.0; [vv.layer addAnimation:anim forKey:@”shadowOpacity”]; vv.layer.shadowOpacity = 0.0; For Swift 3.0: let animation = CABasicAnimation(keyPath: “shadowOpacity”) animation.fromValue = layer.shadowOpacity animation.toValue = 0.0 animation.duration = 1.0 view.layer.add(animation, forKey: animation.keyPath) view.layer.shadowOpacity = 0.0

Weak performance of CGEventPost under GPU load

I guess you’re filling up the queue (underlying mach port)… You can confirm this using the “scheduling” or “system call” instrument in Instruments. (Create a new blank document, add the instrument, then under File > Record Options… make sure “deferred mode” is checked.) This will show all thread activity in your app (when threads block, … Read more

Get PDF hyperlinks on iOS with Quartz

heres the basic idea to get to the annots CGPDFDictionary for each page atleast. after that you should be able to figure it out with help from the PDF spec from Adobe. 1.) get the CGPDFDocumentRef. 2.) get each page. 3.) on each page, use CGPDFDictionaryGetArray(pageDictionary, “Annots”, &outputArray) where pageDictionary is the CGPDFDictionary representing the … Read more

iPhone smooth sketch drawing algorithm

CGPoint midPoint(CGPoint p1, CGPoint p2) { return CGPointMake((p1.x + p2.x) * 0.5, (p1.y + p2.y) * 0.5); } -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; previousPoint1 = [touch previousLocationInView:self]; previousPoint2 = [touch previousLocationInView:self]; currentPoint = [touch locationInView:self]; } -(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; previousPoint2 = previousPoint1; previousPoint1 … Read more

NSAttributedString background color and rounded corners

TL;DR; Create a custom-view, which renders same old NSAttributedString, but with rounded-corners. Unlike Android’s SpannableString, iOS does not support “custom-render for custom-string-attributes”, at least not without an entire custom-view (at time of writing, 2022). I managed to achieve the above effect, so thought I’d post an answer for the same. If anyone has any suggestions … Read more

What’s the difference between Quartz Core, Core Graphics and Quartz 2D?

Quartz 2D is an API of the Core Graphics framework that implements drawing. Quartz Core is a framework that includes APIs for animation and image processing. Quartz frameworks and their APIs CoreGraphics.framework Quartz 2D API manages the graphic context and implements drawing. Quartz Services API provides low level access to the window server. This includes … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)