Learn how to create gradients to make your app more appealing.
This is a companion discussion topic for the original entry at https://www.raywenderlich.com/3198-intermediate-core-graphics/lessons/2
Learn how to create gradients to make your app more appealing.
Hi, thank you for these wonderful tutorials, I feel like I’m getting to grips with CoreGraphics.
If I would want to animate the size of the half circle, the one with the gradient in SummaryView.swift, how would I go about it?
I know about animationblocks and autolayout, etc.
But if I wanted to animate the start and endangle of the circle, is that possible?
thank you,
Filip
Thanks for the kind words - If you’re going to be doing animation, I would recommend using CALayers rather than Core Graphics. CALayers were made for animation.
The CALayers video tutorial does an animation of a circle outline I think.
Thank you for the tip!
Hi Caroline,
is there an updated version of the starter code for the Intermediate Core Graphics course?
If I use it in Xcode 9, I get round about 160 errors. If there is a possibility to skip the clean up of the code, I would like to do so.
Thanks,
Jürgen
@refreco - Try the attached. I ran it through Xcode 8 and then Xcode 9 to convert the code. If this regularly happens, I believe you can still download Xcode 8 through Apple developer downloads.
001_Gradients_DemoStarter.zip (187.5 KB)
Could you please upgrade the demo project to Xcode9+Swift4?
Sadly, the starter project still doesn’t work Xcode9
The target “PennyWise” contains source code developed with Swift 2.x. Xcode 9 does not support building or migrating Swift 2.x targets.
Hi @crafttang - try the starter project from two posts above your previous one. I converted that one for Xcode 9 and it still works in Xcode 10.
Hi Caroline,
I like very much your teaching skills.
I’m using Swift 4 and i don’t find the correct command to create one closed path out of a number of strokes.
(CGPathCreateCopyByStrokingPath is not existing anymore)
Compile error gives ‘use copy(byStroking:lineWidth:lineCap:lineJoin,miterLimit:transform)’
I was not able to find any documentation on that command.
Can you help ?
Thanks,
Luc Lannoo
Thank you, @luclannoo
As there have been a ton of changes since Swift 2, we do have an updated video course for learning Core Graphics. It’s called Drawing in iOS: https://videos.raywenderlich.com/courses/133-drawing-in-ios/lessons/1. However, it does have different material from the older one, and doesn’t include this method.
The documentation for that method is here: Apple Developer Documentation
Caroline, Thanks
Yes, I had this method before but my problem was that I did not really understand how to use it.
I tried
let newPath = path.copy() with parameters and that did not work.
After a small Google I found my error. Now that it works it is obvious.
let newPath = path.cgPath.copy()
You have to copy the cgPath and not just the path.
Greetings,
Luc
I upgraded it to Xcode10.1 + Swift4.2 GitHub - zhihuitang/Intermediate-Core-Graphics: Intermediate Core Graphics