-
Notifications
You must be signed in to change notification settings - Fork 766
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8d0a0ae
commit a4b3b20
Showing
4 changed files
with
5 additions
and
32 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,4 @@ | ||
## 25.`id` 和 `instanceType` 有什么区别? | ||
|
||
|
||
##### 相同点 | ||
`instancetype` 和 `id` 都是万能指针,指向对象。 | ||
|
||
|
||
##### 不同点: | ||
|
||
- 1. `id` 在编译的适合不能判断对象的真实类型,`instancetype` 在编译的时候可以判断对象的真实类型 | ||
- 2.`id` 可以用来定义变量,可以作为返回值类型,可以作为形参类型;`instancetype` 只能作为返回值类型 | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
## 2.`Bounds` 和 `Frame` 的区别? | ||
## 2.`Designated Initializer`的规则? | ||
|
||
- `Bounds`:一般是相对于自身来说的。如果你修改了 `Bounds`,那么子控件的相对位置也会发生改变。 | ||
1.[推荐一篇写的很好的文章](https://www.cnblogs.com/smileEvday/p/designated_initializer.html) | ||
|
||
|
||
2.[这篇文章](https://www.jianshu.com/p/f92972bf7300)写得更简单易懂 | ||
|
||
- `Frame` :是相对于父控件来说的。 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,4 @@ | ||
|
||
## 21.了解 `逆变` 和 `协变` 吗? | ||
|
||
|
||
iOS 9 之后的新特性,基于泛型,在有父子继承关系的时候会用到逆变与协变。 | ||
|
||
可以看一下[这篇文章](https://blog.csdn.net/imkata/article/details/78859482) | ||
|
||
|
||
|