Notes for Swift/SwiftUI and somethings about Apple platform. (Maybe change name in future)
2023-06-12 | #Words: 323
Finally I found the `String` type has a particularly magical method, like: String(a, radix: 16, uppercase: true)
2023-04-22 | #Words: 570
Sometimes you need to convert array subscripts and elements into a dictionary. For example, if you use array elements to search for subscripts, if you use a function to search, you have to perform a loop search and acquisition every time, which requires a lot of computing performance and memory. At this time, convert the original array into a dictionary, keyword For array elements, it would be more convenient if the value is a subscript serial number, so that the serial number can be easily found through the value of the element, and there is no need to perform a loop search every time.
2023-04-02 | #Words: 973
Sometimes, Xcode Test cannot meet our need, so we need to write the testing function mannully. The main of testing function is measure time of code. Whether it is testing a CPU/GPU-intensive program or a read-write-intensive program, it is necessary to obtain the running time of the program or function to calculate performance.
2022-11-24 | #Words: 608
From iOS 16, Apple start to deprecate the original `NavigationView` and will gradually phase it out completely in the future. Apple start to use `NavigationStack` and `NavigationSplitView`.
2022-10-25 | #Words: 823
ZhongUncle will introduce how to grant different permissions of Safari Extension, like types, domains, kinds.The permissions of Safari Extension extensions are roughly divided into the following aspects:
2022-09-23 | #Words: 3101
At WWDC2022, Apple provided the chart-related package `Charts` for SwiftUI, so you don’t have to work hard to implement the chart function yourself. The amount of code suddenly changed from four to five hundred lines to a dozen or even a few lines (I still remember that I almost vomited blood trying to write the chart function). So I want to study the built-in chart function carefully, so as to facilitate future development and use
2022-08-13 | #Words: 1375
Starting from iOS 15.0, Apple has abandoned the previous.animation(Animation?) and recommends developers to use .animation(Animation?, value: Equatable) or withAnimation instead.Personally, I feel that although I may not be used to it after the revision, the possibilities and freedom of development are greater.But before talking about the difference between the two, we need to understand UI animation. You can skip this part if you understand it.What is animation.Animation is a process of attribute changes such as various displacements, color changes, size changes, etc.Specific to SwiftUI's View, it is their .offset, .foregroundC
2022-07-17 | #Words: 1392
ZhongUncle introduces how to jump to other pages and views in SwiftUI. I shows two methods and new method after iOS 16.Since it jumps page by page, so it is not suitable for jumping between some pages
2022-07-08 | #Words: 133
ZhongUncle introduces how to use Swift to parses URLs.
2022-03-23 | #Words: 2953
How to modify TabView in SwiftUI (including properties of tabItem), such as color, position, size, etc.
2022-03-14 | #Words: 1005
In the process of developing software, we not only need to perform operations when the user clicks, but sometimes we also need to automatically perform some operations at regular intervals. For example, the most common opening screen advertisement countdown is closed, as well as some animation effects. There are generally two ways to implement these: one is to use a timer, and the other is to use asynchronous operations.
2022-02-22 | #Words: 959
Apple provides 14 major categories, a total of 174 image processing methods and some common filters in the Core Image API. The first is how to read this web page, that is to say what information this web page provides, which is very helpful for us when using it. Take the screenshot below as an example to explain how to see it.
2022-02-21 | #Words: 1081
There are many situations need developers to push notifications, but not many people talk about push notifications in SwiftUI. Here is some relevant content, So I write this blog. On the one hand, I can refer to it in future, on the other hand, I also want to help people in need.
2022-02-11 | #Words: 1390
Obtaining JSON from the website API and displaying the text is a very common usage scenario in development.
2022-01-20 | #Words: 324
ZhongUncle introduce how to obatin the size of a View in SwiftUI. You can get height or width of a View component.
2022-01-11 | #Words: 234
Apple provides many symbols to developers, which improves developer efficiency and unifies the usage of many symbols to avoid misunderstandings. These synbols are called as SF symbols. Apple provides an App for developers to find these symbols, also called SF Symbol, which can be found on the Apple Developer website
2021-12-10 | #Words: 695
SwiftUI cannot directly call the camera and photo album, it needs to be used together with UIKit.
2021-12-10 | #Words: 608
I will tell you how to get images or photos from the system album in SwiftUI. SwiftUI cannot obtain the system album content by itself, so it has to rely on UIKit.
2021-04-03 | #Words: 420
ZhongUncle introduces how to obtain information of device, system and battery in Swift.