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.6k
吉田を支える技術
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
CSC305 Lecture 11
javiergs
PRO
0
270
Go言語の特性を活かした公式MCP SDKの設計
hond0413
2
520
Goで実践するドメイン駆動開発 AIと歩み始めた新規プロダクト開発の現在地
imkaoru
4
900
Google Opalで使える37のライブラリ
mickey_kubo
3
150
3年ぶりにコードを書いた元CTOが Claude Codeと30分でMVPを作った話
maikokojima
0
640
What's new in Spring Modulith?
olivergierke
1
170
CSC305 Lecture 08
javiergs
PRO
0
280
ALL CODE BASE ARE BELONG TO STUDY
uzulla
28
6.7k
フロントエンド開発のためのブラウザ組み込みAI入門
masashi
7
3.5k
PHPに関数型の魂を宿す〜PHP 8.5 で実現する堅牢なコードとは〜 #phpcon_hiroshima / phpcon-hiroshima-2025
shogogg
1
330
alien-signals と自作 OSS で実現する フレームワーク非依存な ロジック共通化の探求 / Exploring Framework-Agnostic Logic Sharing with alien-signals and Custom OSS
aoseyuu
2
630
Go言語はstack overflowの夢を見るか?
logica0419
0
590
Featured
See All Featured
YesSQL, Process and Tooling at Scale
rocio
173
15k
The Cost Of JavaScript in 2023
addyosmani
55
9.1k
Site-Speed That Sticks
csswizardry
13
920
Rebuilding a faster, lazier Slack
samanthasiow
84
9.2k
Balancing Empowerment & Direction
lara
5
700
The Power of CSS Pseudo Elements
geoffreycrofte
80
6k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Keith and Marios Guide to Fast Websites
keithpitt
411
23k
Being A Developer After 40
akosma
91
590k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Producing Creativity
orderedlist
PRO
347
40k
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?