신속한 xcode에서 C# (xamarin)으로 코드를 변환하려고합니다. xcode의 코드 예제를 이해할 수 없습니다.
#pragma mark - Implement DTBackgroundView Class
@interface DTBackgroundView : UIView
{
UIWindow *_previousKeyWindow;
UIWindow *_alertWindow;
NSMutableArray *_alertViews;
}
+ (Instancetype)currentBackground;
static DTBackgroundView *singletion = nil;
@implementation DTBackgroundView
+ (Instancetype)currentBackground
{
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
singletion = [DTBackgroundView new];
});
return singletion;
}
내 질문
은 다음과 같습니다 :누가 가을 currentBackground입니다 내가 다음 코드를 이해하지?
Adeel 그의 의견에 말했듯이
DTBackgroundView *backgroundView = [DTBackgroundView currentBackground];
__singleton__ 클래스에 대한 아이디어를 얻으려면 __designPatterns__ 서적을 참고해야합니다. 그리고 게시 한 코드는 __Objective-C__에있는 __Swift__에 없습니다. – Adeel