Day 97 of #100DaysOfSwiftUI

Start 100DaysOfSwiftUI from 2020.Mar.18th.

Day 97: Project 19, part two
done with X hours

New findings: followings are new findings

  • ListFormatter would be convenint for almost all user except Japanese... I guess that description(A, B, C and D) is not so common in Japanese.

Following extension woudl become useful soon, because i want to have consistent behavior in iPhone and iPad separately.

コード

extension View {
    func phoneOnlyStackNavigationView() -> some View {
        if UIDevice.current.userInterfaceIdiom == .phone {
            return AnyView(self.navigationViewStyle(StackNavigationViewStyle()))
        } else {
            return AnyView(self)
        }
    }
}

Following mapping looks really cool !

コード

var size: String {
    switch resort.size {
    case 1:
        return "Small"
    case 2:
        return "Average"
    default:
        return "Large"
    }
}

コメントを残す

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