New features page of ios_20_weibo and new features of iOS_20 Weibo

Source: Internet
Author: User
Tags oauth

New features page of ios_20_weibo and new features of iOS_20 Weibo

Finally:




BeyondAppDelegate. m

/// BeyondAppDelegate. m // 20 _ handsome guy no Weibo /// Created by beyond on 14-8-3. // Copyright (c) 2014 com. beyond. all rights reserved. // # import "BeyondAppDelegate. h "# import" BeyondViewController. h "# import" NewFeatureViewController. h "# import" OauthViewController. h "# define kVersionCodeKey (NSString *) kCFBundleVersionKey @ implementation BeyondAppDelegate // Method for executing the application first-(BOOL) application :( UIApplication *) application didFinishLaunchingWithOptions :( NSDictionary *) launchOptions {// 1, create window self. window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]; // 2. Set the window background color self. window. backgroundColor = [UIColor whiteColor]; // 3. Call a custom method to determine whether the current version of the app is used for the first time, set the window root controller as the NewFeature controller. Otherwise, the main controller will be directly set as the window root controller [self versionCodeCheck]; // 4 to make the window visible [self. window makeKeyAndVisible]; return YES;} // custom method to determine whether the current version of the app is used for the first time. If this is the first time, set the window root controller to the NewFeature controller, otherwise, the master controller is directly set to the window root controller-(void) versionCodeCheck {// 1, using user preferences, retrieve the old NSString * Expiration = [[NSUserDefaults standardUserDefaults] objectForKey: kVersionCodeKey] From the sandbox; NSString * currentVersionCode = [[[NSBundle mainBundle] infoDictionary] objectForKey: kVersionCodeKey]; // enter different controllers based on the comparison result of the version number. // [self stepmediaviewcontroller: currentVersionCode oldVersion: oldVersionCode]; // return; # warning block test-==================== the following content, and the method called here, are only used for block call testing if ([currentVersionCode is1_tostring: oldVersionCode]) {// if (0) {[self enterBeyondVC];} else {// key, and save the version [[NSUserDefaults standardUserDefaults] setObject: currentVersionCode forKey: kVersionCodeKey]; // enter NewFeatureViewController * newVC = [[NewFeatureViewController alloc] init]; newVC. startBlock = ^ (BOOL isSelected) {log (@ "% d", isSelected); [self enterBeyondVC] ;}; self. window. rootViewController = newVC ;}# warning block test-(void) enterBeyondVC {// 1. If you have performed Oauth authorization, go directly to the master controller, otherwise, the Oauth authorization controller if (1) {OauthViewController * oauthVC = [[OauthViewController alloc] init]; self. window. rootViewController = oauthVC; return;} // enter the master controller BeyondViewController * vc = [[BeyondViewController alloc] init]; self. window. rootViewController = vc;}-(void) stepmediaviewcontroller :( NSString *) curVersion oldVersion :( NSString *) oldVersion {// compare the new version UIViewController * rootViewController = nil; # view if ([curVersion is1_tostring: oldVersion]) {// if (0) {// It indicates that it is not the first operation and the master controller is directly instantiated, set the main controller as the root controller of the window // enter the main controller (the status bar is restored before the main interface) ios 7 is invalid // [[UIApplication sharedApplication] setStatusBarHidden: NO withAnimation: UIStatusBarAnimationFade]; rootViewController = [[BeyondViewController alloc] init];} else {// This is the first time that the system runs. Enter the new feature controller and set the new feature controller to the root controller of the window, and save the version number // enter the new feature controller (hide the status bar before the new feature Interface) ios 7 is invalid // [UIApplication sharedApplication]. statusBarHidden = YES; // [[UIApplication sharedApplication] setStatusBarHidden: YES withAnimation: UIStatusBarAnimationSlide]; rootViewController = [[NewFeatureViewController alloc] init]; // key, and save the version [[NSUserDefaults standardUserDefaults] setObject: curVersion forKey: kVersionCodeKey];} // set the window's root controller as the corresponding controller self. window. rootViewController = rootViewController;} @ end


NewFeatureViewController. h

/// NewFeatureViewController. h // 20 _ handsome guy no Weibo /// Created by beyond on 14-8-3. // Copyright (c) 2014 com. beyond. all rights reserved. // use only once. The new controller version is enabled when the current version is run for the first time # import <UIKit/UIKit. h> @ interface NewFeatureViewController: UIViewController // defines a block as a member variable. When you click the start button, initialize the master controller, use copy @ property (nonatomic, copy) void (^ startBlock) (BOOL isShare) for the root controller // block of the window; @ end


NewFeatureViewController. m

/// NewFeatureViewController. m // 20 _ handsome guy no Weibo /// Created by beyond on 14-8-3. // Copyright (c) 2014 com. beyond. all rights reserved. // use only once. The new controller version is enabled when the current version is run for the first time./* write in front: When a control is not displayed, check the following three attributes: no width and height x y coordinates are not correctly added to the parent control. When a control cannot be clicked, check the following attributes: userinteraction = no the userinteraction = no control of the parent control itself has exceeded the height of its controller range. The height of pageController cannot be changed, so the height can be set to 0. Similarly, the height of other controls is 4, standard steps for center display: first set center, then set bounds 5, switch button picture can be switched through the switch button Status to complete normal: normal highlighted: highlighted (when a person is holding a long press) disabled: Invalid (controlled by code) selected: selected (controlled by code) */# import "NewFeatureViewController. h "# define kPicNum 4 # Change warning viewSize to kWinSize # define viewSize self. view. bounds. size @ interface NewFeatureViewController () <UIScrollViewDelegate> {// The page instructs the Controller UIPageControl * _ pageControl; // The selected status UIButton * _ shareBtn needs to be shared in the Click Event of the Enable button;} @ end @ implementation NewFeatureViewControll Er-(BOOL) prefersStatusBarHidden {// NSLog (@ "prefers bar hidden"); return YES;}-(void) before LoadView) loadView {NSLog (@ "load view"); // new features make imageView the Controller's view, then add a layer of scrollView UIImageView * imgView = [[UIImageView alloc] init] On the ImageView. // set the size of the controller view (imgView) to full screen imgView. frame = [UIScreen mainScreen]. bounds; NSLog (@ "% @", NSStringFromCGRect (imgView. frame); // use the classification method. For iPhone 5, load the image of-568h ImgView. image = [UIImage fullScrennImageNamed: @ "new_feature_background.png"]; // allows the Controller view to interact with the user imgView. userInteractionEnabled = YES; // directly turn imgeView into the view self of the controller. view = imgView;}-(void) viewDidLoad {[super viewDidLoad]; NSLog (@ "view did load"); // 1. Call a custom method to load UIScrollView, add UIImageView in batches. Put an image in each ImageView [self addUIScrollView]; // 2. Call the custom method to load UIPageControl [self addUIPageControl];} // user-defined party Method, load UIScrollView, and add UIImageView in batches, put an image in each ImageView-(void) addUIScrollView {// 1. load UIScrollView and add UIImageView in batches. Put a picture UIScrollView * scrollView = [[UIScrollView alloc] init] in each ImageView. // The displayed visible area size scrollView. frame = self. view. bounds; // horizontal scroll bar scrollView. showsHorizontalScrollIndicator = NO; // paging scrollView by visible area. pagingEnabled = YES; // The scrolling range is scrollView. contentSize = CGSizeMake (kPicNum * vie WSize. width, 0); // The proxy can listen to scrollView events that are scrolled. delegate = self; // Add to self. view is ImageView [self. view addSubview: scrollView]; // 2. Add the kPicNum imageView (sorted by kPicNum) to the scrollView Based on the index. for (int I = 0; I <kPicNum; I ++) {[self addImageViewToScrollView: scrollView atIndex: I] ;}/// custom method, load UIPageControl-(void) addUIPageControl {// 1, load UIPageControl _ pageControl = [[UIPageControl alloc] init]; // set the center first. Enter, and then set bounds _ pageControl. center = CGPointMake (viewSize. width * 0.5, viewSize. height * 0.95); _ pageControl. bounds = CGRectMake (0, 0,100, 0); // set the total number of pages _ pageControl. numberOfPages = kPicNum; // key point ~ Load the default color and the current page color _ pageControl from the image. pageIndicatorTintColor = [UIColor colorWithPatternImage: [UIImage imageNamed: @ "new_feature_pagecontrol_point.png"]; _ pageControl. currentPageIndicatorTintColor = [UIColor colorWithPatternImage: [UIImage imageNamed: @ "new_feature_pagecontrol_checked_point.png"]; // disable the default interactive event _ pageControl. userInteractionEnabled = NO; // Add to self. view is ImageView [self. view addSubview: _ pag EControl];} // scrollView proxy method, used to dynamically control the current PageControl dot. After the rolling deceleration is completed, it is called (that is, scrollview static)-(void) scrollViewDidEndDecelerating :( UIScrollView *) scrollView {// the current page number is the offset x divided by the single width _ pageControl. currentPage = scrollView. contentOffset. x/scrollView. frame. size. width;} // custom method. Add the kPicNum imageviews sorted by kPicNum images to the scrollView.-(void) addImageViewToScrollView :( UIScrollView *) scrollView atIndex :( int) I {// 1. create imagevi Ew UIImageView * imageView = [[UIImageView alloc] init]; // because it is horizontally arranged, the frame is calculated based on the index and must be converted into CGRect imageView by using a struct. frame = (CGRect) {I * viewSize. width, 0}, viewSize}; // 2. set the image NSString * name = [NSString stringWithFormat: @ "new_feature_mongod.png", I + 1]; // use the classification method. If it is iPhone 5, load the image imageView OF THE-568h. image = [UIImage fullScrennImageNamed: name]; // 3. add [scrollView addSubview: imageView]; // 4. for the last image, Add two buttons (share and start) if (I = kPicNum-1) {// The Last imageView must be clicked, in this way, the two buttons in the Image view can be clicked. userInteractionEnabled = YES; // the last image page, which has two buttons: Start [self addStartBtnInImageView: imageView]; // the last image page, which has two buttons, the other is the share Weibo button. The default status is [self addShareBtnInImageView: imageView] ;}// the last image page. There are two buttons, one is share-(void) addShareBtnInImageView :( UIImageView *) imageView {// 2. 1. create a custom style button _ shareBtn = [UIButton buttonWithType: UIButtonTypeCustom]; // Add it to the last imageView [imageView addSubview: _ shareBtn]; // 2. 2. set the button background image // call the self-written classification method, set the normal and highlighted background image of the button, and return the image size CGSize shareBtnNormalBgImgSize = [_ shareBtn setBtnBgImgForNormalAndSelectedWithName: @ "new_feature_pai_false.png" selectedName: @ "new_feature_pai_true.png"]; // 2. 3. border (center, center first, bounds) _ shareBtn. center = CGPointMake (viewSize. width * 0.5, viewSize. height * 0.7 5); // The button width and height are determined by the width and height of the background image _ shareBtn. bounds = (CGRect) {CGPointZero, shareBtnNormalBgImgSize}; // 2. 4. listen to [_ shareBtn addTarget: self action: @ selector (shareBtnClick :) forControlEvents: UIControlEventTouchUpInside]; // 2. 5. do not change the image color in the highlighted State _ shareBtn. adjustsImageWhenHighlighted = NO; // 2. 6. _ shareBtn is selected by default. selected = YES;} // click the share button to display the two images in different States, select the image in the selected status)-(void) shareBtnClick :( UIButton *) s HareBtn {shareBtn. selected =! ShareBtn. isSelected;} // There are two buttons on the last image page. One is start-(void) addStartBtnInImageView :( UIImageView *) imageView {// 1. 1. create the Enable button // use the custom style UIButton * startBtn = [UIButton buttonWithType: UIButtonTypeCustom]; // Add it to the last imageView [imageView addSubview: startBtn]; // 1. 2. set personalized styles such as the background image // call the classification method you have written, set the normal and highlighted background image of the button, and return the image size CGSize startBtnBgImgSize = [startBtn setBtnBgImgForNormalAndHighightedWithName: @ "new_feature_finish_button.png"]; // 1. 3. border startBtn. center = CGPointMake (viewSize. width * 0.5, viewSize. height * 0.85); // the width and height of the button are as large as the width and height of the background image startBtn. bounds = (CGRect) {CGPointZero, startBtnBgImgSize}; // 1. 4. when listening to [startBtn addTarget: self action: @ selector (startBtnClick) forControlEvents: UIControlEventTouchUpInside];} // when you click the start button, the block is called. The following functions: Initialize the master controller, make it the window's root controller-(void) startBtnClick {// directly call block (that is, execute a piece of code in another class) if (_ startBlock) {_ startBlock (_ shareBtn. isSelected) ;}}@ end








What are the new features of the ios711 system?

The new feature of iso7.1.1 is to fix some bugs.
Soon after, Apple finally released the iOS7.1.1 firmware. This update is a small update. It mainly improves Touch ID fingerprint recognition, fixes errors that may affect the keyboard response capability, and fixes problems that occur when VoiceOver is enabled and the Bluetooth keyboard is used.
[Firmware download] full range of iOS7.1.1 firmware download: www.25pp.com/news/news_59353.html
[Upgrade tutorial] iOS7.1.1 Upgrade tutorial graphic explanation: www.25pp.com/news/news_59351.html
For the fast power consumption issues that netizens are very concerned about, there is no obvious prompt on the iOS7.1.1 Update log. In addition, some netizens are very concerned about the iOS7.1.1 issue which has not yet been clearly stated by the jailbreak experts. How is iOS7.1.1? Let's keep an eye on its dynamics.
The above information is from the pp assistant for reference only.

What are the new features of Ios71,






Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.