Bo2SS

Bo2SS

Introduction to iOS from "Xia Piao Piao" (2) — A Brief History of iOS and Project Creation

Getting Started with iOS from "Xia Piao Piao"

Last week we discussed Part 1, clarifying that we want to create an "Xia Piao Piao" App~

Today we come to Part 2, starting with the development history of iOS, then using Xcode to create an iOS project, and finally introducing some commonly used configurations in the project.

A Brief History of iOS#

Birth of the First iPhone#

Before the iPhone came out, Apple's two star products were the iMac and the iPod, and at that time, Jobs was thinking, could we shrink the iMac or expand the iPod to create a phone? Jobs assigned this task to two product lines, namely the iMac team and the iPod team. You might not guess who ultimately succeeded?

  • Based on the powerful macOS system of the iMac, the first iPhone had very strong performance;
  • While everyone was thinking about how to create various mobile phone keyboards, Jobs was thinking, why not make the keyboard a software? This way, whatever kind of keyboard I want, I can have it, and it would also have a larger screen and lighter weight.

At the Apple launch event in 2007, Jobs repeatedly emphasized three sets of words: An iPod, A Phone, An Internet Communicator, An iPod, A Phone...

Birth of the iPhone

In the end, he combined the three functions into one device, which gave us the first iPhone!

At that time, he also mentioned a quote from Alan Kay, the proponent of the notebook concept:

People who're serious about software should make their own hardware.——1970

Those who are passionate about software should also create their own hardware.——1970

More than thirty years later, in 2007, Apple achieved this, and later Microsoft actually did as well. At the same time, Apple was intimately familiar with all the details of its hardware, truly achieving a combination of software and hardware.

Version History#

  • The earliest version of iOS was called iPhone OS, and it wasn't until the fourth major version that it was called iOS, at which point iPod OS, iPad OS, and iPhone OS were merged;
  • By the time of iOS 13, due to some unique features of the iPad, such as split-screen, support for Apple Pencil, file system, etc., iPad OS was separated out;
  • Until the recent iOS 15.

Reference: iOS Version History——Wiki

System Features#

Compared to another mainstream system, Android, the characteristics of iOS are quite obvious:

  • Fewer models, relatively fewer users
  • Closed ecosystem, less freedom and choice, more security, ease of use, and timely software updates
  • Targeting the high-end market, whether the brand has a premium depends on the individual

In 2017, Apple made a promotional advertisement that amplified its characteristics, showcasing Apple's advantages in a somewhat exaggerated manner. If you're interested, you can take a look.

Switch To iPhone - Commercial by Apple——Youtube

Creating an iOS Project#

Now back to the main topic~

Creating a New Project#

Similar to all IDEs, creating a new project involves just a few steps:

Three Steps

  1. Create a new Xcode project
  2. Select iOS-App and click Next
  3. Fill in the project-related information
    1. Team can be left blank; it is mainly useful when debugging on a real device or when the app is being published
    2. Organization Identifier is generally in the form of com.organization_name
    3. This project is based on OC language, so Interface, Life Cycle, and Language are fixed
    4. The two checkboxes can be ignored for now, no need to check them
    5. Click Next

After choosing the path, the new project is completed.

Next, I will introduce three commonly used configurations in the project: App icon, launch screen, and commonly used properties in Info.plist.

App Icon#

image

After creating the project, there is a default file where you can simply drag in the icon

image

  • Pay attention to the red arrow
    • After creating the project, an Images.xcassets file will be automatically generated. This file can create many image sets to store images
    • Dragging your own images into the AppIcon image set will set our App icon
    • As for how to design your own App icon, it depends on personal creativity~
  • PS
    • If you want rich icon resources, you can check iconfont——Alibaba Icon Library
    • The attentive may notice that the image set contains icons of various ratios, which can be generated using the Prepo app (available in the App Store)
    • After iOS 10.3, Apple added the dynamic replacement feature, which we can experience during festivals like Double Eleven, where the App icon automatically switches without needing to reinstall the App
      • Steps: Set info.plist => Place images => Call setAlternateIconName method
      • We will mention the info.plist file later
    • Regarding the App badge, such as the unread message count displayed on the WeChat App, you can set the applicationIconBadgeNumber property.

The page displayed when an App starts is actually composed of a "launch screen + splash screen." Why have two pages?

  1. First, let's talk about the launch screen, also known as Launch Screen:

When creating a new project, a LaunchScreen.storyboard file is also generated by default. As the name suggests, storyboard is similar to a canvas where you can add some UIKit components to create your own launch screen (for explanations about UIKit components, please continue to follow this series~)

image

Again, pay attention to the red arrow; I actually used three images (icon + artistic text + artistic text) to create this launch screen.

However, this launch screen has a characteristic: it displays very quickly, making it inconvenient to control, so there may be a situation where the launch screen disappears while the content in the App has not yet loaded, resulting in a blank page being displayed to the user.

  1. Thus, we have the splash screen, also known as the Splash Screen:

Its original purpose is to avoid displaying a blank page to the user after launching the application.

It is added manually, and now from the actual use of the App, we can feel that this splash screen has been extended as a tool for advertising and brand promotion!

Therefore, its appearance can sometimes be counterproductive, requiring the App to load an additional page during initialization. For example, the Taobao App recently removed ads, and I realized that the previous slow startup of Taobao was not an issue with my phone.

In the “Apple Human Interface Guidelines” it states:

https://developer.apple.com/design/human-interface-guidelines/ios/overview/themes/

As much as possible, avoid displaying a splash screen or other startup experience.

As much as possible, avoid displaying a splash screen or other unnecessary startup experience.

But every company's culture is quite different; I heard that Microsoft actually encourages Apps to use splash screens to enhance brand effects in this regard~

Common Properties in Info.plist#

The last part is actually a crucial file in the project, which is also automatically generated and mainly provides some basic configurations for the App.

image

Pay attention to the red arrow; this file is essentially an XML file. Below are some commonly used properties inside.

  1. Bundle identifier
  1. Bundle name
  • The installation package name of the App, defaulting to the Product Name set when creating the new project
  1. Privacy Series
  • Properties related to permissions, such as accessing the photo album, camera, etc.
    • ⚠️: The Value must clearly state the specific purpose, rather than simply writing "using… permission," otherwise, it may face rejection during the review process when publishing.

PS: If you want to retrieve these properties in code, you can get their dictionary using the following code, and access the corresponding Value based on the Key.

NSDictionary *dic = [[NSBundle mainBundle] infoDictionary];
  • The method calling style in OC language is quite unique
    • Square brackets [] indicate method calls
    • [NSBundle mainBundle] is calling the class method of the NSBundle class, returning an instance object
    • Then, the instance object calls its infoDictionary method, returning a dictionary object
  • For specific syntax, you can refer to Objective-C Functions——Yibai Tutorial

See you next week👋#

We will discuss:

  • The system architecture of iOS
  • Important members in the UIKit library
    • UIView, UIViewController, and their respective inheritance relationships
    • Basic usage and features of various components

❗️Now you can try creating your first App! Add an App icon, set its launch screen, and modify the relevant info.plist properties~

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