## About
DoSingleton is a lightweight Objective-C library that provides a simple and efficient way to implement the Singleton design pattern in your iOS or macOS projects. With DoSingleton, you can easily create a single instance of a class that can be accessed throughout your application.
## Installation
To install DoSingleton, you can use either of the following methods:
1. **CocoaPods**: Add the following line to your Podfile and run `pod install`:
“`ruby
pod ‘DoSingleton’
“`
2. **Manual Installation**: Download the latest release from [GitHub](https://github.com/your_username/DoSingleton), extract the zip file, and then add the `DoSingleton` folder to your Xcode project.
## Usage
To use DoSingleton in your project, follow the steps below:
1. Import the `DoSingleton` header file into your class:
“`objective-c
#import
“`
2. In your class implementation, define the class as a singleton:
“`objective-c
@interface YourClass : NSObject
DoSingletonInterface
//…
@end
“`
3. Implement the singleton using `DoSingletonImplementation` macro:
“`objective-c
@implementation YourClass
DoSingletonImplementation
//…
@end
“`
4. Access the shared instance of your class anywhere in your project:
“`objective-c
YourClass *sharedInstance = [YourClass sharedInstance];
“`
## Example
Here is an example of how to use DoSingleton in your project:
“`objective-c
#import
@interface MyManager : NSObject
DoSingletonInterface
//…
@end
@implementation MyManager
DoSingletonImplementation
// Custom methods and properties…
//…
@end
“`
“`objective-c
// Using the shared instance of the singleton
MyManager *manager = [MyManager sharedInstance];
[manager doSomething];
//…
“`
## Requirements
– iOS 10.0+ / macOS 10.12+
– Xcode 10.0+
– Objective-C
## License
DoSingleton is available under the MIT license. See the [LICENSE](https://github.com/your_username/DoSingleton/blob/main/LICENSE) file for more info.
## Contributions
Contributions are welcome! If you have any suggestions, ideas, or bug reports, please open an issue or submit a pull request on [GitHub](https://github.com/your_username/DoSingleton). Thank you!