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
サービスクラスのありがたみを発見したときの思い出 #phpcon_odawara
77web
4
690
fieldalignmentから見るGoの構造体
kuro_kurorrr
0
110
Building Scalable Mobile Projects: Fast Builds, High Reusability and Clear Ownership
cyrilmottier
2
310
実践Webフロントパフォーマンスチューニング
cp20
36
8.3k
ComposeでのPicture in Picture
takathemax
0
120
Browser and UI #2 HTML/ARIA
ken7253
2
120
Compose Hot Reload is here, stop re-launching your apps! (Android Makers 2025)
zsmb
1
560
状態と共に暮らす:ステートフルへの挑戦
ypresto
3
840
ASP.NETアプリケーションのモダナイゼーションについて
tomokusaba
0
130
ウォンテッドリーの「ココロオドル」モバイル開発 / Wantedly's "kokoro odoru" mobile development
kubode
1
200
タイムゾーンの奥地は思ったよりも闇深いかもしれない
suguruooki
1
740
Jakarta EE Meets AI
ivargrimstad
0
310
Featured
See All Featured
For a Future-Friendly Web
brad_frost
177
9.7k
Six Lessons from altMBA
skipperchong
28
3.7k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
31
1.1k
YesSQL, Process and Tooling at Scale
rocio
172
14k
Producing Creativity
orderedlist
PRO
344
40k
The Power of CSS Pseudo Elements
geoffreycrofte
75
5.8k
GraphQLとの向き合い方2022年版
quramy
46
14k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
104
19k
Git: the NoSQL Database
bkeepers
PRO
430
65k
Designing Experiences People Love
moore
142
24k
The Invisible Side of Design
smashingmag
299
50k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.4k
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?