IOS Fishing weekly, mainly to share the experience and lessons encountered in the development process and learning content. Although it is a weekly newspaper, the current way of contributing content has not been stable. If there is less than one issue of subsequent content, it may be postponed to the next week. So I hope you can share your own development tips and bug solving experiences.

The weekly warehouse is here: github.com/zhangferry/… , you can see README to learn how to contribute. Also can pay attention to the public number: iOS growth road, backstage click into the group communication, contact us.

The development of Tips

Development tips included.

UML diagrams relationship

The relationship expressions in UML diagrams are easy to remember and confuse. Here’s how to remember them:

Implementation relationship: Describes the relationship between interfaces and classes, corresponding to the implementation of interface in Java or protocol in Swift.

The generalization relation is also called inheritance relation: the subclass points to the parent class

Association: A connection between objects and their objects, one containing a reference to another (usually an attribute). Represented by solid single or double arrows. Sometimes you need to indicate one or more associations.

There are several other special types of association relations:

Aggregation relationship: it reflects the ownership relationship between the whole and the parts. The car has a tire and engine. The engine cannot exist independently without the car, and the tire and engine are usually encapsulated in the car and invisible.

The class contains a student, the student and the class can exist independently, the student and the class can exist independently, the student depends on the class, the relationship here is usually visible in both.

Dependencies: are weak dependencies (non-attributes). Common local variables, static methods, method parameters, return values, and so on are all dependencies.

Restrictions on individual developer accounts

The department applied for a standby personal developer account, but found that it could not assign certificate management rights when inviting others to join. After investigation, it was found that different types of developer accounts have different permissions. Their differences are roughly as follows:

Whether a DUN & Bradstreet code is required for registration cost Whether the App Store can be launched Supported certificate types The device under test The number of collaboration
Personal account no The $99 can Ad Hoc + App Store 100 Developers themselves
The company account is The $99 can Ad Hoc + App Store 100 Many people
Corporate account is The $299 Can not be In-Hourse & Ad Hoc unlimited Many people

The functions of the personal account and the corporate account are basically the same, but the difference lies in the number of collaborators, which can be understood as the management rights of the certificate. Under the individual developer account, we can invite developers in AppStoreConnect and have the option to provide them with manager, developer, etc., but the options in the Developer resources section are not available.

This means that individual developers can only manage certificates by account buyers.

Swift type Framework merge

For a Framework developed in Objective-C, the difference between the real and emulator types is the CPU architecture on which the compiled executable file is suited. In the case of the Framework developed by Swift, the difference is not limited to execution files. For example, we compiled SnapKit Framework with real machine (arm64 & armv7), its directory is like this:

├ ─ ─ Headers │ └ ─ ─ SnapKit - Swift. H ├ ─ ─ the Info. The plist ├ ─ ─ Modules │ ├ ─ ─ SnapKit. Swiftmodule │ │ ├ ─ ─ Project │ │ │ ├ ─ ─ │ ├─ ├─ Arm64. │ ├─ Arm64. │ ├─ arm64 │ ├─ ├─ ├─ ├─ armv7-apple. ├─ armV7-apple. ├─ armV7-apple │ ├─ Arm64-Apple-ios. │ ├─ arm64-Apple-ios. │ ├─ arm64 Armv7 - apple - ios. Swiftdoc │ │ ├ ─ ─ armv7 - apple - ios. Swiftmodule │ │ ├ ─ ─ armv7. Swiftdoc │ │ └ ─ ─ armv7. Swiftmodule │ └ ─ ─ The module. Modulemap └ ─ ─ SnapKitCopy the code

Then use the emulator to compile an x86 version of snapkit. framework. It has the same directory structure as the real version above, except for the differences between the executable and the contents of Modules files.

The ModuleMap file is a description of the Framework, and a module. moduleMap file must accompany any Framework.

The SwiftModule file is used to describe Swift’s internal method declarations. It is in binary format and generates different versions for different architectures. This file is used for method look-ups and is directly recognized by the compiler if there is no swiftModule file for the corresponding schema.

A SwiftDoc file is a binary file that describes Swift comments and is also generated based on the schema.

The SwiftSourceInfo file exists as supplementary information to the Swift source code and is used to locate the Swift line and column information. It also exists in binary format. Reference: forums.swift.org/t/proposal-…

In addition to the target executable file, swiftModule should be incorporated at least. The other two files can be incorporated as required.

Programming concepts

What is the conversation

DevOps is a combination of Development and Operations, but it also involves testing. DevOps is a group of processes, methods, and systems that emphasize collaboration between software developers and operations to automate processes to build, test, and release software faster, more frequently, and more reliably.

What DevOps wants to do is to open up the CHAIN of IT tools in the software product delivery process so that teams can work together more efficiently and spend less time.

DevOps often requires the involvement of many tools, Jira, GitLab, Jenkins, Docker, Fastlane, etc. It is an extension of CI/CD, the core of DevOps implementation. DevOps practices can be used to enhance agile development.

What is Agile development

Agile Software Development is a software development capability that responds to rapidly changing requirements. Relative to the “agile”, more emphasis on the programmer team work closely with business experts, face to face communication (think is more effective than a written document), frequent delivery of new software version, compact and self-organizing team, is able to adapt to the demand change of coding and team organization method, also pay more attention to function of the software development process.

It describes the overall software development process, including the following key points:

• Iteration, progression, and evolution: The cycle is one to four weeks and the goal of the iteration is to reach a usable release

• Working software is the primary means of evolution: suitable engineering management software Jira, Tower, etc

• Efficient face-to-face communication: identify a product owner; Announcements containing information about the latest products, usually on large monitors that passers-by can see

• Very short feedback loops and adaptation cycles: daily stand-up meetings

• Quality focus: TDD is recommended and CI is used to speed up the development process

What is the Scrum

Scrum is a methodology in agile development. It is a framework for developing, delivering, and continuously supporting complex products, and is an incremental, iterative development process.

In this framework, the entire development process consists of several short iterations, called a Sprint, with a recommended length of one to four weeks for each Sprint. In Scrum, the product Backlog is used to manage the requirements of the product. The product Backlog is a list of requirements sorted by business value, and the list items are usually represented in the form of user stories. Scrum teams always develop requirements that are of high value to the customer first. In the Sprint, the Scrum team selects the highest priority requirements from the product Backlog for development. The selected requirements are discussed, analyzed, and estimated at the Sprint planning meeting to get the corresponding task list, which we call the Sprint backlog. At the end of each iteration, the Scrum team delivers potentially deliverable product increments. Scrum originated in software development projects, but it can be applied to any complex or innovative project. Scrum is now used to develop software, hardware, embedded software, interactive networking, autonomous driving, schools, governments, markets, managerial organizational operations, and almost everything we use in our daily lives as individuals and groups.

There are three important roles in Scrum:

  1. The Scrum Master is the Scrum coach and team leader who ensures that the team runs Scrum properly and helps remove obstacles in the implementation.
  2. Product owner, define product direction and vision, define product release content, priority and delivery time, and be responsible for product ROI;
  3. The development team, a small cross-functional team of 5 to 9 people, has the skills needed to deliver usable software.

What is Extreme programming

Extreme Programming (Extreme Programming, abbreviated as XP) is a software engineering methodology that is one of the most widely used and effective methodologies in agile software development. Like other agile methodologies, extreme programming fundamentally differs from traditional methodologies in its emphasis on adaptability over predictability.

Advocates of extreme programming argue that the constant change in software requirements is a natural and inevitable part of software project development, and should be embraced. They believe that being able to adapt to change at any stage of the project lifecycle is more realistic and effective than the traditional approach of defining all requirements at the start of a project and then struggling to control change.

Extreme programming encompasses several important practices: pair programming, coding specifications, TDD, refactoring, continuous integration, etc.

Extreme programming has five key principles: quick feedback, simple assumptions, incremental change, embrace change, and quality work.

What is pair programming

Pair programming (Pair programming) is an agile software development method in which two programmers work together on a computer. One person typed the code, and the other reviewed every line of code he typed. The person who enters the code is called a driver, and the person who reviews the code is called an observer (or navigator). The two programmers often switch roles.

The ideal situation for pair programming is that in pair programming, observers simultaneously consider the strategic direction of the work and suggest improvements or possible future problems to be addressed. This allows the driver to concentrate solely on the “tactical” aspect of completing the current mission. Observers serve as safety nets and guides.

But why hasn’t pair programming caught on? This is because its advantages are not good, and its disadvantages have many uncontrollable factors.

What is hoped for in pair programming: the driver can focus entirely on the “tactical” aspects of the task at hand, and the observer acts as a safety net and guide, which requires a high degree of coordination. And the communication cost and personality difference produced by cooperation can not be ignored.

There are two scenarios I can think of for pair programming:

1. For some complex problems, two people can cooperate and solve problems quickly by using different ideas.

2. It is suitable for helping developers quickly familiarize themselves with unfamiliar areas. It is similar to the mode of the old leading the new, which is conducive to knowledge sharing and transmission.

Resources: blog.csdn.net/csdnnews/ar…

What is metaprogramming

Metaprogramming is a very important and interesting concept in computer programming. The definition in Wikipedia describes Metaprogramming as the ability of a computer program to treat code as data. Simply put, it represents the ability to use code to generate code.

Most modern programming languages offer a variety of meta-programming capabilities. In general, we divide meta-programming capabilities into two types, depending on when we “generate code.” One is compile-time meta-programming, such as macros and templates. The other is runtime metaprogramming, or run-time, which gives a programming language the ability to modify its behavior at run time, although there are some features that can be implemented at compile time as well as at run time.

Meta programming can be used to solve the problem of universal, reduce boilerplate code, such as common dictionary and transfers of the model problem, it exists a lot of fixed style, we expect to write a method to make it automatic matching, namely can write a self-tuning method, this behavior is metaprogramming, and use scheme is reflected.

Related to metaprogramming is the concept of Metaclass, which is aclass that represents the object of a build class. Metaclass is used in languages such as OC, Ruby, Java, Python, etc.

There is also the concept of a closed loop to preserve inheritance called Root metaclass, which corresponds to both OC and Ruby.

Extended article: onevcat.com/2018/03/swi…

Good blog

Three inclusion optimization articles from bytedance’s technical team cover almost all possible and effective inclusion optimization solutions:

Douyin Quality construction – iOS installation package size optimization practice — from nuggets: Bytedance technology team

IOS package size optimization — New Stage, New Practice — from Nuggets: Bytedance Technology Team

IOS package size binary optimization reduces download size of a line of code by 60MB — from nuggets: Bytedance technology team

Startup optimization:

Douyin Quality construction – iOS startup optimization “Actual Combat” — from Nuggets: Bytedance technical team

IOS performance optimization: Optimize App startup speed — from the official account: Old Driver Technology Weekly

IOS signatures and certificates

Principles behind iOS Certificates – from blog: The World of Chu Power

How iOS App signatures work — from Bang’s Blog

Swift and OC co-editing mechanism

Understanding Swift and Objective-C and blending from a precompiled perspective

Learning materials

30-Days-Of-Python

Introduction: English warehouse, Star number 5K

The tutorial is divided into 30 days, and each day introduces some Python concepts, along with examples and exercises. As the warehouse’s description states, the 30-day learning period is a challenge for many of us, and we can learn at our own pace, even if it takes 100 days.

Python-100-Days

Introduction: Chinese warehouse, Star number 99.9K

This is a Python tutorial written by A Native, probably the highest number of stars in the Python class. More suitable for Chinese learning habits, accompanied by tutorial introduction and sample code, and more detailed content, not only Python content, but also some front-end, back-end, deep learning and other Python-related knowledge.

Stanford iOS Development Tutorial

Recommended source: Tzqiang

Address: cs193p.sites.stanford.edu/

This Series of Stanford iOS development tutorials will be updated every year, starting with OC and MVC. It has now been updated to Swift and MVVM and is using SwiftUI for view framing. Other content can be accessed on the Internet in Korea, except videos that must be viewed on Youtube.

Development tool

Good development tools are recommended.

Diagrams.net

Recommended source: Zhangferry

Address: www.diagrams.net/

Software status: Free, open source

Used to introduce

Powerful and convenient flowchart drawing software, support both Web and desktop. And Processon’s free version can only add a limit of nine files, Diagrams.net has an unlimited number of files, and it supports more flowchart controls than Processon.

  • Support for almost all mainstream flowchart elements
  • Remote storage, unlimited number of files, Github, Google Drive, Dropbox, etc
  • Supports local desktop, can be offline drawing, local storage
  • Support link sharing, through the link to view our current drawing flow chart
  • It can be exported to image, HTML, PDF and other formats

Github1s.com

Recommended source: Zhangferry

Address: github.com/conwnet/git…

Github repository – this tool allows you to access github repositories as if you were opening them directly in VSCode by simply changing the site domain to github1s. In the case of Swift repository, visit github1s.com/apple/swift…

We can view the repository code directly in the browser, just like in VSCode.

Contact us

The first issue of Fishing Weekly

The second issue of Fishing Weekly

The third issue of Fishing Weekly

Fishing Weekly Issue 4