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
800
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
1.9k
GraphQL放談
cockscomb
4
2k
GraphQL Highway
cockscomb
28
8.5k
吉田を支える技術
cockscomb
0
2.4k
コーポレートサイトを静的化してAmplify Consoleにデプロイする
cockscomb
0
3.4k
ユーザインターフェイスと非同期処理
cockscomb
5
1.9k
GUIアプリケーションの構造と設計
cockscomb
10
10k
イカリング2におけるシングルページアプリケーション
cockscomb
2
7.6k
あなたの知らない UIKit の世界 — UITableView に UITextView を置きたい
cockscomb
1
7.5k
Other Decks in Programming
See All in Programming
Kiroで始めるAI-DLC
kaonash
2
530
Swift Updates - Learn Languages 2025
koher
2
420
MLH State of the League: 2026 Season
theycallmeswift
0
210
AI時代のドメイン駆動設計-DDD実践におけるAI活用のあり方 / ddd-in-ai-era
minodriven
25
9.7k
MCPとデザインシステムに立脚したデザインと実装の融合
yukukotani
4
1.2k
時間軸から考えるTerraformを使う理由と留意点
fufuhu
12
4.1k
「手軽で便利」に潜む罠。 Popover API を WCAG 2.2の視点で安全に使うには
taitotnk
0
640
CSC305 Summer Lecture 12
javiergs
PRO
0
130
Improving my own Ruby thereafter
sisshiki1969
1
150
TDD 実践ミニトーク
contour_gara
1
280
Oracle Database Technology Night 92 Database Connection control FAN-AC
oracle4engineer
PRO
1
390
OSS開発者という働き方
andpad
5
1.7k
Featured
See All Featured
Rails Girls Zürich Keynote
gr2m
95
14k
Designing Experiences People Love
moore
142
24k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
51
5.6k
The Art of Programming - Codeland 2020
erikaheidi
55
13k
Imperfection Machines: The Place of Print at Facebook
scottboms
268
13k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
185
54k
How to Ace a Technical Interview
jacobian
279
23k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
358
30k
Git: the NoSQL Database
bkeepers
PRO
431
66k
Done Done
chrislema
185
16k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
33
2.4k
Code Review Best Practice
trishagee
70
19k
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?