quartz-core

CABasicAnimation in uitableviewcell doesn't seem to work

青春壹個敷衍的年華 提交于 2020-01-05 06:59:27
问题 I'm trying to make a label within a tableview cell change background color with a CABasicAnimation and it doesn't seem to be working - the cell background color remains solid with no animation. This code is in the cellForRowAtIndexPath method - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { MainCellTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath]; NSString *name = @"Hello"; UIColor *color

QuartzCore.framework for Mono Develop

こ雲淡風輕ζ 提交于 2020-01-04 15:56:28
问题 I'm fine with Mono Develop's native-supported iOS libraries. But when I need such as a 3rd party library I get stuck. QuartzCore is a successful library,but written in Objective-C. I know there is binding type project supported by xamarin. http://docs.xamarin.com/ios/Guides/Advanced_Topics/Binding_Objective-C_Libraries Maybe for a small project has .a extension could be easy to bind. I wonder do I need to try to bind QuartzCore.framework to Mono Develop or Does it take much effort then coding

cancel a UIView animateWithDuration before completion

徘徊边缘 提交于 2020-01-01 04:15:13
问题 I have this code in my project: - (void) fadeImageView { [UIView animateWithDuration:1.0f delay:0 options:UIViewAnimationCurveEaseInOut animations:^{ self.imageView.alpha = 0.0f; } completion:^(BOOL finished) { //make the image view un-tappable. //if the fade was canceled, set the alpha to 1.0 }]; } however, there are circumstance where i would like to cancel this operation before the imageview has become invisible. Is there a way to cancel this animation mid animation? 回答1: Update: prefer

cancel a UIView animateWithDuration before completion

杀马特。学长 韩版系。学妹 提交于 2020-01-01 04:15:06
问题 I have this code in my project: - (void) fadeImageView { [UIView animateWithDuration:1.0f delay:0 options:UIViewAnimationCurveEaseInOut animations:^{ self.imageView.alpha = 0.0f; } completion:^(BOOL finished) { //make the image view un-tappable. //if the fade was canceled, set the alpha to 1.0 }]; } however, there are circumstance where i would like to cancel this operation before the imageview has become invisible. Is there a way to cancel this animation mid animation? 回答1: Update: prefer

Quartz Core Import not required in Xcode 5?

丶灬走出姿态 提交于 2019-12-29 05:09:05
问题 Just stumbled across this today. I am getting warnings in Xcode 4.6 if I try to access the CALayer without importing <QuartzCore/QuartzCore.h> . The same however works fine in Xcode 5. 回答1: Yes, <QuartzCore/QuartzCore.h> is automatically included, but this seems to be more a side effect than intended, because it is included only indirectly: <UIKit/UIKit.h> includes <UIKit/UISlider.h> , in the iOS 7 SDK, <UIKit/UISlider.h> includes <QuartzCore/QuartzCore.h> , due to new instance variables in

Make an UIImage from a CMSampleBuffer

限于喜欢 提交于 2019-12-29 03:21:08
问题 This is not the same as the countless questions about converting a CMSampleBuffer to a UIImage . I'm simply wondering why I can't convert it like this: CVPixelBufferRef pixelBuffer = (CVPixelBufferRef)CMSampleBufferGetImageBuffer(sampleBuffer); CIImage * imageFromCoreImageLibrary = [CIImage imageWithCVPixelBuffer: pixelBuffer]; UIImage * imageForUI = [UIImage imageWithCIImage: imageFromCoreImageLibrary]; It seems a lot simpler because it works for YCbCr color spaces, as well as RGBA and

failed to bind EAGLDrawable in CADisplayLink render loop

纵然是瞬间 提交于 2019-12-24 02:22:20
问题 i use CADisplayLink render-loop callback to render a serial of image textures with openGLes. after CADisplayLink's first callback called, i just get these error output Failed to bind EAGLDrawable: <CAEAGLLayer: 0x946bb40> to GL_RENDERBUFFER 2 Failed to make complete framebuffer object 8cd6 i setup the renderBuffer&frameBuffer and call glFramebufferRenderbuffer in controller's viewDidLoad stage, the return of glCheckFramebufferStatus is fine in that stage. this is the code I'm using. /

Cannot convert value of type 'CFString' to expected argument type 'UnsafePointer<Void>' (aka 'UnsafePointer<()>')

霸气de小男生 提交于 2019-12-24 00:59:40
问题 I am getting a build error, when I define the line let runFont : CTFontRef = CFDictionaryGetValue(CTRunGetAttributes(run), kCTFontAttributeName) And the error is: Cannot convert value of type 'CFString' to expected argument type 'UnsafePointer' (aka 'UnsafePointer<()>') 回答1: Try let runFont = unsafeBitCast(CFDictionaryGetValue(CTRunGetAttributes(run), unsafeBitCast(kCTFontAttributeName, UnsafePointer<Void>.self)), CTFontRef.self) 回答2: Swift 3 version of @vadian answer: let runFont =

CALayer autoresizingMask not for iOS SDK?

会有一股神秘感。 提交于 2019-12-23 08:10:08
问题 I noticed, what CALayer, on iOS SDK haven't autoresizingMask property. I'm not sure what custom overloading of method "setFrame:" can work normally with animated sublayers autoresizing. Are there is an alternative without using UIView? 回答1: You can use layoutSublayers function of calayer. 回答2: If you do not want to subclass CALayer and added the layer to the layer of a UIView then you can override - (void)layoutSublayersOfLayer:(CALayer *)layer method of view. 来源: https://stackoverflow.com

containsPoint: for UIBezierPath crashes

南笙酒味 提交于 2019-12-23 07:47:32
问题 I'm parsing a SVG file to UIBezierPath . I'd like to know whether a CGPoint is inside or outside the UIBezierPath . To do this I use containsPoint: . When I run this in the simulator everthing works fine (almost!). When I run it a iPad device it crashes on some paths and points. I'm calling closePath on every UIBezierPath before I call containsPoint: . Here are some paths and points, which makes it crash (I randomize the points, so there might be more crash points): Crash Points: (659.0, 444