-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy path205 Creating Extensions for iOS and OS X, Part 1.srt
More file actions
4097 lines (3231 loc) · 77.9 KB
/
205 Creating Extensions for iOS and OS X, Part 1.srt
File metadata and controls
4097 lines (3231 loc) · 77.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1
00:00:20,078 --> 00:00:21,140
hello
2
00:00:22,004 --> 00:00:24,081
I'm Ian Baird I was frameworks engineer
3
00:00:25,017 --> 00:00:28,136
and today I'm here to tell you about
creating extensions
4
00:00:28,289 --> 00:00:33,720
for Iowa's and OS 10 gonna lay out a
quick agenda for today's stock
5
00:00:33,072 --> 00:00:36,114
first we're going to talk about
extensions an extension points
6
00:00:37,014 --> 00:00:40,080
then I'm going to invite my colleague
Matt Campbell
7
00:00:40,008 --> 00:00:44,014
from the Notification Center team to the
stage to tell you more
8
00:00:44,086 --> 00:00:49,087
and show you more about creating one of
the hottest new tickets at BBC 14
9
00:00:49,096 --> 00:00:54,105
today extensions
10
00:00:55,086 --> 00:00:58,089
and then following on from that we're
going to invite
11
00:00:58,089 --> 00:01:01,188
our colleague I forton onto the stage
12
00:01:01,989 --> 00:01:04,989
to tell you more about how to create
share extensions
13
00:01:04,989 --> 00:01:08,060
like the one you saw in the keynote with
Pinterest
14
00:01:08,006 --> 00:01:11,855
moving on
15
00:01:11,909 --> 00:01:15,640
water extensions well extensions
16
00:01:15,064 --> 00:01:18,142
are almost like it's a way for you
17
00:01:19,042 --> 00:01:23,113
to extend the system and other
applications
18
00:01:24,013 --> 00:01:27,031
it's almost like more surface area for
you to be able to apply
19
00:01:27,031 --> 00:01:30,510
bits and pieces have your app as you can
see here
20
00:01:30,789 --> 00:01:34,570
we have a screenshot at the Apple
homepage on an iPad
21
00:01:34,057 --> 00:01:37,060
showing the new activity view controller
22
00:01:37,006 --> 00:01:40,092
you'll notice a lot of familiar faces a
lot of familiar icons
23
00:01:41,046 --> 00:01:44,070
in that activity view controller you can
see messages male
24
00:01:44,007 --> 00:01:47,014
and we have a new one the butterfly
25
00:01:47,077 --> 00:01:50,120
and butterflies sharing extension you
can see it at home
26
00:01:51,002 --> 00:01:54,040
right there with its brother in right in
the midst
27
00:01:54,058 --> 00:02:00,217
at the sharing extensions and we also
support sharing extensions on LSN
28
00:02:00,739 --> 00:02:04,170
in see we have the butterfly sherry
extension on Yosemite
29
00:02:04,017 --> 00:02:08,696
we support Notification Center
extensions
30
00:02:08,849 --> 00:02:12,750
also known as today extensions and as
you can see
31
00:02:12,075 --> 00:02:15,133
notification extensions are really good
forgiving you
32
00:02:16,033 --> 00:02:19,105
at a glance information something where
you just wanna pull your phone
33
00:02:20,005 --> 00:02:23,092
out your pocket take a quick look checks
in sports scores
34
00:02:23,092 --> 00:02:26,187
may be traffic conditions the weather
and put it back in your pocket
35
00:02:27,087 --> 00:02:31,128
gives you at a glance quick access to
information you want
36
00:02:32,028 --> 00:02:35,080
and of course we support this on your
seventy
37
00:02:35,008 --> 00:02:39,057
and you can see it looks gorgeous
blended right over that new background
38
00:02:39,849 --> 00:02:42,860
is just beautiful stunningly beautiful
team did a great job
39
00:02:42,959 --> 00:02:46,290
next
40
00:02:46,029 --> 00:02:50,050
I want to show you the custom action
extensions you can see here
41
00:02:50,005 --> 00:02:53,010
we have our new annotate image extension
which I'm gonna show you how to build
42
00:02:54,000 --> 00:02:54,629
tomorrow
43
00:02:54,629 --> 00:02:58,250
right in that role with actions actions
can be
44
00:02:58,025 --> 00:03:01,119
you I in nine you I actions as you saw
with the Bing translate extension
45
00:03:02,019 --> 00:03:06,076
and we support custom actions on the
west end as well as a matter fact this
46
00:03:06,076 --> 00:03:06,108
is
47
00:03:07,008 --> 00:03:10,057
the infrastructure for the markup
extension
48
00:03:10,057 --> 00:03:13,109
on a west and you'll notice is a very
common theme
49
00:03:14,009 --> 00:03:17,065
we're sharing infrastructure we're
making it easy for you to build things
50
00:03:17,065 --> 00:03:18,119
for both platforms
51
00:03:19,019 --> 00:03:22,102
next on Iowa s only
52
00:03:23,002 --> 00:03:26,046
we have the I the photo extensions now
53
00:03:26,046 --> 00:03:29,046
if there's a photo filter that you've
been missing
54
00:03:29,046 --> 00:03:33,047
I don't know maybe arm or an annotation
55
00:03:33,047 --> 00:03:36,113
extension you would like to make for
photos you can build it now
56
00:03:37,013 --> 00:03:42,110
right into the photos you why this is
really cool we also support
57
00:03:43,001 --> 00:03:46,013
document providers document providers
bring
58
00:03:46,022 --> 00:03:50,079
storage and things like that from the
cloud writing and applications
59
00:03:50,079 --> 00:03:53,154
incited by a last this is our first it
really breaks down a lot of barriers
60
00:03:54,054 --> 00:03:55,145
that we've all been living with for
61
00:03:56,045 --> 00:04:03,045
a I believe 7 releases and next I want
to tell you about a finder extensions
62
00:04:03,068 --> 00:04:06,145
finder extensions are really cool in the
past if you wanted to be able to bad
63
00:04:07,045 --> 00:04:07,048
sure
64
00:04:07,075 --> 00:04:10,091
annotate items and folders inside the
Finder
65
00:04:10,091 --> 00:04:13,140
you may have to resort to super sketchy
behavior
66
00:04:13,959 --> 00:04:17,027
like mocking jay act or or some sort of
hackery
67
00:04:17,639 --> 00:04:20,705
and now you don't have to do that now
you actually have a supported way
68
00:04:21,299 --> 00:04:24,336
to daj items in the Finder and we think
this is really cool
69
00:04:24,669 --> 00:04:28,694
and then
70
00:04:28,919 --> 00:04:31,970
the last but not least third-party
keyboards
71
00:04:31,097 --> 00:04:34,606
were supporting third-party keyboards in
I'll ask now
72
00:04:35,479 --> 00:04:42,330
using extensions so I told you about
extensions and some the extension point
73
00:04:42,033 --> 00:04:43,122
so we're offering
74
00:04:43,419 --> 00:04:48,520
NIOS and a West and next I'd like to
tell you about delivering extensions
75
00:04:48,052 --> 00:04:51,083
extensions are delivered as part of your
up known as
76
00:04:51,083 --> 00:04:54,116
the extension container an extension
container
77
00:04:55,016 --> 00:04:58,063
petain many different types extensions
78
00:04:58,063 --> 00:05:01,111
for example it could contain today view
which it
79
00:05:02,011 --> 00:05:06,014
it contain sharing extension and it
could also contain
80
00:05:06,041 --> 00:05:09,065
maybe multiple custom action extensions
81
00:05:09,065 --> 00:05:12,194
they're all bound up with in your
applications bundle
82
00:05:12,779 --> 00:05:16,770
and delivered via the App Store
83
00:05:16,077 --> 00:05:20,116
extension points wife talked a little
bit but dow extension points earlier
84
00:05:20,809 --> 00:05:23,853
well tell tell you what they are
extension points again are the new
85
00:05:24,249 --> 00:05:27,306
bits and pieces have surface area that
we've exposed on the system
86
00:05:27,819 --> 00:05:31,150
for your extensions to bind to you for
example
87
00:05:31,015 --> 00:05:34,083
a today view widget binds to the
Notification Center
88
00:05:34,083 --> 00:05:37,352
via the Notification Center extension 30
today view
89
00:05:38,099 --> 00:05:41,136
extension point this means you're never
going to see
90
00:05:41,469 --> 00:05:46,544
it. debut extension any activity view
controller for example
91
00:05:47,219 --> 00:05:51,050
and one thing to remember about all
extensions is that their purpose
92
00:05:51,005 --> 00:05:54,071
build binaries see these are not aP's
these are not even
93
00:05:54,071 --> 00:05:58,076
at apiece if your app it's not a special
mode that we launcher app and
94
00:05:59,021 --> 00:06:02,030
it's a special purpose binary it has its
own
95
00:06:02,219 --> 00:06:05,238
code signature has its own set of
entitlements
96
00:06:05,409 --> 00:06:09,413
and it has own container Damien's going
to speak to this further in tomorrow's
97
00:06:09,449 --> 00:06:11,360
session
98
00:06:11,036 --> 00:06:14,145
so as I said they're not outs and
they're always
99
00:06:14,469 --> 00:06:19,050
accessed via Apple frameworks code you
never really direct we launched an apple
100
00:06:19,005 --> 00:06:20,084
frameworks code
101
00:06:20,129 --> 00:06:23,195
is in charge of discovering them for you
and providing usually the user
102
00:06:23,789 --> 00:06:27,810
interaction by which their launch in all
talk about that later
103
00:06:27,999 --> 00:06:31,770
and as I was talking with the developer
at lunch about this right before we came
104
00:06:31,077 --> 00:06:32,161
here these are not facilitating
105
00:06:33,061 --> 00:06:36,300
app to app my PC you don't get like
106
00:06:36,849 --> 00:06:40,915
a pipe back to the containing out for
your extension be able to talk to it
107
00:06:41,509 --> 00:06:45,512
if you want to build workflows that
incorporate apk app by PC you can still
108
00:06:45,539 --> 00:06:46,610
use things like
109
00:06:46,061 --> 00:06:49,550
UI application open /url but
110
00:06:50,099 --> 00:06:53,193
what I would ask you to do is reconsider
some these workflows that you had before
111
00:06:54,039 --> 00:06:55,064
that involved
112
00:06:55,289 --> 00:06:58,386
sort of contextually switching from one
application to another on a user's phone
113
00:06:59,259 --> 00:07:02,358
and reconsider casting this may be in
terms of custom actions which are really
114
00:07:03,249 --> 00:07:07,580
the spiritual successors to you services
115
00:07:07,058 --> 00:07:12,037
so next what our extension points a very
high level they mark extensible parts in
116
00:07:12,559 --> 00:07:13,564
the system
117
00:07:14,059 --> 00:07:17,860
they're always packaged in system
frameworks we don't support
118
00:07:17,086 --> 00:07:20,605
third-party extension points and they
combine
119
00:07:21,379 --> 00:07:25,383
API and policies you can imagine again
with the to debut aged
120
00:07:25,419 --> 00:07:29,437
the today be widget its it's very simple
it's largely is Matt's going to tell you
121
00:07:29,599 --> 00:07:32,664
a view controller but this view
controller also comes with its own
122
00:07:33,249 --> 00:07:34,265
policy
123
00:07:34,409 --> 00:07:38,110
policy which incorporates things like
launch characteristics
124
00:07:38,011 --> 00:07:42,052
an important thing to remember about
extensions most extensions on the system
125
00:07:42,052 --> 00:07:45,341
are bound 121 with our hosting ap
126
00:07:45,809 --> 00:07:50,110
so let me give you an example of this
what say you write a sharing extension
127
00:07:50,011 --> 00:07:53,340
and the sharing extension is invoked in
Safari
128
00:07:53,439 --> 00:07:57,330
instanceof your extension a new process
is going to be spun up
129
00:07:57,033 --> 00:08:00,058
to serve Safari now to use our homes out
130
00:08:00,058 --> 00:08:03,137
goes over to mail and large is your
extension again
131
00:08:03,659 --> 00:08:08,550
but say maybe to share an attachment a
brand new process is going to be spun up
132
00:08:08,055 --> 00:08:12,374
four-year extension those processes are
not going to share address spaces
133
00:08:12,869 --> 00:08:16,210
this protects you from mistakes your
code if you're still using Objective C
134
00:08:16,021 --> 00:08:18,510
in you have a while pointer or something
like that
135
00:08:18,699 --> 00:08:21,740
you're not going to be able to bring
down all the instances have your
136
00:08:21,074 --> 00:08:21,983
extension
137
00:08:22,649 --> 00:08:26,687
that are running on the system it's
really cool
138
00:08:27,029 --> 00:08:30,093
the extension point also governs the
presentation have your extension
139
00:08:30,669 --> 00:08:34,140
important thing to remember is that you
extensions are you I view controllers
140
00:08:34,014 --> 00:08:35,843
you can hear this multiple times today
141
00:08:35,969 --> 00:08:39,760
but you are you controllers can be
expose the user in multiple ways
142
00:08:39,076 --> 00:08:43,285
and usually since extensions live inside
the applique inside the user interface
143
00:08:43,969 --> 00:08:45,960
another application
144
00:08:45,096 --> 00:08:49,151
its up to that application up to the
system as to how it decides present you
145
00:08:50,051 --> 00:08:53,070
you can either be contained or presented
146
00:08:53,529 --> 00:08:56,880
Notification Center widgets to debut
extensions
147
00:08:56,088 --> 00:09:01,110
are contained while sharing extensions
are presented
148
00:09:02,001 --> 00:09:06,004
and many extension points support for a
few extension point support
149
00:09:06,013 --> 00:09:10,060
view controller and non view controller
variance at the extension point
150
00:09:10,006 --> 00:09:13,055
for instance custom actions as you'll
see tomorrow
151
00:09:13,649 --> 00:09:17,580
support a view controller variant which
allows the user to interact with the
152
00:09:17,058 --> 00:09:20,092
content before it's transformed and sent
back to the host
153
00:09:20,092 --> 00:09:23,170
as you saw during the keynote when Craig
capped the Bing translate extension
154
00:09:24,007 --> 00:09:27,093
there was no UI and that was in non-fuel
extension and we'll tell you more about
155
00:09:28,056 --> 00:09:30,129
that later
156
00:09:31,029 --> 00:09:34,074
cell how extensions and felt this is
again
157
00:09:34,074 --> 00:09:37,079
going back to our example the show you
what happens
158
00:09:37,079 --> 00:09:40,143
when user decides to tap on the
butterfly sharing extension
159
00:09:41,043 --> 00:09:46,043
user taps and the extension host which
is safari at this time
160
00:09:46,043 --> 00:09:49,106
goes and talks to the Notification
Center framework
161
00:09:50,006 --> 00:09:53,025
the notification sorry not notification
the social framework
162
00:09:53,025 --> 00:09:56,112
and the social framework goes and
discovers and loads and presents the
163
00:09:57,012 --> 00:09:58,016
extension
164
00:09:58,016 --> 00:10:01,069
you'll notice that Safari is not
directly
165
00:10:01,069 --> 00:10:05,073
watching the extension at any point its
balancing through Apple frameworks to do
166
00:10:05,073 --> 00:10:06,742
this
167
00:10:07,399 --> 00:10:12,430
so in summary extensions are small
pieces the functionality
168
00:10:12,043 --> 00:10:16,046
their purpose built to do one thing and
get out the way
169
00:10:16,073 --> 00:10:19,110
they stand the system in New an
interesting ways
170
00:10:20,001 --> 00:10:24,001
we can't wait to see what you guys do
with these things
171
00:10:24,001 --> 00:10:28,032
and a mark extendable parse the system
as I said new surface area for you to
172
00:10:28,041 --> 00:10:29,137
attach the functionality of your app
173
00:10:30,037 --> 00:10:33,100
interesting and meaningful ways for our
users
174
00:10:34,000 --> 00:10:37,004
and now to tell you more about
Notification Center extensions
175
00:10:37,004 --> 00:10:44,004
I'd like to invite my colleague not
gamble to the stage
176
00:10:47,003 --> 00:10:51,852
hello I'm at Campbell Newman engineer in
the I US notifications team
177
00:10:52,149 --> 00:10:55,162
and today I'm a tell you about
Notification Center extensions
178
00:10:55,279 --> 00:11:00,290
widgets as we call them now we've had
widgets in some fashion on the
179
00:11:00,389 --> 00:11:03,860
system for a while now but for the first
time
180
00:11:03,086 --> 00:11:07,086
you know I was 8 we're giving developers
the power to add their own content to
181
00:11:07,086 --> 00:11:11,545
the notification centers today view
182
00:11:12,319 --> 00:11:16,310
now perhaps most fundamentally widgets
are view controllers
183
00:11:16,031 --> 00:11:19,730
so that means everything you know about
you controllers including the life cycle
184
00:11:20,009 --> 00:11:22,000
in containment behavior in API
185
00:11:22,000 --> 00:11:25,129
will serve you well when you're
constructing your widget
186
00:11:25,129 --> 00:11:28,230
for example the appearance calls these
I'll tell you when
187
00:11:28,023 --> 00:11:31,882
your widget is coming and going in the
Notification Center
188
00:11:32,089 --> 00:11:35,910
in a particular interest is you will
appear as you want to be sure that your
189
00:11:35,091 --> 00:11:35,750
view is
190
00:11:36,569 --> 00:11:39,626
up and ready to be used by the user by
the time you're returning from you will
191
00:11:40,139 --> 00:11:41,178
appear
192
00:11:41,529 --> 00:11:45,558
so speedy have getting ready it's
important to get ready fast performance
193
00:11:45,819 --> 00:11:49,740
the very big consideration with
notification center widgets
194
00:11:49,074 --> 00:11:53,483
so couple tips are be sure to load cache
data so you're bringing up your view
195
00:11:54,149 --> 00:11:55,210
quickly and ready to go
196
00:11:55,759 --> 00:12:01,190
and if you have some new data comes in
you can do your own custom transition
197
00:12:01,019 --> 00:12:04,718
also kick off your expensive operations
as early as possible
198
00:12:04,889 --> 00:12:09,750
and definitely in the background and
when those expensive operations return
199
00:12:09,075 --> 00:12:13,284
be sure to cash this data
200
00:12:13,959 --> 00:12:17,045
so layout is another concern are of
course your widgets in your
201
00:12:17,819 --> 00:12:22,850
your widget has control over its sub the
hierarchy in laying all your content out
202
00:12:23,129 --> 00:12:26,205
but just as with any other parent child
you control your relationship
203
00:12:26,889 --> 00:12:30,230
the Notification Center will be laying
out your views
204
00:12:30,023 --> 00:12:33,074
frame so that means that the
notification center is setting
205
00:12:33,074 --> 00:12:36,723
the frames you don't set your own widget
views frame
206
00:12:37,389 --> 00:12:40,970
but of course not all content is created
equal so
207
00:12:40,097 --> 00:12:43,104
if you might have need some more room
for your content
208
00:12:44,067 --> 00:12:47,069
you can indicate your preferred height
209
00:12:47,087 --> 00:12:50,142
you do this in two ways the for sister
on a layup
210
00:12:51,042 --> 00:12:54,066
if you can are described your Widgets
211