Introduction
Welcome to the documentation page for LGButton – the custom button library for iOS. This library provides a set of customizable, animated buttons that can be easily integrated into your iOS applications. Whether you’re a beginner or an experienced developer, this documentation will guide you through the installation process, usage, and customization options available with LGButton.
Installation
CocoaPods
To install LGButton using CocoaPods, follow these steps:
- Open your project directory in a terminal window.
- Create a Podfile by running the command
pod init
. - Edit the Podfile and add the following line:
pod 'LGButton'
- Save the Podfile and run the command
pod install
. - Open the newly created .xcworkspace file.
- You can now import LGButton into your project using
import LGButton
.
Manual Installation
If you prefer manual installation, follow these steps:
- Download the LGButton framework from the official GitHub repository.
- Drag and drop the LGButton.xcodeproj file into your project.
- In the target settings of your project, navigate to the “General” tab.
- Under “Frameworks, Libraries, and Embedded Content”, click the “+” button.
- Select the LGButton.framework file from your project.
- You can now import LGButton into your project using
import LGButton
.
Usage
Adding an LGButton to your Interface
To use an LGButton in your interface, follow these steps:
- Drag and drop a UIButton onto your storyboard or XIB file.
- In the Identity Inspector, set the class of the button to
LGButton
. - Customize the button’s appearance using the attributes inspector or programmatically.
- Connect the button to an outlet in your view controller.
Customizing the LGButton
LGButton provides a wide range of customization options. Here are some of the key customization properties:
Properties
tStyle
The tStyle
property allows you to choose from various button styles. It supports the following values:
- Default
- Sketched
- Outlined
- Bordered
animate
The animate
property allows you to enable or disable the button animation. It is a Boolean value (true or false).
…
Methods
startLoading()
: Starts the loading animation.stopLoading()
: Stops the loading animation.
Conclusion
Congratulations! You’ve successfully installed and learned how to use LGButton in your iOS project. With its customizable and animated features, LGButton allows you to create unique and engaging buttons. Feel free to explore additional customization options and experiment with different button configurations.