- 🌱 I’m currently learning something about OC and Swift. And record it here.
- 💬 Ask me about anything here
jmovxia / cldemo Goto Github PK
View Code? Open in Web Editor NEW记录平时博客中的Demo,持续更新
记录平时博客中的Demo,持续更新
error: Build input file cannot be found: '/Users/xxx/Downloads/CKD/CKD/Other/Gategory/AutoScale+Extension.swift' (in target 'CLDemo' from project 'CLDemo')
项目怎么无法运行 pod 也不行
[!] Error installing libwebp
[!] /usr/bin/git clone https://chromium.googlesource.com/webm/libwebp /var/folders/xj/m57_s4rx18nbmfqkmrm09c8c0000gn/T/d20190725-66922-1x38cti --template= --single-branch --depth 1 --branch v1.0.2
Cloning into '/var/folders/xj/m57_s4rx18nbmfqkmrm09c8c0000gn/T/d20190725-66922-1x38cti'...
fatal: unable to access 'https://chromium.googlesource.com/webm/libwebp/': Failed to connect to chromium.googlesource.com port 443: Operation timed out
并没有像微信通讯录,当前字母可以显示背景颜色
作者是直接切换了rootViewController
,来达到其他页面切换语言的, 但是这样有个问题,假如用户在其他页面有了操作,切换了rootViewController
之后,其他页面的操作和状态都没了,感觉不优雅,支付宝这块比微信好很多,支付宝切换多语言之后,其他页面的操作状态都不会有任何变化
按照Demo的思路我自己写了一个功能。
可是如果Cell 一开始是暂停的状态。我点击开始后,总是得不到正确的时间
如题
版主你好,游標卡尺滑動時候數字沒有跟著更換。
我將 indexValueCallback 改寫到 setItem裡面處理。
其原因是因為self.item在還沒初始化之前他取不到值。所以原先block在guard語句之後就會返回。
後續的函數功能都不會執行。
我的理解是 -> indexValueCallback 不能寫在懶加載定義裡面。因為初始化的時候 自己的CellProtocol 協議還沒有值 self.item 會造成崩潰
所以進行了下面的修改
func setItem(_ item: CLRecordVernierCaliperItem, indexPath: IndexPath) {
self.vernierCaliperView.indexValueCallback = {[weak self] (value) in
guard let weakSelf = self else { return } //item -> CLRecordVernierCaliperItem
weakSelf.item?.value = value.cgFloat
weakSelf.item?.valueChangeCallback?(value)
weakSelf.valueLabel.attributedText = weakSelf.attributedString(value, type: item.type)
}
//其餘代碼
}
您參考看看
item需要存储,这里永远return了nil,导致cell里面无法正常获取数据
private var xoAssociationKey: UInt8 = 0
var item: T? {
get {
return objc_getAssociatedObject(self, &xoAssociationKey) as? T
}
set(newValue) {
objc_setAssociatedObject(self, &xoAssociationKey, newValue, objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN_NONATOMIC)
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.