查看: 3572| 回复: 106
跳转到指定楼层
上一主题 下一主题
收起左侧

100 days of swiftUI

全局:

注册一亩三分地论坛,查看更多干货!

您需要 登录 才可以下载或查看附件。没有帐号?注册账号

x
在職中不在iOs生態但寫的swift太少 也不想純刷題也想寫點project邊上手swiftUI 恰好100days of swiftUI是需要每天打卡分享所學的!所以在此紀錄
day1: topic: simple vars/let string interpolation/type inference. 就基本中的基本 建議下unwrap app可以順便test

上一篇:MLE面试准备
下一篇:【转码记录贴】2021-09-05
🔗
 楼主| julyVAHF 2021-8-29 11:33:15 来自APP | 只看该作者
全局:
Day 2: collections
Swift provides probably one of the most powerful enum collection type. I found it very useful and practical.
回复

使用道具 举报

🔗
 楼主| julyVAHF 2021-8-30 10:43:10 来自APP | 只看该作者
全局:
Day3 operators and conditions: swift term - 1 to 5: 1...5; 1 through 5: 1..<5
Covering range to NSrange(use case: working with NSAttributedString)
NSString and NSRange(String is a collection of characters; not every character is the same size), thus use Range<String.Index> instead of Range<Int> to get the actual size of a character.
回复

使用道具 举报

🔗
 楼主| julyVAHF 2021-8-31 14:26:42 来自APP | 只看该作者
全局:
Day 3: loops
Outer loop label can be used for Continue but never see it in production code so far.
回复

使用道具 举报

🔗
 楼主| julyVAHF 2021-9-1 14:33:16 来自APP | 只看该作者
全局:
Day 4: functions
Inout, variations functions
Reading:
try?try! Rethrow Not quite covered in the topic, but try? Always return optional, so be aware when the function returns an optional, might confuse if the optional is a rerun value or a thrown error.
回复

使用道具 举报

🔗
 楼主| julyVAHF 2021-9-2 11:19:09 来自APP | 只看该作者
全局:
Day 5 closure- part1:
Basic closure syntax
回复

使用道具 举报

🔗
 楼主| julyVAHF 2021-9-3 08:20:12 来自APP | 只看该作者
全局:
Day7(repeating day3 at loop)
Closure-part2:
What I learnt: more syntax of closure, simple example of implementation of reduce(), capturing values of closure
Additional reading: closure capture reference of any type, the reference lives with closure life cycle- that mean we can modify reference a variable use in a closure; less comply seen: capture list [var = var2] in closure
Advanced topic: weak self/unowned self for closure/@escape
回复

使用道具 举报

🔗
 楼主| julyVAHF 2021-9-4 14:14:09 来自APP | 只看该作者
全局:
Day 8: structure 1
Computed property, did set/willSet, string/array are also implemented using struct
回复

使用道具 举报

🔗
 楼主| julyVAHF 2021-9-4 14:14:50 来自APP | 只看该作者
全局:
julyVAHF 发表于 2021-09-03 23:14:09
Day 8: structure 1
Computed property, did set/willSet, string/array are also implemented using struc
Property Observer: did set/willset
回复

使用道具 举报

🔗
 楼主| julyVAHF 2021-9-5 10:00:34 来自APP | 只看该作者
全局:
Day 9: struct part 2:
What I learnt: Lazy initialization, access control
Reading: no need to write self when referencing other instance or methods with the closure
Closure is not escaping so no need to do weak self
If a property can be accessed by multiple threads there’s no guarantee that it will be initialized only once if several threads access the property at the same time before the initial value is set
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号
隐私提醒:
  • ☑ 禁止发布广告,拉群,贴个人联系方式:找人请去🔗同学同事飞友,拉群请去🔗拉群结伴,广告请去🔗跳蚤市场,和 🔗租房广告|找室友
  • ☑ 论坛内容在发帖 30 分钟内可以编辑,过后则不能删帖。为防止被骚扰甚至人肉,不要公开留微信等联系方式,如有需求请以论坛私信方式发送。
  • ☑ 干货版块可免费使用 🔗超级匿名:面经(美国面经、中国面经、数科面经、PM面经),抖包袱(美国、中国)和录取汇报、定位选校版
  • ☑ 查阅全站 🔗各种匿名方法

本版积分规则

>
快速回复 返回顶部 返回列表