Installation
- Open your project in Xcode.
- Click on the ‘File‘ menu and select ‘Swift Packages‘.
- Click the ‘+‘ button to add a new package.
- In the search field, type ‘bryxbanner‘ and press ‘Enter‘.
- Select the ‘bryxbanner‘ package from the search results.
- Choose the desired version and click ‘Next‘.
- Ensure ‘Add to‘ field is set as ‘Your Project‘ and click ‘Finish‘.
Usage
To use bryxbanner in your project, follow the steps below:
- Import the bryxbanner module in your Swift file:
- Create an instance of BannerViewController:
- Customize the appearance:
- Show the banner:
// Import the module
import bryxbanner
// Create an instance
let banner = BannerViewController()
// Configure appearance properties
banner.textColor = .white
banner.backgroundColor = .blue
banner.duration = 3.0
// Present the banner
banner.show(in: self)
Customization
You can customize the appearance of the banner by modifying the properties of the BannerViewController instance:
- textColor: The color of the banner text.
- backgroundColor: The background color of the banner.
- duration: The duration in seconds for how long the banner should be displayed.
Example
// Import the module
import bryxbanner
// Create an instance
let banner = BannerViewController()
// Configure appearance properties
banner.textColor = .white
banner.backgroundColor = .blue
banner.duration = 3.0
// Present the banner
banner.show(in: self)
License
bryxbanner is available under the MIT license. See the LICENSE file for more information.