Tag: ios objective c coretext

How to call async methods from objective-c

Consider the below piece of code, its written in Swift and it uses Async/Await. In order to use this code in Swift, you would do this This can be called from objective-c directly as follows The Objective-C method implementation synthesized by the compiler will create a detached task that calls the async Swift method perform(operation:) with the given string,

Continue Reading →

Lets do some twists in iOS

Ever wondered how you can turn a view along the x-axis or y-axis. You can do that using the CATransform3DMakeRotation in iOS. Its pretty cool. You can use animation to even make it more awesome. In the CATransform3DMakeRotation method you can change the x,y,z values to 1 for rotating the views along the respective axis. Some uses

Continue Reading →

Improving performance when using shadows in iOS

Whenever you work with shadows its better to use a bezier path as the background. This will help you set the shadowPath, which will drastically improve performance. Rasterize will improve performance, but setShadowPath will improve 5x more than just setting rasterize. path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, 100, 100) cornerRadius:10]; [self.layer setShadowColor:[UIColor blackColor].CGColor]; [self.layer setShadowOpacity:1.0f]; [self.layer

Continue Reading →