Start 100DaysOfSwiftUI from 2020.Mar.18th.
Day 68, 69, 70, 71, 72, 73 : Project 14, part one-six
done with 3 hours
New findings: followings are new findings
- using extention for hiding optional would be solution for binding optional value which is used in UIKit
challenge for FileManager extension (in part one)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
extension FileManager { static func writeToDocumentDirectoryFile(filename: String, content: String) throws { let url = FileManager.fileUrlInDocumentDirectory(filename: filename) try content.write(to: url, atomically: true, encoding: .utf8) } static func readFromDocumentDirectoryFile(filename: String) throws -> String { let url = FileManager.fileUrlInDocumentDirectory(filename: filename) let content = try String(contentsOf: url) return content } static func fileUrlInDocumentDirectory(filename: String) -> URL { let paths = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask) let url = paths[0].appendingPathComponent(filename) return url } } |
Challenges
1: Plus button became really small. but not difficult to click
Sponsor Link