GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — ASOAnimatedButton/Example/TwoStateButtonExample at master · agusso/ASOAnimatedButton

Expand file tree

/

TwoStateButtonExample

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

TwoStateButtonExample

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
TwoStateButtonExample.xcodeproj
TwoStateButtonExample.xcodeproj
 
 
TwoStateButtonExample
TwoStateButtonExample
 
 
TwoStateButtonExampleTests
TwoStateButtonExampleTests
 
 
README.md
README.md
 
 

README.md

Outline

TwoStateButtonExample

This App shows a toggle button which change its image every time it is tapped. A fade-out effect is set between its state changes.

ASOTwoStateButton animation preview

How To

Integrate the library

Add these lines in the Podfile:

platform :ios, '7.0'
pod 'ASOAnimatedButton'

Or add these lines if only the ASOTwoStateButton library is going to be used in the project:

platform :ios, '7.0'
pod 'ASOAnimatedButton/TwoStateButton'

Storyboard

Define each image name as values of OnStateImageName and OffStateImageName keys in User Defined Runtime Attributes of the ASOTwoStateButton object.

ASOTwoStateButton storyboard preview

Implementation

Initialise the 'Two-State Button'

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    // Set the 'Two-State Button'
    [self.twoStateButton initAnimationWithFadeEffectEnabled:YES]; // Set to 'NO' to disable Fade effect between its two-state transition
}

Add custom actions for each state

- (IBAction)twoStateButtonAction:(id)sender {
    if ([sender isOn]) {
        // Add actions related to the On-State
	
    } else {
       // Add actions related to the Off-State

    }
}

Controls

Control whether fade effect is enabled between state changing

@property (nonatomic) BOOL isFadeEffectEnabled;

Control the effect duration between state changing

@property (nonatomic) NSTimeInterval effectDuration;

Getting Help

If you need help using ASOTwoStateButton, please post a question on StackOverflow with the "ASOAnimatedButton" tag.

If you think you found a problem with ASOTwoStateButton, please post an issue. A sample project or fork of any of the examples demonstrating the problem will be helpful.

Author

Agus Soedibjo. Copyright (c) 2014 Agus Soedibjo, [email protected]

License

ASOAnimatedButton is available under the MIT license. See the LICENSE file for more info.

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.