Animal.h
+ (instancetype)shareAnimal;
Animal.m
+ (instancetype)shareAnimal{
static Animal *animal = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
animal = [[Animal alloc]init];
});
return animal;
}