GSSynthesizeSingleton 4.0.0

GSSynthesizeSingleton 4.0.0

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Jan 2017

Maintained by GyazSquare, Goichi Hirakawa.



  • By
  • GyazSquare

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

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.