Bo2SS

Bo2SS

0 Course Introduction and Preparation Before Development

Why learn iOS development and use the OC language?

Currently, enterprise-level apps are still a blue ocean, and iOS is one of the two foundational platforms in mobile development.
In the applications of the Internet of Everything, technical implementation and engineering thinking are closely related and are more important than the language itself.
Compared to the emerging Swift, OC is more stable and better suited for large-scale projects.

Course Outline#

  1. Development Preparation: Xcode is the main development environment
  2. Basic Pages: Familiarize yourself with the basic structure of pages, the creation, use, and related principles of various modules
  3. Basic Functions: Understand the invisible underlying modules
  4. Accessibility Features: Learn about commonly used accessibility features

Common App Types and Tech Stack#

  • Common App Types: IM communication, video live streaming, camera, news, utility shopping
  • Tech Stack
    • App Display Interface and Animation: Bottom TabBar, Navigation, lists, images, buttons, labels, text, web pages, common animations. Think of the WeChat app
    • Common App Technical Architecture: Networking, storage, images, audio and video, data parsing, layout rendering, startup, logging system, reporting system
    • Common App Functions: Complex content pages, login, sharing, channel management, push notifications, location, plugins, certificates, listing

Everything Starts with "HelloWorld!"❗️#

Preparation

  • Installation: Download from the App Store
  • Create Project: Create an iOS type application and fill in the basic project information
  • Layout: Left - directory structure, Middle - code, Right - file configuration, Bottom - debugging
  • PS: You can configure the project by clicking on the project file

Code

image-20210801230828223
  • Function Definition
    • Format: -/+ (returnType)methodName:(argType1)argName1 joiningName2:(argType2)argName2 {}
    • Function Name: methodName
    • Generally, "joiningName" can be the same as "argName"
  • Function Call Format: [obj methodName var joiningName2];

PS

  • self and super
    • self: refers to the object that calls the current method
    • super: is a keyword that represents calling the parent class's method
    • Reference self and super in OC——Jianshu
  • Use "." symbol: to access the properties of an object
  • Use "({})" after addSubview: This is a gcc extension that simplifies code and makes it more readable
    • {} can contain multiple statements
    • () makes the last expression in {} the return value of the entire expression
  • Use @"" : to quickly construct strings
  • CGPointMake: is an inline function, so it does not require square brackets
    • During compilation, the function body will be replaced with the function call 👉 no need to create a function call on the stack 👉 improves execution speed
    • However, it will increase the size of the binary file

Running Result

image-20210801231018919

Tips#

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.