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
cockscomb
July 11, 2015
Programming
0
810
Force Touch APIs in OS X
Presented at Cocoa勉強会関西62
cockscomb
July 11, 2015
Tweet
Share
More Decks by cockscomb
See All by cockscomb
jq at the Shortcuts
cockscomb
1
2k
GraphQL放談
cockscomb
4
2.1k
GraphQL Highway
cockscomb
28
8.7k
吉田を支える技術
cockscomb
0
2.5k
コーポレートサイトを静的化してAmplify Consoleにデプロイする
cockscomb
0
3.4k
ユーザインターフェイスと非同期処理
cockscomb
5
2k
GUIアプリケーションの構造と設計
cockscomb
10
10k
イカリング2におけるシングルページアプリケーション
cockscomb
2
7.6k
あなたの知らない UIKit の世界 — UITableView に UITextView を置きたい
cockscomb
1
7.6k
Other Decks in Programming
See All in Programming
Claude Codeと2つの巻き戻し戦略 / Two Rewind Strategies with Claude Code
fruitriin
0
130
登壇資料を作る時に意識していること #登壇資料_findy
konifar
4
1.2k
dchart: charts from deck markup
ajstarks
3
990
フロントエンド開発の勘所 -複数事業を経験して見えた判断軸の違い-
heimusu
7
2.8k
Fragmented Architectures
denyspoltorak
0
160
CSC307 Lecture 02
javiergs
PRO
1
780
Basic Architectures
denyspoltorak
0
680
AIによるイベントストーミング図からのコード生成 / AI-powered code generation from Event Storming diagrams
nrslib
2
1.9k
AI巻き込み型コードレビューのススメ
nealle
2
380
CSC307 Lecture 06
javiergs
PRO
0
690
AIフル活用時代だからこそ学んでおきたい働き方の心得
shinoyu
0
140
インターン生でもAuth0で認証基盤刷新が出来るのか
taku271
0
190
Featured
See All Featured
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
196
71k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
310
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.7k
From π to Pie charts
rasagy
0
120
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
0
140
Into the Great Unknown - MozCon
thekraken
40
2.3k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
110
Speed Design
sergeychernyshev
33
1.5k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
96
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?