LoginSignup
2
2

More than 3 years have passed since last update.

[SwiftUIスケッチ] Slackのサインインボタン

Last updated at Posted at 2019-09-27

SwiftUIの練習がてらスケッチしてみる。

Screen Shot 2019-09-28 at 1.55.59.png

こういうやつ
https://api.slack.com/docs/sign-in-with-slack

struct SignInWithSlackButton: View {
    let action: () -> Void
    var body: some View {
        Button(action: action) {
            HStack(alignment: .center) {
                Image("Slack")
                    .renderingMode(.original)
                    .resizable()
                    .frame(width: 24, height: 24, alignment: .center)
                HStack(spacing: 0) {
                    Text("Sign in with ")
                    Text("Slack").fontWeight(.bold)
                }
            }.padding(EdgeInsets(top: 6, leading: 8, bottom: 6, trailing: 8)).overlay(
                RoundedRectangle(cornerRadius: 6)
                    .stroke(Color.secondary, style: StrokeStyle(lineWidth: 1))
            ).foregroundColor(Color.primary)
        }
    }
}

Screen Shot 2019-09-28 at 2.14.33.png

もやもやするところ

  • 文字サイズ大きい時は画像も大きくしたい
  • 文字途中で太字にするのはHStackでいいのかな
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2