設(shè)置layer.shadow導(dǎo)致子控件染色
設(shè)置該view的背景色為白色
delegate導(dǎo)致內(nèi)存泄漏
weak delegate
protocol前加上@obj
fatal: Could not read from remote repository
1.$ ssh-keygen -t rsa -C "Dwysen" (""內(nèi)為git用戶名)
-
一直回車直到出現(xiàn)image.png
3.$ cat /Users/dwyson/.ssh/id_rsa.pub
(打開圖中的.pub文件),然后復(fù)制ssh-rsa到github Setting中
testView.viewWithTag(0)
使用viewWithTag方法獲取該view上的子view時(shí),tag為0取到的是該view本身,因?yàn)関iew的tag默認(rèn)是0
No such file or directory
上述問題是本人升級(jí)了Mac的系統(tǒng)導(dǎo)致的,當(dāng)你的Mac系統(tǒng)升級(jí)為 high sierra 的時(shí)候,別忘記更新cocoapods。執(zhí)行命令為:
sudo gem install cocoapods -n/usr/local/bin
TableView 折疊Section
// 用于記錄section折疊情況的數(shù)組,暫定為兩個(gè)section
var collpse = [true,true]
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if collpse[section] == false {
return 10
} else {
return 0
}
}
@objc func tapHeadView(_ sender:UITapGestureRecognizer){
collpse[sender.view!.tag] = !collpse[sender.view!.tag]
if collpse[sender.view!.tag] {
UIView.animate(withDuration: 1, animations: {
self.tableView.height -= 440
})
} else {
self.tableView.height += 440
}
保留小數(shù)點(diǎn)后兩位小數(shù)
let finalStr = String.init(format: "%.2f", Float(upAndDown!.priceChangeRatio)!)
使某View除了按鈕點(diǎn)擊外不阻擋其后層View的拖拽滾動(dòng)事件
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
UIView *view = [super hitTest:point withEvent:event];
if ([view isKindOfClass:[UIButton class]]) {
return view;
}
return nil;
}
self.navigationItem.titleView ≠ self.navigationController.navigationItem.titleView
設(shè)置了self.navigationController.navigationItem.titleView,界面上出不來
改為self.navigationItem.titleView后正確
