SlideShare a Scribd company logo
1 of 40
Download to read offline
簡単!
Complication!!
長尾 聡一郎 @sohichiro
2015/07/07 WWDC2015 情報共有会 at 21cafe
Complication
・Complicationとは
・実装
・Tips
Complicationとは?
• clockFace上に配置される領域に
情報を表示できる(バッチの代用)
• カスタマイズが可能
• textとImageが使用可能
• 過去と未来の状態を確認できる
「Time Travel」機能がある
Complicationとは?
• clockFace上に配置される領域に
情報を表示できる(バッチの代用)
• カスタマイズが可能
• textとImageが使用可能
• 過去と未来の状態を確認できる
「Time Travel」機能がある
アプリから様々な情報をClockFaceに表示できる
Complicationとは?
• clockFace上に配置される領域に
情報を表示できる(バッチの代用)
• カスタマイズが可能
• textとImageが使用可能
• 過去と未来の状態を確認できる
「Time Travel」機能がある
Complicationとは?
• clockFace上に配置される領域に
情報を表示できる(バッチの代用)
• カスタマイズが可能
• textとImageが使用可能
• 過去と未来の状態を確認できる
「Time Travel」機能がある
イメージ
Complicationとは?
• clockFace上に配置される領域に
情報を表示できる(バッチの代用)
• カスタマイズが可能
• textとImageが使用可能
• 過去と未来の状態を確認できる
「Time Travel」機能がある
・Complicationとは
・実装
・Tips
どう実装するのか?
そのまえに。。。
実装する、その前に。。
• Complicationで使う用語の解説
• CLKImageProvider,CLKTextProviderと
CLKComplicationTemplate
• TimeLineと
CLKComplicationTemplateEntry
CLKImageProvider,CLKTextProv
iderとCLKComplicationTemplate
• complicationの表示パーツ(PlaceHolder)は、
CLKComplicationTemplateで構成する
• CLKComplicationTemplateの表示情報は、
CLKImageProvider(画像情報)と
CLKTextProvider(文字情報)で作成する
→UIImageとNSStringではない
CLKComplicationTemplate
CLKImageProvider,CLKTextProv
iderとCLKComplicationTemplate
• complicationの表示パーツ(PlaceHolder)は、
CLKComplicationTemplateで構成する
• CLKComplicationTemplateの表示情報は、
CLKImageProvider(画像情報)と
CLKTextProvider(文字情報)で作成する
→UIImageとNSStringではない
画像は
CLKImageProviderで
文字は
CLKTextProviderで
CLKImageProvider
CLKImageProvider
• backgroundImageは必須(foregroundImageは任意)
• 画像はアルファ値のみを参照する
→ユーザがカラーを設定するため
WWDC2015 session 209 creating complication with ClockKit 00:12:14∼
So you can provide a background
image and you provide it as a template image, an image that only contains
alpha information and no color of its own.
It can be -- the pixels can
be whatever color you want, but we are only going to pay
attention to the alpha channel.
• 様々なオプションを持つTextProvider
CLKSimpleTextProvider
CLKTimeTextProvider :(2:15pm etc)
CLKTimeIntervalTextProvider :(11:00am-12:30pm)
CLKDateTextProvider :(Wed,Sep 23; Sep 23 etc)
CLKRelativeDateTextProvider :(+14 DAYS etc)
CLKTextProvider
CLKComplicationTemplate
• CLKComplicationTemplateはCLKTextProviderや
CLKImageProviderによって構成
• 必要なPlaceFolderに応じたTemplateのみ実装
Time Travelと
Time Line
Time Travel
• Degital Crownを回すことで、現在と過去の状
態をcomplicationより確認する機能
Time Line
• complicationの状態を過去から未来まで並べた
もの
Time Line
• complicationの状態を過去から未来まで並べた
もの
• CLKComplicationTemplateを時系列に並べ、
順に参照するもの
Time Line
• complicationの状態を過去から未来まで並べた
もの
• CLKComplicationTemplateを時系列に並べ、
順に参照するもの
• CLKComplicationTemplateに日付情報を付加
し、Arrayで管理
CLKComplicationTemplateとNSDateを合わせて
CLKComplicationTimelineEntryとする
CLKComplicationTimelineEntryをArrayで持つ
では、実装。
• 既存のプロジェクトに、TargetとしてApple
watchを追加
• Product Nameを入力する際に、Include
Complicationにチェックを入れる
• Sample プロジェクトは以下(complication表示)
https://github.com/sohichiro/
complicationBasicSample
・Complicationとは
・実装
・Tips
Tips
• comlicationをタッチすると、アプリが起動する
• watch OS 2 Beta2においてcomplicationにバ
グあり(Known Issue)
• CLKComplicationTimelineEntryは、WCsession
から追加することが可能→iphoneからバックグラ
ウンドでcomplicationを更新することができる
• complicationをリロードするには
reloadTimelineForComplicationを使う
ご静聴
ありがとうございました
参考資料
• WWDC2015
209 Creating Complications with ClockKit
https://developer.apple.com/videos/wwdc/
2015/?id=209

More Related Content

Featured

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Featured (20)

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 

20150707 wwdc21cafe