Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
SwiftUIでProfileアプリを作ろう
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
harutiro
October 04, 2024
Technology
87
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
SwiftUIでProfileアプリを作ろう
harutiro
October 04, 2024
More Decks by harutiro
See All by harutiro
マンション備え付けのネットワークとLTE回線を組み合わせた ネットワークの安定化の考案
harutiro
1
210
DeployGateを無料で使いたかった
harutiro
0
350
モバイルエンジニアもCodeRabbitを使ってレビューを少し楽しよう!
harutiro
0
270
プログラマーのGoogle検索および、生成AIを用いたエラー解決方法
harutiro
0
140
「DroidKaigi2024」 スピーカー体験記
harutiro
0
160
[初心者向けGitHub勉強会資料(VScode版)]How To GitHub In VSCode
harutiro
0
770
モバイル開発をする上での利点とは? Webとの違いを考えてみる
harutiro
0
74
安物サーマルプリンターとAndroidを使って遊んでみる
harutiro
0
270
stmn.LT会.ぱぱっとモバイルでセンサー処理をしてみる
harutiro
0
60
Other Decks in Technology
See All in Technology
Railsのように考える: See through the Master
snoozer05
PRO
4
1.1k
データ界隈LT祭 第1回LT登壇
taromatsui_cccmkhd
2
1.5k
SREは、MCPとAutopilotをこう使え!
kazumax55
3
910
AI de Idea
kawaguti
PRO
2
130
アクセスキーこわい やめかたと漏らさない工夫
sassssan68
1
460
AgentCore Runtime上にAgentic Coding基盤を構築・展開する際の設計ポイントと限界点 / Design considerations and limitations when building an agentic coding platform on AgentCore Runtime
har1101
5
360
越境するなら専門用語を使うな高校校歌 / If you wanna cross border, you shouldn't use jargon
vtryo
0
150
Azure Serverless 2026:Production-ready な AI エージェント基盤 / Azure Serverless 2026: Production-Ready AI Agent Platform
miyake
2
270
30座EKS, 180次升級淬煉的EKS Upgrade Skill 的歷程
eric8230
0
180
ADKで始める業務改善 - AIエージェント開発時の考えと設計
harappa80
2
230
AI 時代のスタートアップエコシステ厶から考究する技術的負債との向き合い方
m3m0r7
PRO
3
2.3k
【技術的負債conf】事業成長に伴う技術的負債の説明責任とAIによるモニタリング、認知的負債について
i35_267
3
1.8k
Featured
See All Featured
Building Applications with DynamoDB
mza
96
7.2k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
250
エンジニアに許された特別な時間の終わり
watany
109
250k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
470
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
203
76k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.2k
4 Signs Your Business is Dying
shpigford
187
23k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Making Projects Easy
brettharned
120
6.8k
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.2k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
430
Transcript
SwiftUIで Profileアプリを作ろう 牧野遥斗(はるちろ)
参考にした資料 AndroidDeveloperの誕生日カードとほぼ同じ内容にしています。 https://developer.android.com/courses/pathways/android-basics-compose-unit-1-pathway-3
プロジェクトを作ろう
XCodeを起動させてプロジェクトをつくろう! CreateNewProjectを押す
iOSのテンプレートを選ぶ iOSが選択されているのを 確認する Appを選択して、 プロジェクトを作成する
プロジェクトの情報を入れる。基本は画像通りに アプリ名を設定する ここはアプリを識別するため の部分 学籍番号は自分のもので
保存をする場所を決める 自分のわかりやすい場所にお く 設定ができたらCreateを押す
こんな画面が出てこればOKです
文字を置いてみよう
今回作る物 とりあえず、文字を置いてみよう!
文字をおくためのコンポーネントを作る ※コンポーネント=部品という意味 [メッセージ]と[誰からの文章か]を入れたら、簡単に切り替えれるようにする GreetingText( message: "Happy Birthday Sam", from: "From
Emma" ) GreetingText
文字をおくためのコンポーネントを作る 何も映らない 部品を作る!
部品を簡単に変えれるようにする messageとfromを 自由に変えれるようになります
メッセージを表示してみる 表示されたけど、 文字が小さいし 太くもない... プロパティを 変えてみよう
Textのプロパティ(大きさ) .font(.system(size: 100)) 数値で指定する時は 以下のようにやる 参考文献: https://capibara1969.com/1981/
Textのプロパティ(太さ) 参考文献: https://capibara1969.com/1981/
Textのプロパティ(文字の位置) 左寄せ 真ん中寄せ 右寄せ
もし.multilineTextAlignmentで位置が変わらない時 multilineTextAlignment(.trailing) は 複数行のテキストでの左右揃えに使われる 親ビューでのテキストの配置には frame の alignment を使う。
最終的にこうしてみる
画像を追加してみる
今回作る物 画像を置くよ
コンポーネントをどのように置くか? 画像 GreetingText GreetingTextの裏側に 画像を配置して実装をしてみる
画像を重ねるコンポーネントをつくてみる 表示するコンポーネントが 変わっているので注意 画像を表示する コンポーネントを作成する
VStack, HStack, ZStackについて 選択するものが変わっているだけ 表示する順序を入れ替えるもの 縦並び、横並び、重ねる https://zenn.dev/rikutosato/books/6cee0a2b8aa796/viewer/b55137
さっきと表示が変わらないようにしてみよう
画像をダウンロードしよう 自分の好きな画像をダウンロードするか用意しよう 今回はO-DANを利用して用意してみます https://o-dan.net/ja/ 用意した画像
画像を使えるようにしよう https://capibara1969.com/1861/
画像を使えるようにしよう ここの名前がプログラムで 指定する名前なので、 わかりやすい名前にしてね
最終的にこうしてみる 疲れたから 説明を飛ば したわけで はないよ...
全体コード
答えについて
GitHubを用いて答えのソースをおいてあります。 https://github.com/harutiro/ProfileAppTest
自分流に変更してみよう
今までのコードをちょっと変更してオリジナル化しよ う • 画像の変更 • テキストの変更 • 色の変更 • テキストを増やす
• アイコンを追加してみる アイディア一覧 自由に調べたり、 自分を呼んで実装してみる