Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
UICollectionViewを使って商品一覧を改善する
Search
Taku Okawa
April 28, 2014
Programming
0
6.6k
UICollectionViewを使って商品一覧を改善する
slides from my talk at
http://eventdots.jp/event/47442
Taku Okawa
April 28, 2014
Tweet
Share
More Decks by Taku Okawa
See All by Taku Okawa
Short Intro to Elm concepts
t4ku
0
160
Other Decks in Programming
See All in Programming
Sheets API使ってみた
toshi0383
2
160
見た目から始める生産性向上
ikumatadokoro
10
1.3k
大規模Reactアプリのリアーキテクチャ~8万行のTanStack Query移行の軌跡~
kj455
4
1k
Tailwind CSSを本気でカスタマイズする方法
fsubal
14
5.5k
Try creating your own orderedmap
kazamori
1
170
Ruby GitHub Packages
bkuhlmann
0
640
Node.js v22 で変わること
yosuke_furukawa
PRO
11
3.9k
DMMプラットフォームがTiDB Cloudを採用した背景
pospome
9
4.2k
サイコロで理解する統計的仮説検定の考え方
tatamiya
4
1k
Ruby Function Composition
bkuhlmann
1
340
dbtのドメイン分割による データ基盤の改善とDigdagとの連携
sakama
0
440
PHPの次期バージョンはこの時期どうなっているのか - Internalsの開発体制について - PHPカンファレンス小田原
youkidearitai
PRO
1
220
Featured
See All Featured
RailsConf 2023
tenderlove
8
550
Atom: Resistance is Futile
akmur
260
25k
Git: the NoSQL Database
bkeepers
PRO
423
63k
Designing with Data
zakiwarfel
96
4.8k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
123
39k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
19
6.9k
How To Stay Up To Date on Web Technology
chriscoyier
782
250k
Debugging Ruby Performance
tmm1
70
11k
Six Lessons from altMBA
skipperchong
22
3k
4 Signs Your Business is Dying
shpigford
176
21k
Art, The Web, and Tiny UX
lynnandtonic
290
19k
Teambox: Starting and Learning
jrom
128
8.4k
Transcript
UICollectionViewを使って 商品一覧を改善する (BUYMAアプリ) 株式会社エニグモ シニアエンジニア 大川 琢
BUYMA(バイマ)は、世界105カ国に在住する 約5万人のパーソナルショッパーから 世界中の魅力的な商品をお得に購入できる、 会員数170万人のこれまでにない 新しいソーシャル・ショッピング・サイトです。 BUYMAとは?
None
BUYMAアプリ作った経緯 • 近年のスマートフォンのアクセス率の増加 • 中でも若年層の割合が増加 • アプリを作ってほしいというユーザーからの要望 • オーガニック流入以外の会員獲得
BUYMAアプリのコンセプト • 趣向にあった商品との出会い • 好きな商品群を気軽にチェックできる • 旬な商品を把握できる • 商品をリアルに感じさせるUI
None
よい反響もありつつ
リリース後に頂いた改善要望の内訳
None
None
None
None
要約 画像でかすぎ!!
とりあえず画像が大きいというのもあるが、
BUYMA固有の課題
同一モデルの商品
Webサイト(スマホ用)
Webサイト(スマホ用) 商品自体は同じ!
Webサイト(スマホ用) スクロール疲れ
アプリになると
よりしんどくなる感 じ。。
もうちょっと一覧でみたい。 とはいえ、大きな画像でもみたい。
改善スプリント開始
テーブルビュー グリッドビュー 検索結果一覧で、二種類のビューで見れるようにする。
スクロールポジション(どこまで見たか)の 保持、割と重要!
実装パターン
UITableView UICollectionView
UITableView UICollectionView フェードインで遷移 contentOffset同期
DEMO
問題はないが、、、
問題はないが、、、 アイテムがどこに行ったかという、 キュー(手がかかり)がない
問題はないが、、、 アイテムがどこに行ったかという、 キュー(手がかかり)がない 2つViewを保持することへの(プログラ マ的)抵抗感
UICollectionView
• iOS6で導入されたUIKitのクラス • 簡単に言うと、レイアウトをカスタマイ ズできるUITableView
応用例
objc.io - Custom CollectionView Layouts http://www.objc.io/issue-3/collection-view-layouts.html
iOS6-Playground https://github.com/brianpartridge/iOS6-Playground
Matt Thompson
今回は規則的に(リニアに)セルを並べ るだけなのでもっと地味に使う
UITableView UICollectionView
UICollectionFlowLayout UICollectionFlowLayout UICollectionView CollectionViewLay out
UICollectionFlowLayout UICollectionFlowLayout UICollectionView CollectionViewLay out プロパティを変更するだけで レイアウトが変更できる -(void)setCollectionViewLayout animated:(BOOL)animated
DEMO
None
None
None
ハマりポイント
セル自体のレイアウトは変更してくれる けど、グリッド↔テーブルでセルの変更 はしてくれない。
テーブルビュー グリッドビュー TableLayoutCell GridLayoutCell
セル自体のレイアウトは変更してくれる けど、グリッド↔テーブルでセルの変更 はしてくれない。 無理やりreloadDataすると、アニメーションがゴ ニョっとしてしまう。。。
じゃあ、ひとつのセルで両方のレイアウト に使用するか。。。
None
ヘッダーはなしで ボタンは縦に配置 価格のみ表示
AutoLayoutだけでは厳しい
レイアウト切替時に、セル内部もアニ メーションしたい。が、
セル自体の変更やアニメーションを行う delegateやサブクラスはない...
もう一回よく考えてみる
- (void)setCollectionViewLayout:(UICollectionViewLayout *)layout animated:(BOOL)animated
- (void)setCollectionViewLayout:(UICollectionViewLayout *)layout animated:(BOOL)YES
UICollectionFlowLayout UICollectionFlowLayout UICollectionView - (void)setCollectionViewLayout:(UICollectionViewLayout *)layout animated:(BOOL)YES frame( 10,10, 140,
140) frame( 20,520, 320,420)
UICollectionFlowLayout UICollectionFlowLayout UICollectionView - (void)setCollectionViewLayout:(UICollectionViewLayout *)layout animated:(BOOL)YES frame( 10,10, 140,
140) frame( 20,520, 320,420) 2つのframe間をア ニメーション
UICollectionFlowLayout UICollectionFlowLayout UICollectionView - (void)setCollectionViewLayout:(UICollectionViewLayout *)layout animated:(BOOL)YES frame( 10,10, 140,
140) center alpha hidden translate3D frame( 20,520, 320,420) カスタムのレイアウトを組む 時のdelegateメソッドで返す オブジェクト UICollectionViewLayoutAttributes
- (void)setCollectionViewLayout:(UICollectionViewLayout *)layout animated:(BOOL)NO
UICollectionFlowLayout UICollectionFlowLayout UICollectionView - (void)setCollectionViewLayout:(UICollectionViewLayout *)layout animated:(BOOL)YES frame( 10,10, 140,
140) frame( 20,520, 320,420) 一気に切り替わる
UICollectionFlowLayout UICollectionFlowLayout UICollectionView - (void)setCollectionViewLayout:(UICollectionViewLayout *)layout animated:(BOOL)YES frame( 10,10, 140,
140) frame( 20,520, 320,420) frameをセットしてる だけっぽい。 cell.frame = CGRectMake(10,10,140,140)
frameの変更をアニメーション?
古くて新しいUIView animation
None
DEMO
おまけ
Revealとてもよい
まとめ
• APIとの戦い → とりあえずWWDCセッションビデオみるの 重要。 • 困ったら基本に戻る/発想変えてみる(なんとなくフレーム ワーク内の動きを想像してみる) • 今回は試してないけどViewController
Transition API(iOS 7)でもいけるかも • 日頃の研鑽大事
エニグモでは一緒にBUYMAを盛り上げてくれるエ ンジニアを募集中です!
ご清聴ありがとうございました!!