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
770
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.5k
GraphQL放談
cockscomb
4
1.8k
GraphQL Highway
cockscomb
27
7.8k
吉田を支える技術
cockscomb
0
1.9k
コーポレートサイトを静的化してAmplify Consoleにデプロイする
cockscomb
0
3.3k
ユーザインターフェイスと非同期処理
cockscomb
5
1.6k
GUIアプリケーションの構造と設計
cockscomb
10
9.8k
イカリング2におけるシングルページアプリケーション
cockscomb
2
7.2k
あなたの知らない UIKit の世界 — UITableView に UITextView を置きたい
cockscomb
1
7.1k
Other Decks in Programming
See All in Programming
Fast JSX: Don't clone props object #28768
yossydev
1
150
"config" ってなんだ? / What is "config"?
okashoi
0
240
Behind VS Code Extensions for JavaScript / TypeScript Linnting and Formatting
unvalley
5
1.1k
#phpcon_odawara オープン・クローズドなテストフィクスチャを求めて / open closed test fixtures
77web
3
230
Scalable Customer Journey Orchestration (CJO)
lewuathe
0
370
Prepare for Jakarta EE 11 - Performance and Developer Productivity
ivargrimstad
0
940
Ruby GitHub Packages
bkuhlmann
0
630
冗長なエラーログを削減し、スタックトレースを手に入れる / Reducing Verbose Error Logs and Obtaining Stack Traces
upamune
0
890
Snowflakeで眠ったデータを起こそう!
estie
0
120
スキーマ駆動開発による品質とスピードの両立 - 私達は何故、スキーマを書くのか
kentaroutakeda
0
170
AWS CDKコントリビュートTIPS / aws-cdk-contribution-tips
gotok365
3
280
障害対応を起点としたもっといい開発と運用のサイクル作りのためにできること / Hatena Enginner Seminar #29
polamjag
0
270
Featured
See All Featured
Fontdeck: Realign not Redesign
paulrobertlloyd
76
4.9k
The Power of CSS Pseudo Elements
geoffreycrofte
61
5k
WebSockets: Embracing the real-time Web
robhawkes
59
7k
The Cost Of JavaScript in 2023
addyosmani
17
3.9k
No one is an island. Learnings from fostering a developers community.
thoeni
16
2.1k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
155
14k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
275
13k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
41
4.4k
BBQ
matthewcrist
80
8.8k
Large-scale JavaScript Application Architecture
addyosmani
504
110k
Design by the Numbers
sachag
274
18k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
8
1.5k
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?