Skip to content

Commit c825f9f

Browse files
committed
add contents for ios notes
1 parent c9887dd commit c825f9f

File tree

4 files changed

+116
-30
lines changed

4 files changed

+116
-30
lines changed

_posts/2023-01-01-about-the-author.md

Lines changed: 0 additions & 27 deletions
This file was deleted.

_posts/2023-07-16-ios-dev-notes.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
---
2+
layout: post
3+
title: "iOS Development Notes"
4+
author: "Yalun Hu"
5+
categories: journal
6+
tags: [Blog, iOS, Swift]
7+
8+
image: mountains.jpg
9+
---
10+
11+
## 如何快速查看文档
12+
13+
在Xcode中按住Option然后点击对应的关键字或builtin types,便能快速跳转到对应的文档下。
14+
15+
## 类和结构体对比
16+
17+
Structures and classes in Swift have many things in common. Both can:
18+
19+
- Define properties to store values
20+
- Define methods to provide functionality
21+
- Define subscripts to provide access to their values using subscript syntax
22+
- Define initializers to set up their initial state
23+
- Be extended to expand their functionality beyond a default implementation
24+
- Conform to protocols to provide standard functionality of a certain kind
25+
26+
For more information, see [Properties](https://docs.swift.org/swift-book/documentation/the-swift-programming-language/properties), [Methods](https://docs.swift.org/swift-book/documentation/the-swift-programming-language/methods), [Subscripts](https://docs.swift.org/swift-book/documentation/the-swift-programming-language/subscripts), [Initialization](https://docs.swift.org/swift-book/documentation/the-swift-programming-language/initialization), [Extensions](https://docs.swift.org/swift-book/documentation/the-swift-programming-language/extensions), and [Protocols](https://docs.swift.org/swift-book/documentation/the-swift-programming-language/protocols).
27+
28+
Classes have additional capabilities that structures don’t have:
29+
30+
- Inheritance enables one class to inherit the characteristics of another.
31+
- Type casting enables you to check and interpret the type of a class instance at runtime.
32+
- Deinitializers enable an instance of a class to free up any resources it has assigned.
33+
- Reference counting allows more than one reference to a class instance.
34+
35+
For more information, see [Inheritance](https://docs.swift.org/swift-book/documentation/the-swift-programming-language/inheritance), [Type Casting](https://docs.swift.org/swift-book/documentation/the-swift-programming-language/typecasting), [Deinitialization](https://docs.swift.org/swift-book/documentation/the-swift-programming-language/deinitialization), and [Automatic Reference Counting](https://docs.swift.org/swift-book/documentation/the-swift-programming-language/automaticreferencecounting).
36+
37+
## 协议[Protocols]
38+
39+
A *protocol* defines a blueprint of methods, properties, and other requirements that suit a particular task or piece of functionality. The protocol can then be *adopted* by a class, structure, or enumeration to provide an actual implementation of those requirements. Any type that satisfies the requirements of a protocol is said to *conform* to that protocol.
40+
41+
Multiple protocols can be listed, and are separated by commas:
42+
43+
```swift
44+
struct SomeStructure: FirstProtocol, AnotherProtocol {
45+
// structure definition goes here
46+
}
47+
```
48+
49+
If a class has a superclass, list the superclass name before any protocols it adopts, followed by a comma:
50+
51+
```swift
52+
class SomeClass: SomeSuperclass, FirstProtocol, AnotherProtocol {
53+
// class definition goes here
54+
}
55+
```
56+
57+
## MVVM设计模式
58+
59+
Model-View-ViewModel is a design paradigm.
60+
61+
It must be adhered to for SwiftUI to work.
62+
63+
### Model
64+
65+
- UI Independent
66+
- Data + Logic
67+
68+
### View
69+
70+
- The reflection of the Model
71+
- Stateless
72+
- Declared(只有“var body”决定了view是如何绘制的)
73+
- Reactive (Always reacting efficiently to the change on the model)
74+
- Automatically observes publications from ViewModel( or subscribe what they interested at from the ViewModel) .Pulls data and rebuild itself.
75+
76+
### ViewModel
77+
78+
- Binds View to Model(so the change on the model cause the view to react and get rebuilt)
79+
- Interpreter (between Model and View). Help View code stay clean and neat.
80+
- Gatekeeper.
81+
- Constantly noticing changes in the Model
82+
- Publish a message globally once any change in the Model is noticed (avoid have any connection to any of the View that using it to access the Model)
83+
- Processing User Intent(Change the Model based on the events occurs in the View)
84+
85+
### Rules in MVVM
86+
87+
- The View must always get data from the Model by asking it from the ViewModel.
88+
- The ViewModel never stores the data for the Model in side of itself.
89+
90+
91+
92+
93+
Loading

menu/about.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,35 @@ title: Welcome to Algorithmic!
44
permalink: /about
55
---
66

7+
## About Algorithmic
8+
9+
![sky](/assets/img/about/shanklin.jpg)
10+
711
Algorithmic is a place where I share my technical notes at.
812

913
Hope you can find something you're interested in my blog.
1014

11-
![sky](/assets/img/about/shanklin.jpg)
12-
1315
## About the author
1416

15-
[Hi I'm Allan!]({{ site.github.url }}{% post_url 2023-01-01-about-the-author %})
17+
![me](/assets/img/2023-01-01-about-the-author/author.jpg)
18+
19+
Hi there! I'm Allan.
20+
I’m a physics major turned programmer.
21+
I got my Msc of Artificial Intelligence in the University of Southampton in 2019.
22+
23+
I started to work at [SynSense](https://github.com/synsense) as an Algorithm Engineer from 2021.
24+
Before that, I worked as a machine-learning researcher at a game start-up in Chengdu, China for about 1 year.
25+
26+
My research interests consists of:
27+
28+
- Machine Learning
29+
- Computer Vision
30+
- Neuromorphic Computing
31+
- Heterogeneous Computing
32+
33+
etc.
34+
35+
Hope you can find something you're interested in my blog.
1636

1737
## Blogs
1838

0 commit comments

Comments
 (0)