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
Force Touch APIs in OS X
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
cockscomb
July 11, 2015
Programming
830
0
Share
Force Touch APIs in OS X
Presented at Cocoa勉強会関西62
cockscomb
July 11, 2015
More Decks by cockscomb
See All by cockscomb
jq at the Shortcuts
cockscomb
1
2.1k
GraphQL放談
cockscomb
4
2.1k
GraphQL Highway
cockscomb
28
8.8k
吉田を支える技術
cockscomb
0
2.5k
コーポレートサイトを静的化してAmplify Consoleにデプロイする
cockscomb
0
3.5k
ユーザインターフェイスと非同期処理
cockscomb
5
2k
GUIアプリケーションの構造と設計
cockscomb
10
10k
イカリング2におけるシングルページアプリケーション
cockscomb
2
7.7k
あなたの知らない UIKit の世界 — UITableView に UITextView を置きたい
cockscomb
1
7.6k
Other Decks in Programming
See All in Programming
デフォルト運用のCodeRabbit、1年で何が変わったか / How CodeRabbit Changed Our Code Review in 1 Year
bake0937
1
110
ReactとSvelteのその先、Ripple-TS / Beyond React and Svelte: Ripple-TS
ssssota
3
1.5k
Spec-Driven Development with AI-Agents: From High-Level Requirements to Working Software
antonarhipov
2
380
Java × distroless で 軽量なコンテナイメージを / Java on Distroless
contour_gara
0
380
TypeSpec で繋ぐ複数プロダクトの型安全
maroon8021
1
260
AI駆動開発で崩れていくコードベースを立て直す
kyoko_nr_nr
1
390
Talking to terminals (and how they talk back) (KotlinConf 2026)
jakewharton
PRO
1
150
AIエージェントと協働するCLI開発 — BunとOpenClawで学んだこと
yoshikouki
1
220
色即是空、空即是色、データサイエンス
kamoneggi
1
200
技術記事、AIに書かせるか、自分で書くか? 〜それでも私が自分の手で書く理由〜 / #QiitaConference
jnchito
2
1.2k
権限チェックの一貫性を型で守る TypeScript による多層防御
mnch
4
920
~ 秘伝のタレ化した『神スプシ』と戦う ~ 関数型パラダイムで壊れない仕組みへ
h0r15h0
1
140
Featured
See All Featured
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.3k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
840
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.5k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
300
Designing Powerful Visuals for Engaging Learning
tmiket
1
380
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
BBQ
matthewcrist
89
10k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
380
Crafting Experiences
bethany
1
160
sira's awesome portfolio website redesign presentation
elsirapls
0
260
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
61
44k
AI: The stuff that nobody shows you
jnunemaker
PRO
7
660
Transcript
Force Touch The New Dimension
cockscomb
None
Force Touch The New Dimension
Force Touch Trackpad
Force Touch APIs
None
NSButton • func setButtonType(_ aType: NSButtonType) • NSAcceleratorButton • NSMultiLevelAcceleratorButton
NSAcceleratorButton @IBOutlet weak var acceleratorButton: NSButton! { didSet { acceleratorButton.continuous
= true acceleratorButton .setPeriodicDelay(0.1, interval: 0.1) } } @IBAction func accelerate(sender: AnyObject) { if let button = sender as? NSButton { print(button.doubleValue) } }
NSMultiLevelAcceleratorButton @IBOutlet weak var multiLevelAcceratorButton: NSButton! { didSet { if
#available(OSX 10.10.3, *) { multiLevelAcceratorButton .maxAcceleratorLevel = 5 } } } @IBAction func multiLevelAccelerate(sender: AnyObject) { if let button = sender as? NSButton { print(button.integerValue) } }
NSButton • NSAcceleratorButton • doubleValue • 0.0, 1.0..<2.0 • NSMultiLevelAcceleratorButton
• integerValue • 0, 1, 2..<maxAcceleratorLevel
NSEvent • NSView • NSGestureRecognizer • NSWindow
NSEventTypePressure class PressureView: NSView { override func pressureChangeWithEvent(event: NSEvent) {
Swift.print("Pressure : \(event.pressure)") if #available(OSX 10.10.3, *) { Swift.print("Stage : \(event.stage)") Swift.print(“State Transition : \(event.stageTransition)") } } }
NSEvent • NSEventTypePressure • var pressure: Float { get }
• Pressure value • var stage: Int { get } • Pressed stage • var stageTransition: CGFloat { get } • For transition animation
El Capitan • NSAlignmentFeedbackFilter • Sample Code: AlignmentGuides • NSHapticFeedbackManager
• enum NSHapticFeedbackPattern • Generic/Alignment/LevelChange • And more…
Force Touch • A new dimension of the UI •
APIs are available (improved with El Capitan) • Will be introduced into iOS 9?