|
Hi everybody, Can someone point me out what the different between changing value of "questionValue" to zero and non-zero At first, I set questionValue to zero, and hope my context.rotate will give me full set of clock ticks but It wont Then after I set questionValue to 100, I got what I want. But I'm still dont know why it works, can someone tell me ! thanks !
for zero, I got and for non-zero, I got clock ticks |
|
Perhaps In your grand design, you may be thinking of a visual timer that's different for each question and you want to adjust this timer view accordingly. But I think the name clouds both the intent and mechanics of drawing. Draw One TickYou might get a quick look into your problem by FIRST only drawing ONE tick.
That's TranslateNext, comment out the translate code.
Without a translation, the tick mark should be all the way to the left of your frame. This is because the origin of the tick mark is CGPoint.zero, aka The Upper Left Corner. However, the tick mark is moved down about 100 pixels. Why's that? That happens to be the value from
As In a peer code review, my team would certainly focus on this variable's name and probably suggest you change it to Once you select a pleasing distance from center, then you move the origin to the center of the canvas. While you're changing variable names, take a look at "w" and "t". Consider |
|
hey I have used the exact code but couldn't succeed. There is no clock ticks. i dont know where i m wrong! |
|
This line specifies the CGRect for the path. It starts in the lower left and extends to the upper right, but the context can flip it to start in the upper left and extend to the lower left corner.
The RoundedRectangle therefore is drawn in the CGRect area as defined by the path. You build up the view in the Try this code to help you understand what is going on.
|
TAKE YOUR SKILLS TO THE NEXT LEVEL If you like Hacking with Swift, you'll love Hacking with Swift+ – it's my premium service where you can learn advanced Swift and SwiftUI, functional programming, algorithms, and more. Plus it comes with stacks of benefits, including monthly live streams, downloadable projects, a 20% discount on all books, and free gifts!
Sponsor Hacking with Swift and reach the world's largest Swift community!
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.