Open guodongZhao opened 8 years ago
// 版本号
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
// 判断第一次使用(升级也算第一次使用)
// 存放的BOOL只为NO,证明第一次使用app
if (![[NSUserDefaults standardUserDefaults] boolForKey:bundleID]) {
NSLog(@"加载引导页");
UIStoryboard *st = [UIStoryboard storyboardWithName:@"welcome" bundle:nil];
self.window.rootViewController = st.instantiateInitialViewController;
}
else {
NSLog(@"直接进入应用");
UIStoryboard *st = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
self.window.rootViewController = st.instantiateInitialViewController;
}
[self.window makeKeyAndVisible];
return YES;
(void)drawPaint{ UIGraphicsBeginImageContext(self.drawImage.frame.size); [self.drawImage.image drawInRect:CGRectMake(0, 0, drawImage.frame.size.width, drawImage.frame.size.height)]; CGContextRef context = UIGraphicsGetCurrentContext();
// CGContextSaveGState(context); CGRect paintRect = CGRectMake(currentPoint.x - self.m_brushSize/2, currentPoint.y - self.m_brushSize/2, self.m_brushSize, self.m_brushSize); CGContextClipToRect(context, paintRect); start = end = CGPointMake(currentPoint.x, currentPoint.y); CGFloat startRadius = demoRGInnerRadius(paintRect); CGFloat endRadius = demoRGOuterRadius(paintRect); CGContextDrawRadialGradient(context, myGradient, start, startRadius, end, endRadius, kCGGradientDrawsBeforeStartLocation); // CGContextRestoreGState(context);
}