Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Build complication in SwiftUI の要約

Build complication in SwiftUI の要約

Build complication in SwiftUIの要約
WWDC20セッション要約会

Ryo Tsuzukihashi

July 09, 2020
Tweet

More Decks by Ryo Tsuzukihashi

Other Decks in Programming

Transcript

  1. ͓඼ॻ͖ NJO w ࣗݾ঺հ w ⚠஫ҙࣄ߲⚠ w ίϯϓϦέʔγϣϯͱ͸ʁ w $PNQMJDBUJPOY4XJGU6*

    w $PNQMJDBUJPO5FNQMBUF w ϓϨϏϡʔ w Τϥʔ Ҿ༻IUUQTTVQQPSUBQQMFDPNKBKQHVJEFXBUDIBQEFCXBUDIPT
  2. ࣗݾ঺հ w :BIPP+"1"/ w 1BZ1BZϑϦϚJ04ΞϓϦ w 5XJUUFS !UTV[VLJ  w

    ݸਓΞϓϦ։ൃ͕झຯ ࠷ۙʮ4LZ$PEFʯͱ͍͏ΞϓϦ͕΍΍όζΓ w ޷͖ͳXBUDIGBDF͸ ΠϯϑΥάϥϑϞδϡϥʔ
  3. GraphicCorner ▪CLKComplicationTemplateGraphicCornerCircularView ▪CLKComplicationTemplateGraphicCornerGaugeView ▪CLKComplicationTemplateGraphicCornerTextView GraphicCircular ▪CLKComplicationTemplateGraphicCircularView ▪CLKComplicationTemplateGraphicCircularStackViewT ext ▪CLKComplicationTemplateGraphicCircularClosedGaug eView

    ▪CLKComplicationTemplateGraphicCircularOpenGauge View GraphicRectangular ▪CLKComplicationTemplateGraphicRectangularFullVie w ▪CLKComplicationTemplateGraphicRectangularLargeVi ew ▪CLKComplicationTemplateGraphicRectangularTextGa ugeView ▪CLKComplicationTemplateGraphicRectangularStandar dBodyView ExtraLargeCircular ▪CLKComplicationTemplateGraphicExtraLargeCircular View ▪CLKComplicationTemplateGraphicExtraLargeCircular StackViewText ▪CLKComplicationTemplateGraphicExtraLargeCircular ClosedGaugeView ▪CLKComplicationTemplateGraphicExtraLargeCircular OpenGaugeView $PNQMJDBUJPO5FNQMBUF ߹ܭݸ௥Ճ
  4. 1SFWJFX ద౰ͳ7JFXΛ࡞Δ import SwiftUI struct SampleGraphicRectangular: View { @State var

    gaugeValue: CGFloat = 3 var body: some View { VStack { Text("SwiftѪ޷ձ") Gauge(value: gaugeValue, in: 1...15) { Image(systemName: "drop.fill") .foregroundColor(.green) } currentValueLabel: { Text("\(gaugeValue, specifier: "%.1f")") } .gaugeStyle(LinearGaugeStyle( tint: Gradient(colors: [.orange, .yellow, .green, .blue, .purple]) )) } } }
  5. struct SampleGraphicRectangular_Previews: PreviewProvider { static var previews: some View {

    Group { CLKComplicationTemplateGraphicCornerCircularView(SampleGraphicRectangular()) .previewContext() CLKComplicationTemplateGraphicCircularView(SampleGraphicRectangular()) .previewContext() CLKComplicationTemplateGraphicRectangularFullView(SampleGraphicRectangular()) .previewContext() CLKComplicationTemplateGraphicExtraLargeCircularView(SampleGraphicRectangular ()) .previewContext() } } }