-
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
StringCatalog対応やSwinftLint修正など #15
base: main
Are you sure you want to change the base?
Conversation
9fd6bb6
to
ee0a12e
Compare
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.
最新の https://github.com/github/gitignore/blob/main/Swift.gitignore を参考にしつつ、Swift Package Manager、CocoaPods、Carthage、fastlane のいずれも、コメントアウトだけでなくて記述自体を削除してしまって良いかなと思います
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.
struct
から enum
に変更して、うっかり Strings
等のインスタンスが internal から作られないようにしませんか?
namespace 的な使い方をしたいということだと思うので
} | ||
do { | ||
let (data, _) = try await URLSession.shared.data(from: url) | ||
let markdownString = String(decoding: data, as: UTF8.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.
こちら、今まで使っていた init(data:encoding:)
から init(decoding:as:)
を使うように変更されていますが、意図した変更ですか?
// TaskGroupを使用して並列処理する | ||
await withTaskGroup(of: Void.self) { group in |
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.
将来的に、PostListViewModel.sortedPosts
で sort せずとも withTaskGroup(of:returning:isolation:body:)
の戻り値が sort 済みである状態にしたいですね
do { | ||
let (data, _) = try await URLSession.shared.data(from: url) | ||
let markdownString = String(decoding: data, as: UTF8.self) | ||
guard markdownString.starts(with: " ") else { |
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.
もし guard
を使い続ける場合、https://docs.swift.org/swift-book/documentation/the-swift-programming-language/statements/ と照らし合わせて、else 句のところには処理の脱出を強制させるべきであることを示してそのための処理を書く方が良いと思うので、!markdownString.starts(with: " ")
にして else 句では return
だけ行いたいです。
Close #8
Close #6
対応した内容
Note