Timer and progress bar (developed for IOS)

Source: Internet
Author: User

Timer and progress bar (developed for IOS)

For more information, see note!


-(IBAction) startToMove :( id) sender {// determines whether the animation is being rotated. // The stopAnimating method indicates that the animation is stopped. if ([self. myActivityIndicatorView isAnimating]) {[self. myActivityIndicatorView stopAnimating];} else {[self. myActivityIndicatorView startAnimating] ;}}-(IBAction) downloadProgress :( id) sender {// timer method: after a specific interval, send a message to an object // target is the object to which the message is sent // timeinterval interval // method name to be called by the selector // userinfo to send the message // whether the repeats parameter of myT is repeated Expiration = [NSTimer scheduledTimerWithTimeInterval: 1.0 target: self selector: @ selector (download) userInfo: nil repeats: YES];}-(void) download {self. myProgressView. SS + = 0.1; // set the step length if (self. myProgressView. SS = 1.0) {// if the progress bar has reached the header // terminate the timer [myTimer invalidate]; // the pop-up dialog box UIAlertView * alert = [[UIAlertView alloc] initWithTitle: @ "download completed! "Message: @" Hey! Lucy! "Delegate: nil cancelButtonTitle: @" OK! "OtherButtonTitles: nil, nil]; [alert show] ;}}


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.