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.2k
ユーザインターフェイスと非同期処理
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
코틀린으로 멀티플랫폼 만들기
pangmoo
0
140
効率化に挑戦してみたらモバイル開発が少し快適になった話
ryunakayama
0
120
新宿ダンジョンを可視化してみた
satoshi7190
2
170
Javaエンジニアのための Nodejs/Nuxt3入門
hidekatsu_izuno
0
290
Java 22 Overview
kishida
1
180
デフォルトにして至高、RubyMineの大好きな所
ruzia
0
150
OpenAPIを中心に考えるAPI開発入門 / Introduction to API Development with a Focus on OpenAPI
seike460
PRO
2
160
雑に思考を整理する技術と効能
konifar
58
28k
MetricKitで予期せぬ終了を検知する話 / Detect unexpected termination with MetricKit
nekowen
0
180
入門 AWS Amplify Gen2 / Introduction to AWS Amplify Gen2
genkiogasawara
1
320
コーンフレークから始める モデリング会話入門
ogurotakayuki
0
340
エンターテイメント業界で利用されるAWS
demuyan
0
210
Featured
See All Featured
The Invisible Customer
myddelton
114
12k
4 Signs Your Business is Dying
shpigford
175
21k
Testing 201, or: Great Expectations
jmmastey
27
6.3k
Faster Mobile Websites
deanohume
298
30k
From Idea to $5000 a Month in 5 Months
shpigford
377
45k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
13
1.5k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
186
16k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
226
51k
GitHub's CSS Performance
jonrohan
1024
450k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
1
3.4k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
34
8.9k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
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?