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
UTI
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
cockscomb
July 14, 2015
Programming
3.1k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
UTI
Presented at potatotips 19
cockscomb
July 14, 2015
More Decks by cockscomb
See All by cockscomb
jq at the Shortcuts
cockscomb
1
2.1k
GraphQL放談
cockscomb
4
2.1k
GraphQL Highway
cockscomb
28
8.8k
吉田を支える技術
cockscomb
0
2.5k
コーポレートサイトを静的化してAmplify Consoleにデプロイする
cockscomb
0
3.5k
ユーザインターフェイスと非同期処理
cockscomb
5
2k
GUIアプリケーションの構造と設計
cockscomb
10
10k
イカリング2におけるシングルページアプリケーション
cockscomb
2
7.7k
あなたの知らない UIKit の世界 — UITableView に UITextView を置きたい
cockscomb
1
7.6k
Other Decks in Programming
See All in Programming
Copilot CLI の継戦能力を高める コンテキスト管理
nozomutu
1
1.2k
AIチームを指揮するOSS「TAKT」活用術 / How to Use “TAKT,” an OSS Tool for Orchestrating AI Teams
nrslib
6
870
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
8
3.2k
Datadog × OpenTelemetry 入門と実践のあいだ
kn_to_maxpno
1
150
正しくソフトウェアを作る、前提を疑うための認知の視点 / doubt-premise
minodriven
20
6.4k
TAKTでAI駆動開発の品質を設計する
j5ik2o
6
1.1k
Webフレームワークの ベンチマークについて
yusukebe
0
160
スマートグラスで並列バイブコーディング
hyshu
0
120
ADKを使って簡単にAIエージェントを作ってみよう
k1mu21
0
250
Spec Driven Development | AI Summit Lisbon
danielsogl
PRO
0
180
メソッドのジェネリクスでGoの夢は広がるか? / Kyoto.go #65
utgwkk
3
670
軽量Java基盤の設計 DIコンテナに頼らない、長期保守と1秒起動の実現 JJUG CCC 2026 Spring
macha64
0
490
Featured
See All Featured
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.9k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
62
44k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.6k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
310
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
200
Information Architects: The Missing Link in Design Systems
soysaucechin
0
960
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
140
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2k
Making the Leap to Tech Lead
cromwellryan
135
9.9k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
230
Building AI with AI
inesmontani
PRO
1
1.1k
Transcript
UTI
cockscomb
None
None
gion-matsuri.jpg
ion-matsuri.jpg
JPEG
JPEG image/jpeg .jpeg public.jpeg
PNG image/png .png public.png
PNG image/png .png public.png Extension MIME Type UTI
File Types have many representations • Extension — .jpeg •
MIME Type — image/jpeg • UTI — public.jpeg
File Types have many representations • Extension • for file
name • MIME Type • for Internet (Content-Type) • UTI?
Uniform Type Identifier
Uniform Type Identifier • Used inside iOS/OS X • Have
inheritance • public.content/public.data → public.image → public.jpeg
let manager = PHImageManager.defaultManager() manager.requestImageDataForAsset(asset, options: options) { (data, dataUTI,
orientation, info) in // Do something } Get image data from Photos
let manager = PHImageManager.defaultManager() manager.requestImageDataForAsset(asset, options: options) { (data, dataUTI,
orientation, info) in // Do something } Get image data from Photos
UTI → Extension UTTypeCopyPreferredTagWithClass( "public.jpeg", kUTTagClassFilenameExtension ).takeRetainedValue() // jpeg
MIME Type → UTI UTTypeCreatePreferredIdentifierForTag( kUTTagClassMIMEType, "image/jpeg", nil ).takeRetainedValue() //
public.jpeg
MIME Type → Extension func extensionFromMIMEType(MIMEType: String) -> String {
let uti = UTTypeCreatePreferredIdentifierForTag( kUTTagClassMIMEType, MIMEType, nil ).takeRetainedValue() let ext = UTTypeCopyPreferredTagWithClass( uti, kUTTagClassFilenameExtension ).takeRetainedValue() return ext as String } extensionFromMIMEType("image/jpeg")
cockscomb/UTIKit
MIME Type → Extension func extensionFromMIMEType(MIMEType: String) -> String {
let uti = UTTypeCreatePreferredIdentifierForTag( kUTTagClassMIMEType, MIMEType, nil ).takeRetainedValue() let ext = UTTypeCopyPreferredTagWithClass( uti, kUTTagClassFilenameExtension ).takeRetainedValue() return ext as String } extensionFromMIMEType("image/jpeg")
MIME Type → Extension import UTIKit UTI(MIMEType: "image/jpeg").filenameExtension
Create your file type <array> <dict> <key>CFBundleTypeIconFiles</key> <array/> <key>CFBundleTypeName</key> <string>Awesome
File Format</string> <key>LSItemContentTypes</key> <array> <string>info.cockscomb.awesome</string> </array> </dict> </array>
Uniform Type Identifier • Can convert to file extension and
MIME Type • Can be simple to use with UTIKit ✌ • Can be defined your own one
৴ ౭ http://hatenacorp.jp/recruit/