Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6646833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:27:56+00:00 2026-05-26T00:27:56+00:00

I’d like to mimic an Apple style flip counter on iOS. Specifically, this thing

  • 0

I’d like to mimic an Apple style flip counter on iOS.

Specifically, this thing is going to be FLYING FAST. It’s not going to be an alarm clock, think player high-score where you are racking up points chunks at a time. The counter may jump from 0 to 100, to 5000, it will not increment sequentially, but when it does increment it will animate to the next number at a nice clip and it’s going to be jumping to the next target value in a second or two. It will not have a set number of digit places either, it can count from 0 to 2,000,000 if it wanted to. Like a player high-score, you don’t know what they will end up getting. Since it can’t be negative, theoretically maximum would be UINT_MAX

I did some searching, and I found a couple of great resources, neither of which seems to me like the correct approach.

This is a js/css approach the theoretically could run inside a UIWebView:

  • http://cnanney.com/journal/code/apple-style-counter-revisited/

And this article explains how to do page turning in Core Animation. It’s detailed enough, but it seems to me like it’s missing some key components, and would cause touches to get ignored on the UI while it’s flipping.

  • https://web.archive.org/web/20150321200917/https://www.voyce.com/index.php/2010/04/10/creating-an-ipad-flip-clock-with-core-animation

Now, after reading these I’ve got some different ideas on how to do it on my own, trying to weigh the pluses and minuses of each approach:

1) Load up the html counter whole-sale in the UIWebView.

  • Apparent benefits: possibly tons of code reuse, quick and dirty
  • Apparent downsides: the overhead of a UIWebView and constant calls to stringByEvaluatingJavaScriptFromString from the host app which has the next number just seems silly

2) Create a custom sprite sheet and use core animation

  • Apparent benefits: native code, seems like it would be a less fugly approach than using the web view
  • Apparent downsides: creating a custom sprite sheets at this point seems a bit pointless in the face of custom drawing since I’m already creating a view with custom drawing anyway. Seems like the only way to get it to perform well would be to draw images to sublayers rather than using UIImageViews

3) Render text/rounded rects with Core Graphics

  • Apparent benefits: 100% native code solution, no images
  • Apparent downsides: boatloads more code that having some UIImage instances. Don’t really know if I can get the right look I’m after without the images

4) Render the whole thing with OpenGL ES 2.0

  • Apparent benefits: complete control over rendering, possibly best performance
  • Apparent downsides: seems to me like I would still probably need some images to bind to textures, probably piles more code than core graphics rendering in #3

On the one hand, I can rationalize it and say the animation is only going to last a half a second or a second, so the best thing to do is to just fake it somehow with blurry images and not actually animate anything. On the other hand it seems to me this is precisely what Core Animation + Core Graphics was designed to do well, and I ought to use them.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T00:27:57+00:00Added an answer on May 26, 2026 at 12:27 am

    Ended up doing the drawing with images using image sprites.

    code here
    https://github.com/reklis/flipcounter

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I've got a string that has curly quotes in it. I'd like to replace
Specifically, suppose I start with the string string =hello \'i am \' me And
this is what i have right now Drawing an RSS feed into the php,
I would like to run a str_replace or preg_replace which looks for certain words
I am trying to render a haml file in a javascript response like so:
I have this code to decode numeric html entities to the UTF8 equivalent character.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.