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
Mockable UserDefaults with Duck typing
Search
417.72KI
June 18, 2019
Programming
0
980
Mockable UserDefaults with Duck typing
417.72KI
June 18, 2019
Tweet
Share
More Decks by 417.72KI
See All by 417.72KI
Reboot a personal app abandoned for 10 years with recent techs
417_72ki
0
46
iTunes・おぼえていますか〜ScriptingBridge今昔物語〜
417_72ki
1
42
The history of entry-point in iOS app Development
417_72ki
0
410
R.swift to Asset Symbols
417_72ki
0
300
Refactor with using `available` and `deprecated`
417_72ki
3
650
CLIツールにSwift Concurrencyを適用させようとしている話
417_72ki
3
430
CI with Danger-Swift
417_72ki
1
210
Graduation from Playground beginner
417_72ki
3
930
Trap Questions in Java and Obj-C
417_72ki
1
300
Other Decks in Programming
See All in Programming
List とは何か? / PHPerKaigi 2025
meihei3
0
560
Preact、HooksとSignalsの両立 / Preact: Harmonizing Hooks and Signals
ssssota
1
740
リアクティブシステムの変遷から理解するalien-signals / Learning alien-signals from the evolution of reactive systems
yamanoku
2
1k
ミリしらMCP勉強会
watany
3
430
新卒から4年間、20年もののWebサービスと 向き合って学んだソフトウェア考古学
oguri
8
6.8k
snacks.nvim内のセットアップ不要なプラグインを紹介 / introduce_snacks_nvim
uhooi
0
350
いまさら聞けない生成AI入門: 「生成AIを高速キャッチアップ」
soh9834
12
3.8k
Going Structural with Named Tuples
bishabosha
0
170
Modern Angular:Renovation for Your Applications @angularDays 2025 Munich
manfredsteyer
PRO
0
140
複雑なフォームと複雑な状態管理にどう向き合うか / #newt_techtalk vol. 15
izumin5210
4
3.3k
Day0 初心者向けワークショップ実践!ソフトウェアテストの第一歩
satohiroyuki
0
430
Coding Experience Cpp vs Csharp - meetup app osaka@9
harukasao
0
120
Featured
See All Featured
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
118
51k
VelocityConf: Rendering Performance Case Studies
addyosmani
328
24k
Java REST API Framework Comparison - PWX 2021
mraible
29
8.5k
The Language of Interfaces
destraynor
157
24k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.5k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
177
52k
4 Signs Your Business is Dying
shpigford
183
22k
Git: the NoSQL Database
bkeepers
PRO
429
65k
The Invisible Side of Design
smashingmag
299
50k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
135
33k
KATA
mclloyd
29
14k
Building an army of robots
kneath
304
45k
Transcript
.PDLBCMF6TFS%FGBVMUT XJUI %VDLUZQJOH QPUBUPUJQT
struct Me { let name = "Takuhiro Muta" let aka
= "417.72KI" let experienceYears = 5 let company = "iRidge inc." let twitter = "417_72ki" let qiita = "417_72ki" let gitHub = "417-72KI" let products = [ "BuildConfig.swift", "MockUserDefaults", ] } TFMGEFTDSJQUJPO
%VDL5ZQJOH
%VDL5ZQJOH w 0OFPGUIFNFUIPETUPJNQMFNFOU QPMZNPSQIJTN w 6TFEJOEZOBNJDMBOHVBHFT FH3VCZ 1ZUIPO w
0CKFDUTTVJUBCJMJUZJTEFUFSNJOFECZUIF QSFTFODFPGDFSUBJONFUIPETBOE QSPQFSUJFT w /PUPCKFDU`TPXOUZQF
r%BWF5IPNBT l*GJUXBMLTMJLFBEVDLBOERVBDLTMJLFB EVDL JUNVTUCFBEVDLz
%VDL5ZQJOH class Duck: def walk(self): print("Duck walking") def quack(self): print("Quack!!")
class Dog: def walk(self): print("Dog walking") def bark(self): print("Bark!!") def walk_and_quack(animal): animal.walk() animal.quack()
%VDL5ZQJOH class Duck: def walk(self): print("Duck walking") def quack(self): print("Quack!!")
class Dog: def walk(self): print("Dog walking") def bark(self): print("Bark!!") def walk_and_quack(animal): animal.walk() animal.quack()
%VDL5ZQJOH class Duck: def walk(self): print("Duck walking") def quack(self): print("Quack!!")
class Dog: def walk(self): print("Dog walking") def bark(self): print("Bark!!") def walk_and_quack(animal): animal.walk() animal.quack()
%VDL5ZQJOH class Duck: def walk(self): print("Duck walking") def quack(self): print("Quack!!")
class Dog: def walk(self): print("Dog walking") def bark(self): print("Bark!!") def walk_and_quack(animal): animal.walk() animal.quack()
%VDL5ZQJOH walk_and_quack(Duck()) # Duck walking # Quack!! walk_and_quack(Dog()) # Dog
walking # AttributeError: 'Dog' object has # no attribute 'quack'
*O0CK$ @interface Duck: NSObject - (void)walk; - (void)quack; @end @implementation
Duck - (void)walk { NSLog(@"Duck walking"); } - (void)quack { NSLog(@"Quack!!"); } @end void walkAndQuack(id animal) { [animal walk]; [animal quack]; }
*O0CK$ @interface Duck: NSObject - (void)walk; - (void)quack; @end @implementation
Duck - (void)walk { NSLog(@"Duck walking"); } - (void)quack { NSLog(@"Quack!!"); } @end void walkAndQuack(id animal) { [animal walk]; [animal quack]; }
*O0CK$ @interface Duck: NSObject - (void)walk; - (void)quack; @end @implementation
Duck - (void)walk { NSLog(@"Duck walking"); } - (void)quack { NSLog(@"Quack!!"); } @end void walkAndQuack(id animal) { [animal walk]; [animal quack]; }
*O0CK$ walkAndQuack([Duck new]); // Duck walking // Quack!! walkAndQuack([Dog new]);
// Dog walking // unrecognized selector sent to instance
)PXUPNPDL 6TFS%FGBVMUT
r%BWF5IPNBT l*GJUXBMLTMJLFBEVDLBOERVBDLTMJLFB EVDL JUNVTUCFBEVDLz
l*GJUTBWFTPCKFDUTMJLF6TFS%FGBVMT BOEMPBETPCKFDUTMJLF6TFS%FGBVMUT JUNVTUCF6TFS%FGBVMUTz
%FpOFBMMNFUIPETJO /46TFS%FGBVMUT
%FpOFBMMNFUIPETJO /46TFS%FGBVMUT /PUFYUFOE/46TFS%FGBVMUT
*NQMFNFOU
%FpOFFYUFOTJPOUPVTFJU BT/46TFS%FGBVMUT
%FpOFFYUFOTJPOUPVTFJU BT/46TFS%FGBVMUT
%FpOFFYUFOTJPOUPVTFJU BT/46TFS%FGBVMUT ⁉
None
5IBOLZPV IUUQTHJUIVCDPN,*.PDL6TFS%FGBVMUT