Latest 4.0.0
Homepage https://github.com/GyazSquare/GSSynthesizeSingleton
License MIT
Platforms ios 4.0, osx 10.6, tvos 9.0, watchos 2.0

Build Status

Important: This library is deprecated, it is recommended you look at GSLSynthesizeSingleton.

GSSynthesizeSingleton is a simple macro to synthesize the methods for an Objective-C singleton class.

Requirements

  • Xcode 8.1 or later
  • Base SDK: iOS 10.1 / OS X 10.12 / watchOS 3.1 / tvOS 10.0 or later

Installation

CocoaPods

Add the pod to your Podfile:

# ... snip ...

pod 'GSSynthesizeSingleton'

Install the pod:

$ pod install

Source

Check out the source:

$ git clone https://github.com/GyazSquare/GSSynthesizeSingleton.git

Copy GSSynthesizeSingleton.h into your project.

Usage

  1. Declare a singleton class method in your header file.
  2. Add one macro in your source file.

MyManager.h

@import Foundation;

@interface MyManager : NSObject

+ (instancetype)sharedManager;

@end

MyManager.m

#import "GSManager.h"
#import "GSSynthesizeSingleton.h"

@implementation MyManager

GSSynthesizeSingleton(My, Manager);

@end

License

GSSynthesizeSingleton is licensed under the MIT License.

See the LICENSE file for more info.

Latest podspec

{
    "name": "GSSynthesizeSingleton",
    "version": "4.0.0",
    "authors": "GyazSquare",
    "license": {
        "type": "MIT"
    },
    "homepage": "https://github.com/GyazSquare/GSSynthesizeSingleton",
    "source": {
        "git": "https://github.com/GyazSquare/GSSynthesizeSingleton.git",
        "tag": "v4.0.0"
    },
    "summary": "A simple macro for an Objective-C singleton class.",
    "platforms": {
        "ios": "4.0",
        "osx": "10.6",
        "tvos": "9.0",
        "watchos": "2.0"
    },
    "source_files": "GSSynthesizeSingleton/*.{h,m}",
    "deprecated_in_favor_of": "GSLSynthesizeSingleton"
}

Pin It on Pinterest

Share This