Learn Coding-ios Open source project log (i)

Source: Internet
Author: User

As a beginner programmer, one of the effective ways to improve your level is to learn good projects. The beginning of this article will be updated on GitHub on the open source of a very good project a little learning accumulation. That is, to explore the other people write the source code, I learned something new? I am foolish, and the code age is not much, also about three years, the level is not high, if there is a setback, also look correct. I am happy to learn, happy to share, a wide knot, willing to communicate. Of course, the master can float over.

Coding-ios Project URL: Https://github.com/Coding/Coding-iOS readers interested can download themselves, of course, many of the third-party framework is not directly integrated into the reader itself through the project prompt processing.

Content Summary:

Body:

March 21, 2016

Files: baseviewcontroller.m

1, the following code added Friends League statistics, set the status bar, the code set up the vertical screen.

1- (void) Viewwillappear: (BOOL) Animated2 {3 [Super viewwillappear:animated];4     //Hy: Friends League statistics,Https://github.com/liyoro/UMAnalytics5     //hy: Brother's Blog:http://www.henishuo.com/ios-umeng-push/6 [Mobclick beginlogpageview:[nsstring stringwithutf8string:object_getclassname (self)];7     //hy: Setting the status bar8 [[uiapplication sharedapplication] setstatusbarstyle:uistatusbarstylelightcontent Animated:YES];9 Ten     //hy: If it is not vertical screen, does not support vertical screen or horizontal screen One     if(Self.interfaceorientation! =uiinterfaceorientationportrait A&&! ([Self supportedinterfaceorientations] &uiinterfaceorientationmasklandscapeleft)) { -         //hy: Set as vertical screen - [self forcechangetoorientation:uiinterfaceorientationportrait]; the     } - } - ...... -- (void) Forcechangetoorientation: (uiinterfaceorientation) interfaceorientation{ +[[Uidevice Currentdevice] Setvalue:[nsnumber numberwithinteger:interfaceorientation] ForKey:@"Orientation"]; -}

File:Mobclick. h is the SDK interface file for the Friends League statistics. Use later to add, first know this class is the case.

2. Google Analytics is used in the code below.

About the website integrating this Google Analytics SDK Learning: Https://www.raywenderlich.com/53459/google-analytics-ios (Foreign site)

The corresponding domestic translation website: Https://www.raywenderlich.com/53459/google-analytics-ios

1- (void) viewdidload{2 [Super Viewdidload];3Self.view.backgroundColor =KCOLORTABLEBG;4     //hy: Here again the code to set up the vertical screen5     if(Self.interfaceorientation! =uiinterfaceorientationportrait6&&! ([Self supportedinterfaceorientations] &uiinterfaceorientationmasklandscapeleft)) {7 [self forcechangetoorientation:uiinterfaceorientationportrait];8     }9     //hy: Added a free user analytics service provided by Google Analytics,googleTen     //GA One     ID<GAITracker> Tracker =[[GAI sharedinstance] defaulttracker]; A[TrackerSet: Kgaiscreenname value:[nsstring stringwithutf8string:object_getclassname (self)]; - [Tracker Send:[[gaidictionarybuilder Createscreenview] build]; -}

3, the following code with a macro definition of debug printing mode

-(void) tabbaritemclicked{    debuglog (@ "\ntabbaritemclicked:%@" class ]));}

Then I command+click jump to the following code:

1 #define Debuglog (S, ...) NSLog (@ "%s (%d):%@", __function__, __line__, [NSString stringWithFormat: (s), # #__VA_ARGS__])

Then I created my own new simple project using a bit:

2. Folder: Rdvtabbarcontroller

Because in the project source code, ROOTTABVIEWCONTROLLER:RDVTABBARCONTROLLER<RDVTABBARCONTROLLERDELEGATE> So explore Rdvtabbarcontroller further and discover that this is a third-party framework

and GitHub on the point of high praise, the URL is: Https://github.com/robbdimitrov/RDVTabBarController. What does the source code do after recording the learning?

3.

Learn Coding-ios Open source project log (i)

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.