-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gayson 吉训振 #7
base: master
Are you sure you want to change the base?
Gayson 吉训振 #7
Conversation
版本修订,解决了爆炸bug |
删掉了一点无用文件 |
可以可以,差点弄错名字了 🥇 |
import UIKit | ||
|
||
class NoteDetailController: UIViewController { | ||
@IBOutlet weak var context: UITextView! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
命名不好,原意是上下文。建议改成 textView
。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
其实是想写成content然后打错了就一直让他错着了
|
|
||
protocol NoteDetailDelegate { | ||
func newNote(content: String) | ||
func modifyNote(content: String, indexPath: IndexPath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这几个方法里要传 indexPath 不合理。不能假定自己是被列表唤起的吧。
@IBOutlet weak var delete: UIButton! | ||
|
||
var status: OpenStatus? | ||
var indexPath: IndexPath? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
依赖 indexPath 不合理,假定自己的调用者是列表了。直接持有一个 Note 对象得了。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
一开始是觉得会方便一点,后面发现其实并没有太多用处
let cellNib = UINib(nibName: "NoteItem", bundle: nil) | ||
noteListView.register(cellNib, forCellReuseIdentifier: "noteItem") | ||
|
||
noteListView.delegate = self |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果你大量用 Storyboard 为什么不全用 SB 设置?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
对storyboard如何单独设计一个viewcell不太熟悉,所以用了xib
No description provided.