Write it at the very beginning
In May 2021
- Self-study iOS development, progress 0.15 (self-judged)
- Have learned the basic syntax of OC and SWIFT
- It can build an App with low requirements in pure code, realizing functions including page building, network access, database operation, Bluetooth configuration and so on
- Able to see and use basic third party frameworks such as SDWeb, AFN, Masonary, Snapkit, FMDB and other known lazy frameworks
- At present, I mainly study the projects in the hand of imitation writing and modification
- A clear career position for the future is not clear
The purpose of this article
- Review and review the learning content of nearly half a year, and summarize the pits and unsolved problems in this half year
- Summarize UI aspects in terms of control categories
- To apply requirements, summarize various encountered requirements and solutions
- Prevention of forgotten potholes and corresponding solutions
- Monitor your learning status
UI controls article
Before we talk about controls, we need to say the preparations for UI display in ios apps:
- Size, coordinates for the parent control
- Content, including pictures, data, text, etc
- Display style, such as UILabel display text color, size, etc
UIImageView with UILabel
UIImageView with UILabel
UIButton with UITextField at
UIButton with UITextField at
UIScrollView
UIScrollView
UICollectionView
UICollectionView
UIPickView
UIPickView
UISwitch and UIProgressView
UISwitch and UIProgressView
UIAlertController
UIAlertController
WKWebView
WKWebView
Quartz2D
Quartz2D
CALayer, animation, gestures, events
CALayer, animation, gestures, events
The controller article
UIViewController
- The most basic controller, put whatever you want to put, can be understood as a blank sheet of paper, right
- Some of the Settings
/ / set the background color self. The backgroundColor = [UIColor redColor]; / / tile set the background of the self. The backgroundColor = [UIColor colorWithPatternImage: [UIImage imageNamed: @ "back"]]. // Add control [self.view addSubview: self.btn];Copy the code
Custom root controller and UINavigationController
Custom root controller and UINavigationController
UICollectionViewController and UITabBarController
UICollectionViewController and UITableViewController
UITableViewController
UITableViewController
Feature article
- This section focuses on data retrieval functions, such as retrieving images, JSON, and so on
- The general classification is based on plIST, database, network, etc
Read plIST and array model
Read plIST and array model
Access to the network
Access to the network
SQLite database
SQLite database
Data transfer between interfaces
Data transfer between interfaces
Bluetooth Bluetooth
Bluetooth Bluetooth
multithreading
Multi-threaded GCD Swift implementation
Storing local information
Storing local information
Third Party Framework
babyBluetooth
babyBluetooth
SnpaKit with Masonary
AFNetworking
SDWebImage
FMDB
System related
Obtain system-related information
- Status bar height and navigation bar height
//swift let navHeight = navigationController? . NavigationBar. Frame. The size, height / / $0 closure said the first parameter let statusHeight = UIApplication.shared.windows.first{$0.isKeyWindow}?.windowScene?.statusBarManager?.statusBarFrame.size.height //oc CGFloat navHeight = self.navigationController.navigationBar.bounds.size.height; CGFloat statusHeight = [UIApplication sharedApplication].windows.firstObject.windowScene.statusBarManager.statusBarFrame.size.height;Copy the code
- KeyWindow, which is the bottom view
//swift
UIApplication.shared.windows.first{$0.isKeyWindow}
//oc
[UIApplication sharedApplication].windows.firstObject;
Copy the code
other
Sharing app design ideas
The data processing
- This section wraps up some of the data processing aspects encountered
The data processing
A few points
A few points
Modal jumps and view life cycles
Modal jumps and view life cycles
Sandbox directories
#import "NSString+ sendbox.h "@implementation NSString (Sendbox) // cache - (instanceType)appendCache{return [[NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:[self lastPathComponent]]; } / / staging - (instancetype) appendTemp {return [NSTemporaryDirectory () stringByAppendingPathComponent: [to self lastPathComponent]]; } / / file - (instancetype) appendDocument {return [[NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:[self lastPathComponent]]; } @endCopy the code
shortcuts
CMD + CTRL + E Global modify CTRL + 6 directly enter, Support intelligent search and matching CMD + SHIFT + O Global search CMD + SHIFT + F Global search CMD + L Skip CMD + SHIFT + J Locate files CMD + OPTION + N Create folders CMD + N Create files CMD + SHIFT + N Create a new projectCopy the code
2021.7.6 Update diary
- In the last month, the wave has been broken and the state is not right, but today, I can finally say that I have sorted out the content of OC except that of the third-party library intermittently
- When I was writing a project, WHENEVER I forgot something and looked at the blog, I really felt a lot. Finally I wrote a Baidu, and I no longer had to look at the copy-paste pit
- There are also some contents of SWIFT in it, and the parts with great differences between SWIFT and OC will also be sorted out
- The next update doesn’t raise a flag, and it’s ready for the next new pit
- Third party library update time, unknown