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
The ownership in iOS
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Yuji Taniguchi
April 20, 2018
Programming
370
0
Share
The ownership in iOS
Yuji Taniguchi
April 20, 2018
More Decks by Yuji Taniguchi
See All by Yuji Taniguchi
Zeroconf on iOS
natpenguin
2
1.3k
Zero Configuration
natpenguin
1
240
Other Decks in Programming
See All in Programming
[PHPerKaigi 2026]PHPerKaigi2025の企画CodeGolfが最高すぎて社内で内製して半年運営して得た内製と運営の知見
ikezoemakoto
0
310
Migration to Signals, Signal Forms, Resource API, and NgRx Signal Store @Angular Days 03/2026 Munich
manfredsteyer
PRO
0
200
野球解説AI Agentを開発してみた - 2026/02/27 LayerX社内LT会資料
shinyorke
PRO
0
380
KagglerがMixSeekを触ってみた
morim
0
360
おれのAgentic Coding 2026/03
tsukasagr
1
120
PHP でエミュレータを自作して Ubuntu を動かそう
m3m0r7
PRO
2
150
Java 21/25 Virtual Threads 소개
debop
0
310
GoのDB アクセスにおける 「型安全」と「柔軟性」の両立 - Bob という選択肢
tak848
0
290
モックわからないマン卒業記 ~振る舞いを起点に見直した、フロントエンドテストにおけるモックの使いどころ~
tasukuwatanabe
3
430
CS教育のDX AIによる育成の効率化
niftycorp
PRO
0
170
年間50登壇、単著出版、雑誌寄稿、Podcast出演、YouTube、CM、カンファレンス主催……全部やってみたので面白さ等を比較してみよう / I’ve tried them all, so let’s compare how interesting they are.
nrslib
4
580
Ruby and LLM Ecosystem 2nd
koic
1
1.4k
Featured
See All Featured
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
94
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
340
Crafting Experiences
bethany
1
100
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.2k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
64
54k
How to build a perfect <img>
jonoalderson
1
5.3k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.6k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
120
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Thoughts on Productivity
jonyablonski
75
5.1k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Transcript
The ownership in iOS Mixleap #11 in Osaka
@_natpenguin merpay iOS Software Engineer
@_natpenguin merpay iOS Software Engineer .filter { $0 == }
.map { $0 + } + [ , ✨ ] =
What is ownership?
It’s a management system for resource
It’s abstract word…
Ownership system is already used
Rust/C++/Swift… Ownership system is already used
Why we need ownership system?
None
- Speed
- Safety - Speed
- Safety - Speed - Concurrency
Safety
- Access conflict to Data Rust prevents these in compiling
- Access conflict to Data Rust prevents these in compiling
- Using after releasing resource
fn main() { let x = vec![1, 2, 3]; let
y = x; println!(“x[0] is {}", x[0]); } This code will be compiling error
fn main() { let x = vec![1, 2, 3]; take(x);
println!(“x[0] is {}", x[0]); } fn take(v: Vec<i32>) { // do something } This code will be compiling error
fn main() { let mut x = &100; let mut
y = &mut x; *y += 1; println!(“y is {}", y); } This code will be compiling error
It’s a difficult
None
Manifesto https://github.com/apple/swift/blob/master/docs/OwnershipManifesto.md
Q. What does swift want by using it?
A. Improving performance Q. What does swift want by using
it?
- Making extra copies at runtime Problem Point
- Making extra copies at runtime - Referencing to unique
resource Problem Point
- Making extra copies at runtime - Referencing to unique
resource - Overhead of reference count Problem Point
Point - Prevents simultaneously accessing to Data
Point - Prevents simultaneously accessing to Data - Give programmers
more control
Point - Prevents simultaneously accessing to Data - Give programmers
more control - Add types that can’t be implicitly copied
A1. Supporting a type that can’t copy Q. How does
swift improve performance?
A1. Supporting a type that can’t copy Q. How does
swift improve performance? A2. Law of exclusivity
New keywords - shared
func ==(left: shared String, right: shared String) -> Bool {
... } shared String isn’t copied
What is different with inout?
- shared - inout
New keywords - shared - moveonly
moveonly struct Foo { // some parameters }
moveonly extension Foo { // Some extensions }
extension Foo { moveonly func bar<U>(_ u: U) }
moveonly struct File { let descriptor: Int32 init(filename: String) throws
{ descriptor = Darwin.open(filename, O_RDONLY) } deinit { _ = Darwin.close(descriptor) } }
When we use it? - Performance tuning
When we use it? - More memory management - Performance
tuning
When we use it? - More memory management - Performance
tuning - Already know that no needed to copy
Thank you so much!