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.8k
GraphQL放談
cockscomb
4
2k
GraphQL Highway
cockscomb
28
8.4k
吉田を支える技術
cockscomb
0
2.3k
コーポレートサイトを静的化してAmplify Consoleにデプロイする
cockscomb
0
3.4k
ユーザインターフェイスと非同期処理
cockscomb
5
1.8k
GUIアプリケーションの構造と設計
cockscomb
10
10k
イカリング2におけるシングルページアプリケーション
cockscomb
2
7.5k
あなたの知らない UIKit の世界 — UITableView に UITextView を置きたい
cockscomb
1
7.4k
Other Decks in Programming
See All in Programming
「理解」を重視したAI活用開発
fast_doctor
0
180
タイムゾーンの奥地は思ったよりも闇深いかもしれない
suguruooki
1
720
PHPバージョンアップから始めるOSSコントリビュート / how2oss-contribute
dmnlk
1
1.1k
Laravel × Clean Architecture
bumptakayuki
PRO
0
110
Bedrock×MCPで社内ブログ執筆文化を育てたい!
har1101
6
1.1k
AIコーディングワークフローの試行 〜AIエージェント×ワークフローでの自動化を目指して〜
rkaga
3
3.8k
音声プラットフォームのアーキテクチャ変遷から学ぶ、クラウドネイティブなバッチ処理 (20250422_CNDS2025_Batch_Architecture)
thousanda
0
280
Sharing features among Android applications: experience feedback
jbvincey
0
110
一緒に働きたくなるプログラマの思想 #QiitaConference
mu_zaru
71
17k
The Evolution of the CRuby Build System
kateinoigakukun
0
720
AIコーディングの理想と現実
tomohisa
29
34k
Dissecting and Reconstructing Ruby Syntactic Structures
ydah
1
830
Featured
See All Featured
Gamification - CAS2011
davidbonilla
81
5.2k
A better future with KSS
kneath
239
17k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.6k
Fontdeck: Realign not Redesign
paulrobertlloyd
83
5.5k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
41
2.2k
Building Adaptive Systems
keathley
41
2.5k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
670
Practical Orchestrator
shlominoach
186
11k
Scaling GitHub
holman
459
140k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
47
2.7k
Rails Girls Zürich Keynote
gr2m
94
13k
The Power of CSS Pseudo Elements
geoffreycrofte
75
5.8k
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?