Day 68, 69, 70, 71, 72, 73 of #100DaysOfSwiftUI

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)

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

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です