Bo2SS

Bo2SS

"Take you into the world of iOS with 'Shrimp Ticket' (2) - iOS History and Project Creation."

Introduction to iOS with "Shrimp Ticket"

Last week we discussed Part 1 and clarified that we want to create a "Shrimp Ticket" app~

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

iOS History#

Birth of the First Generation iPhone#

Before the release of the iPhone, Apple's two star products were the iMac and iPod. At that time, Steve Jobs was thinking, can we shrink the iMac or enlarge the iPod to create a phone? Jobs assigned this task to two product teams, the iMac team and the iPod team. You may not believe it, but who do you think succeeded in the end?

  • 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 types of phone keyboards, Jobs was thinking, why not make the keyboard a software? This way, I can have any kind of keyboard I want, and I can also have a larger screen and lighter weight.

At the 2007 Apple conference, Jobs repeated three sets of words: An iPod, A Phone, An Internet Communicator, An iPod, A Phone...

Originally, he combined the three functions into one device, and that's how our first-generation iPhone came to be!

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

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

Thirty years later, in 2007, Apple did just that, and later Microsoft did too. At the same time, Apple had a thorough understanding of all the details of its hardware, truly achieving the integration of software and hardware.

Version History#

  • The initial version of iOS was called iPhone OS, and it wasn't until the fourth major version that it was called iOS. At this time, iPod OS, iPad OS, and iPhone OS were merged together.
  • With iOS 13, due to some unique features of the iPad, such as split screen, Apple Pencil support, and file system, iPad OS was separated.
  • Up until the recent iOS 15.

Reference: iOS Version History - Wiki

System Features#

Compared to the other mainstream system Android, iOS has some obvious characteristics:

  • Fewer models and fewer users
  • Closed ecosystem, less freedom and choice, but more security, ease of use, and timely software updates
  • Targeting the high-end market, whether the brand is overpriced varies from person to person

In 2017, Apple made a promotional advertisement highlighting its characteristics, exaggerating Apple's advantages in a slightly exaggerated way. If you're interested, you can take a look.

Switch To iPhone - Commercial by Apple - Youtube

iOS Project Creation#

Now let's get back to the topic~

Creating a New Project#

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

  1. Create a new Xcode project.
  2. Select iOS-App and click Next.
  3. Fill in the project-related information.
    1. The Team can be left blank, it is usually used for debugging on a real device or when submitting the app to the App Store.
    2. The Organization Identifier is generally in the form of com.organization_name.
    3. This project is based on the Objective-C language, so the 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 selecting the path, the creation is complete.

Next, we will introduce three commonly used configurations in the project: App icons, launch screen related settings, and commonly used properties in Info.plist.

App Icons#

After creating a new project, there is a default file that you can drag your icon into.

  • 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.
    • Drag your own image into the AppIcon image set, and you will have set your App icon.
    • As for how to design your own App icon, it's up to personal creativity~
  • PS
    • If you want rich icon materials, you can check out iconfont - Alibaba Icon Library.
    • If you are observant, you may notice that there are icons of various proportions in the image set. They can be generated using the Prepo application (available on the App Store).
    • Since iOS 10.3, Apple has introduced dynamic replacement feature. In fact, we can experience this during festivals like Singles' Day, where the App icon automatically changes without the need to reinstall the App.
      • Steps: Set info.plist => Add 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 is launched is actually composed of a "launch screen" and a splash screen. Why do we need two pages?

  1. Let's talk about the launch screen first:

When creating a new project, a LaunchScreen.storyboard file is also generated by default. As the name suggests, it is a storyboard, similar to a canvas, where you can add UIKit components to create your own launch screen (more about UIKit components will be discussed in this series~)

  • Pay attention to the red arrow. In fact, I used three images (icon + artistic text + artistic text) to create such a launch screen.

But this launch screen has a characteristic, it displays very quickly and is not easy to control. So it is possible that a situation may occur: the launch screen disappears, but the content of the app has not finished loading, resulting in an empty page being displayed to the user.

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

It is added manually, and now we can actually feel from the actual use of apps that this splash screen has become a powerful tool for advertising and brand promotion!

So its appearance may sometimes have the opposite effect, making the app need to load an additional page during initialization. For example, the Taobao app, which recently removed ads, made me realize that the slow startup of Taobao was not a problem with my phone.

In the Apple Human Interface Guidelines, it says:

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

But each company has its own culture, and I heard that Microsoft actually encourages apps to use splash screens to enhance brand effects~

Common Properties in Info.plist#

The last part is actually a very important file in the project. It is also automatically generated and provides some basic configurations for the app.

  • Pay attention to the red arrow. This file is essentially an XML file. Below are some commonly used properties in it.
  1. Bundle identifier
  1. Bundle name
  • The package name of the app, which is set by default when creating a new project as the Product Name.
  1. Privacy series
  • Properties related to permissions, such as accessing the photo library, camera, etc.
    • ⚠️: The Value must clearly state the specific purpose, rather than simply writing "using... permission". Otherwise, it may face rejection during app review.

PS: If you want to retrieve these properties in your code, you can use the following code to get the dictionary and retrieve the corresponding value based on the key.

NSDictionary *dic = [[NSBundle mainBundle] infoDictionary];
  • The way to call methods in Objective-C is unique:
    • Square brackets [] indicate method invocation.
    • [NSBundle mainBundle] is a class method of the NSBundle class, which returns an instance object.
    • Then call its infoDictionary method through the instance object, which returns a dictionary object.
  • For specific syntax, you can refer to Objective-C Functions - Yiibai Tutorial

See you next week👋#

We will discuss:

  • iOS system architecture
  • Important members of the UIKit library
    • UIView, UIViewController, and their 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 related info.plist properties~

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