Some use of Xcode

Recently, I have learned the development of iOS intermittently and have a certain understanding of iOS. In order to better learn and summarize, I am ready to make some records and share with my brothers, just like the learning of Flutter.

As the saying goes, to do good work must first sharpen its tools, Xcode as iOS development tool, it is necessary to understand some use of Xcode, can improve our work efficiency.

Introduction to the project:

  • AppDelegate: The application delegate file, which is the system’s delegate to run the application. It defines global methods such as the entry and exit of the application, and the rotation of the device orientation.

  • SceneDelegate: Used to manage multiple scenarios of the application, as well as the life cycle of the application. After the application has finished launching, control is handed over to this file, which is just used to configure the user’s page.

  • Main.storyboard: You can see all view controllers and their relationships at a glance, which is great for multiple resolution devices.

  • Assets. Xcassets: Centrally manages images, colors, symbols, and data in a project. And when reading the picture, there is no need to add the suffix name of the picture.

  • Launchscreen. storyboard: Launch page for design and adaptation applications.

  • Info.plist: Information property list file that stores item configuration information such as version number, display icon, supported device direction, and so on.

  • Products directory: Stores the compiled packages of the project, using the product-build command, which can be generated here when the compressed packages are published to the Apple App Market.

Enter the source control panel, where you can manage the source version.

From left to right:

  • Hierarchy panel: Click the left – right arrow to view the methods of the class.
  • Search navigation panel: Find all documents in your project that contain that keyword by searching for it.
  • Status panel: Displays code problems for all documents in the project. Yellow means warning, red means error.
  • Test panel: displays all test cases;
  • Modulated navigator panel: After running the program, you can see the real-time status of the device, including CPU memory, network, etc.

Add a new editor on the left to make it easier to compare code while writing:

  • Comparing different versions of code:

  • Insert common code blocks:

  • Open the help document, search for the corresponding class, and check the API in the class, which is very common in development.

  • Display the submission record:

  • Quick file opening:

File->Open Quickly or shift+command + O;

  • View recently edited files:

  • Rename variable or constant: Select the variable or constant that you want to change, and then:

  • Extract code into a method:

conclusion

Through the understanding of iOS engineering projects and the learning of some common operations of Xcode, I have mastered some skills used by Xcode, and I believe that it will be more handy in the future development.