IOS login?
Direct code
//
// IsmyRight. h
// PanGuChina
//
// Created by taogu on 15/5/9.
// Copyright (c) 2015 com. taogucn. www. All rights reserved.
//
# Import
@ Interface ismyRight: UIView
@ Property (nonatomic, strong) UILabel * scoreLabel;
@ Property (nonatomic, strong) UIImageView * blackImage;
@ Property (nonatomic, strong) UIButton * yesButton;
@ Property (nonatomic, strong) UIButton * noButton;
+ (Void) showString :( NSString *) string;
@ End
# Import "ismyRight. h"
@ Implementation ismyRight
-(Id) initWithFrame :( CGRect) frame withTitle :( NSString *) title
{
Self = [super initWithFrame: frame];
If (self ){
_ BlackImage = [[UIImageView alloc] initWithFrame: CGRectMake (VIEW_WIDTH-150)/2, VIEW_HEIGHT/2-30,120,150)];
// Self. backgroundColor = [UIColor whiteColor];
Self. scoreLabel = [[UILabel alloc] initWithFrame: CGRectMake (10, 10,100, 20)];
Self. scoreLabel. text = @ "Your account has a login request on another device. Please confirm ";
Self. scoreLabel. textColor = [UIColor blueColor];
Self. scoreLabel. textAlignment = NSTextAlignmentCenter;
Self. scoreLabel. font = [UIFont systemFontOfSize: 12];
[_ BlackImage addSubview: self. scoreLabel];
Self. yesButton = [[UIButton alloc] initWithFrame: CGRectMake (10, 40, 30, 30)];
Self. yesButton. titleLabel. text = @ "yes ";
Self. yesButton. backgroundColor = [UIColor redColor];
[_ BlackImage addSubview: self. yesButton];
Self. noButton = [[UIButton alloc] initWithFrame: CGRectMake (60, 40, 30, 30)];
Self. noButton. titleLabel. text = @ "no ";
Self. noButton. backgroundColor = [UIColor redColor];
[_ BlackImage addSubview: self. noButton];
[[[UIApplication sharedApplication]. delegate window] addSubview: _ blackImage];
}
Return self;
}
// Display the text and set it to large.
+ (Void) showString :( NSString *) string
{
IsmyRight * animation = [[ismyRight alloc] initWithFrame: CGRectMake (VIEW_WIDTH-150)/2, VIEW_HEIGHT/2-30,120,150) withTitle: string];
// AnimationView * animation = [[AnimationView alloc] initWithFrame: CGRectMake (VIEW_WIDTH-150)/2, VIEW_HEIGHT/2-30,150, 60) withTitle: string];
// [Animation startAnimationSeconds: seconds];
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
-(Void) drawRect :( CGRect) rect {
// Drawing code
}
*/
@ End