-
Notifications
You must be signed in to change notification settings - Fork 48
/
205.srt
5145 lines (3782 loc) · 112 KB
/
205.srt
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
WEBVTT
X-TIMESTAMP-MAP=MPEGTS:181083,LOCAL:00:00:00.000
00:00:00.506 --> 00:00:16.826 A:middle
[ Silence ]
00:00:17.326 --> 00:00:19.416 A:middle
>> Good afternoon.
00:00:20.646 --> 00:00:20.916 A:middle
[applause] Thank you.
00:00:22.116 --> 00:00:23.826 A:middle
Welcome to What's New in Cocoa.
00:00:23.826 --> 00:00:26.696 A:middle
My name is Ali Ozer, I'm the
director Cocoa Frameworks
00:00:26.696 --> 00:00:27.276 A:middle
at Apple.
00:00:29.256 --> 00:00:30.986 A:middle
So, what are we going
to talk about today?
00:00:31.616 --> 00:00:33.616 A:middle
We're going to give you
a high level overview
00:00:33.616 --> 00:00:38.876 A:middle
of the updates we made to Cocoa
in Mac OS X Mavericks 10.9,
00:00:39.256 --> 00:00:42.336 A:middle
and we're going to give you
pointers to related sessions
00:00:42.336 --> 00:00:45.756 A:middle
and labs because we have
many sessions and labs.
00:00:45.756 --> 00:00:48.696 A:middle
Note that everything we're going
to talk about today is new,
00:00:48.866 --> 00:00:50.986 A:middle
so I'm not going to be
putting this new badge
00:00:50.986 --> 00:00:53.516 A:middle
on every single slide that
has new material on it,
00:00:53.576 --> 00:00:54.896 A:middle
pretty much most things are new.
00:00:54.896 --> 00:00:57.886 A:middle
And this is not a
complete reference
00:00:57.886 --> 00:00:59.866 A:middle
to all the things we've added.
WEBVTT
X-TIMESTAMP-MAP=MPEGTS:181083,LOCAL:00:00:00.000
00:01:00.526 --> 00:01:03.726 A:middle
These are the highlights, we
have Heather file updates,
00:01:03.726 --> 00:01:04.696 A:middle
we have Release Notes,
00:01:04.696 --> 00:01:07.496 A:middle
and in many cases coming
soon we have documentation.
00:01:07.496 --> 00:01:09.916 A:middle
Please refer to those
for the complete story.
00:01:10.476 --> 00:01:13.836 A:middle
OK, first let's talk about Tags,
00:01:14.316 --> 00:01:16.336 A:middle
you saw the feature
yesterday in the Keynote.
00:01:17.086 --> 00:01:20.286 A:middle
Tags is a new feature
which enables users
00:01:20.286 --> 00:01:23.596 A:middle
to assign arbitrarily named
labels to their files.
00:01:25.116 --> 00:01:26.856 A:middle
And users can search
for their files
00:01:26.856 --> 00:01:29.076 A:middle
or group their files
using these Tags.
00:01:29.606 --> 00:01:30.776 A:middle
It's a pretty powerful feature.
00:01:30.776 --> 00:01:32.186 A:middle
Just to recap what
it looks like,
00:01:32.596 --> 00:01:36.096 A:middle
so here is some files
grouped by Tag for instance
00:01:36.096 --> 00:01:40.276 A:middle
that you can see the tags
are shown along the side
00:01:40.276 --> 00:01:41.626 A:middle
and also under the file names.
00:01:42.106 --> 00:01:44.346 A:middle
You can search by
tag as shown here,
00:01:45.086 --> 00:01:47.386 A:middle
you type your search tags
there and you will be displayed
00:01:47.386 --> 00:01:49.906 A:middle
that files with those
tags will be displayed.
00:01:50.266 --> 00:01:54.406 A:middle
You can bring up a side bar
which lists the tags you have.
00:01:54.406 --> 00:01:57.886 A:middle
You can go ahead and use tags
in your iCloud open panel.
00:01:58.206 --> 00:02:00.956 A:middle
You can see the tags and their
iCloud documents as well.
WEBVTT
X-TIMESTAMP-MAP=MPEGTS:181083,LOCAL:00:00:00.000
00:01:58.206 --> 00:02:00.956 A:middle
You can see the tags and their
iCloud documents as well.
00:02:01.326 --> 00:02:04.476 A:middle
You can go ahead and assign tags
to files as you're saving them
00:02:04.846 --> 00:02:06.436 A:middle
or you can go ahead
and change the tags
00:02:06.436 --> 00:02:10.045 A:middle
on files using this new
document popover that comes
00:02:10.045 --> 00:02:11.126 A:middle
out from the title bar.
00:02:11.436 --> 00:02:13.666 A:middle
So there are many ways for
users to interact with Tags.
00:02:14.896 --> 00:02:17.636 A:middle
Now, let's talk at-- look at
the APIs we've added for tags.
00:02:18.126 --> 00:02:20.666 A:middle
It's actually not too many APIs
here we don't need too many.
00:02:21.086 --> 00:02:25.586 A:middle
One is a new, NSURL resource
key, NSURL tag names key
00:02:25.586 --> 00:02:28.996 A:middle
and the value of this is
an NS array of NS strings.
00:02:29.636 --> 00:02:32.806 A:middle
You would use this API on
an NSURL, get resource value
00:02:32.806 --> 00:02:36.466 A:middle
for KeyError which of course
an API NSURL already has
00:02:36.826 --> 00:02:40.106 A:middle
to get the list of Tags
assigned to a given file,
00:02:40.106 --> 00:02:43.656 A:middle
and you would use the set
API to set tags on a file.
00:02:44.726 --> 00:02:47.956 A:middle
Now, as you saw earlier, we
also have support for Tags
00:02:47.956 --> 00:02:51.256 A:middle
in the safe panel and
it's actually automatic,
00:02:51.916 --> 00:02:54.406 A:middle
not just for NSDocument-based
applications
00:02:54.406 --> 00:02:56.026 A:middle
but also any application
00:02:56.026 --> 00:02:59.996 A:middle
that uses the safe panel will
get a TagsField as shown here.
WEBVTT
X-TIMESTAMP-MAP=MPEGTS:181083,LOCAL:00:00:00.000
00:03:00.756 --> 00:03:02.796 A:middle
Now, the safe panel
will show the TagsField,
00:03:02.796 --> 00:03:04.936 A:middle
it will allow the users
to edit those tags
00:03:05.226 --> 00:03:07.676 A:middle
and it will also
automatically apply those tags
00:03:07.806 --> 00:03:10.076 A:middle
to the saved file, so you don't
really have to do anything.
00:03:10.476 --> 00:03:13.176 A:middle
Now, there might be cases
where this doesn't work right
00:03:13.176 --> 00:03:14.626 A:middle
or there might be
cases where you want
00:03:14.626 --> 00:03:15.876 A:middle
to customize this behavior.
00:03:16.906 --> 00:03:18.236 A:middle
In those cases, we
do have an API.
00:03:18.866 --> 00:03:22.356 A:middle
You can explicitly indicate that
you want to show the TagsField
00:03:22.356 --> 00:03:23.906 A:middle
or you don't want to
show the TagsField.
00:03:24.196 --> 00:03:26.696 A:middle
And if you are showing the
TagsField, you can then go ahead
00:03:26.696 --> 00:03:29.016 A:middle
and get and set the list of tags
00:03:29.016 --> 00:03:31.736 A:middle
that the user has
specified on that file.
00:03:31.736 --> 00:03:33.086 A:middle
And then you would
apply them yourself
00:03:33.086 --> 00:03:34.536 A:middle
or do whatever else you
want to do with them.
00:03:35.006 --> 00:03:37.966 A:middle
Next thing I want to talk about
is Light Content Controls.
00:03:38.506 --> 00:03:40.336 A:middle
So, these are new controls,
00:03:40.336 --> 00:03:43.666 A:middle
variants of our controls
are Standard Aqua Controls
00:03:43.896 --> 00:03:47.046 A:middle
that are meant for Window
bodies or Document Content.
00:03:47.716 --> 00:03:48.666 A:middle
Here's some example.
00:03:48.976 --> 00:03:52.606 A:middle
This is the event inspector
in the Calendar application
00:03:52.776 --> 00:03:55.476 A:middle
and the buttons you see
here, down the side,
00:03:55.836 --> 00:03:57.486 A:middle
these are Light Content
Controls.
00:03:57.486 --> 00:03:59.806 A:middle
As you can see they're
somewhat lighter,
WEBVTT
X-TIMESTAMP-MAP=MPEGTS:181083,LOCAL:00:00:00.000
00:04:00.086 --> 00:04:02.656 A:middle
than standard Aqua
controls and they're meant
00:04:02.656 --> 00:04:05.106 A:middle
for that white lighter
colored background.
00:04:05.476 --> 00:04:08.076 A:middle
Here's another example, this
is the Contacts application,
00:04:08.276 --> 00:04:10.936 A:middle
and the buttons along the side
are light content controls.
00:04:11.866 --> 00:04:13.246 A:middle
Here's the Maps application.
00:04:13.516 --> 00:04:16.315 A:middle
Now, the buttons along the top
here are standard Aqua controls
00:04:16.315 --> 00:04:18.666 A:middle
because they're just
being displayed on top
00:04:18.666 --> 00:04:20.466 A:middle
of the standard Window
background.
00:04:20.826 --> 00:04:23.076 A:middle
But if you bring up a
popover in this application,
00:04:23.416 --> 00:04:25.146 A:middle
then the buttons you
see in the popover again
00:04:25.146 --> 00:04:28.006 A:middle
in that light background, these
are light contents controls.
00:04:28.346 --> 00:04:30.466 A:middle
So, how do you access these
light content controls?
00:04:31.036 --> 00:04:34.646 A:middle
Well, they're available through
a new API called NS Appearance.
00:04:35.546 --> 00:04:39.116 A:middle
This is a class that lets you
access alternate appearances
00:04:40.446 --> 00:04:43.126 A:middle
and it's got a bunch of
methods, the one I'm going
00:04:43.126 --> 00:04:44.676 A:middle
to show here is appearance name,
00:04:44.706 --> 00:04:46.216 A:middle
you just give it
an appearance name
00:04:46.216 --> 00:04:48.026 A:middle
and it fetches an
appearance for you.
00:04:48.026 --> 00:04:49.466 A:middle
And we have two appearances
to find;
00:04:50.116 --> 00:04:52.156 A:middle
Standard Aqua, and
Light Content.
00:04:52.736 --> 00:04:53.826 A:middle
Now, once you have
an appearance,
00:04:53.826 --> 00:04:54.606 A:middle
what do you do with it?
00:04:55.066 --> 00:04:57.626 A:middle
You would use this protocol
which is to find on View,
00:04:57.726 --> 00:04:59.386 A:middle
on NSView and NSWindow,
00:04:59.596 --> 00:05:01.336 A:middle
the appearance customization
protocol.
WEBVTT
X-TIMESTAMP-MAP=MPEGTS:181083,LOCAL:00:00:00.000
00:04:59.596 --> 00:05:01.336 A:middle
the appearance customization
protocol.
00:05:01.666 --> 00:05:04.906 A:middle
You can go ahead and the set
the appearance of that View
00:05:04.906 --> 00:05:09.146 A:middle
or Window, and all the UI
elements inside that View
00:05:09.146 --> 00:05:12.186 A:middle
of Window will now
inherit this appearance,
00:05:12.186 --> 00:05:13.876 A:middle
and start using the
appearance you've specified.
00:05:14.456 --> 00:05:17.386 A:middle
And since the UI element
can inherit its appearance
00:05:17.386 --> 00:05:19.816 A:middle
from its parent views
there's also another property,
00:05:19.816 --> 00:05:21.766 A:middle
a Read Only property
called Effective Appearance
00:05:22.156 --> 00:05:24.696 A:middle
which lets you tell what
appearance a UI element should
00:05:24.696 --> 00:05:25.146 A:middle
be using.
00:05:26.266 --> 00:05:28.716 A:middle
Now, you don't have to use codes
for this, you can also do this
00:05:28.716 --> 00:05:32.256 A:middle
in Xcode in the Attributes
Inspector
00:05:32.256 --> 00:05:33.626 A:middle
in Xcode interface builder.
00:05:34.786 --> 00:05:40.216 A:middle
So here for instance is the
Attributes Inspector for box.
00:05:40.216 --> 00:05:41.836 A:middle
You can do this for
container classes.
00:05:42.356 --> 00:05:45.056 A:middle
And at the bottom here, you
see the appearance setting.
00:05:45.056 --> 00:05:46.446 A:middle
It's now showing Aqua.
00:05:46.756 --> 00:05:48.126 A:middle
If you click on it
you can see that,
00:05:48.126 --> 00:05:52.286 A:middle
you can now specify light
content for that container
00:05:52.286 --> 00:05:53.726 A:middle
and as I said, all the elements
00:05:53.726 --> 00:05:55.686 A:middle
in there will now start
using this appearance.
00:05:55.926 --> 00:05:57.826 A:middle
Next thing I want to talk
about is NS StackView.
00:05:58.376 --> 00:06:00.226 A:middle
NS StackView is a
new class we've added
WEBVTT
X-TIMESTAMP-MAP=MPEGTS:181083,LOCAL:00:00:00.000
00:05:58.376 --> 00:06:00.226 A:middle
NS StackView is a
new class we've added
00:06:00.226 --> 00:06:02.136 A:middle
to AppKit in Mavericks.
00:06:02.346 --> 00:06:05.046 A:middle
It's a class which
manages stacks of views
00:06:05.216 --> 00:06:07.056 A:middle
and it uses Auto
Layout internally.
00:06:07.496 --> 00:06:09.486 A:middle
It lets you group the views
00:06:09.486 --> 00:06:11.296 A:middle
and we'll be seeing an
example of that shortly.
00:06:11.526 --> 00:06:14.656 A:middle
And it also will manage
the sizing of the views
00:06:14.656 --> 00:06:17.856 A:middle
and it will also drop Views, or
click Views, or tighten Views
00:06:17.856 --> 00:06:20.646 A:middle
as necessary as the
StackView size changes.
00:06:21.156 --> 00:06:23.476 A:middle
Let me give you a
little example.
00:06:23.476 --> 00:06:27.316 A:middle
This is the kind of view you
might build with NS StackView.
00:06:27.676 --> 00:06:30.406 A:middle
Here you have a group of
controls on the left side
00:06:30.406 --> 00:06:32.996 A:middle
and you have another control,
a slider on the other side.
00:06:33.266 --> 00:06:36.916 A:middle
As this view is made smaller,
the slider comes closer
00:06:36.916 --> 00:06:39.666 A:middle
to the other group and then the
slider starts getting smaller.
00:06:39.996 --> 00:06:42.266 A:middle
And then, the text field
starts getting smaller.
00:06:42.466 --> 00:06:45.606 A:middle
And eventually when there's no
more room and pressure's rising,
00:06:45.976 --> 00:06:48.606 A:middle
the button all the way at this
end is voted off the island
00:06:49.066 --> 00:06:51.726 A:middle
and then things start to
continue to get even smaller.
00:06:51.986 --> 00:06:53.976 A:middle
So, as you can see, StackView
they're not only used
00:06:53.976 --> 00:06:57.876 A:middle
to using Auto Layout, it's also
hiding and removing some Views
00:06:57.876 --> 00:06:59.866 A:middle
as needed and it will
also bring them back
WEBVTT
X-TIMESTAMP-MAP=MPEGTS:181083,LOCAL:00:00:00.000
00:07:00.216 --> 00:07:01.616 A:middle
when the StackView
is made larger.
00:07:01.676 --> 00:07:04.726 A:middle
So, in this way StackView is
using Auto Layout and building
00:07:04.726 --> 00:07:06.576 A:middle
on top of it, and you
yourself don't have to worry
00:07:06.576 --> 00:07:09.446 A:middle
about any creating those
constraints or managing them
00:07:09.746 --> 00:07:10.926 A:middle
which is, you know, not
00:07:10.926 --> 00:07:13.366 A:middle
that [inaudible] especially
once you're removing
00:07:13.366 --> 00:07:14.636 A:middle
and adding Views and so on.
00:07:14.976 --> 00:07:16.786 A:middle
Now, StackViews don't
have to be horizontal,
00:07:16.786 --> 00:07:18.036 A:middle
they can also be vertical.
00:07:18.316 --> 00:07:20.736 A:middle
Here's a kind of view you might
build with a vertical StackView,
00:07:20.736 --> 00:07:22.626 A:middle
this is an inspector
panel you might see
00:07:22.626 --> 00:07:24.286 A:middle
in drawing application.
00:07:25.696 --> 00:07:30.466 A:middle
As you expand the various
pieces, various elements up here
00:07:30.466 --> 00:07:32.776 A:middle
and you know, they will collapse
as well and that's the kind
00:07:32.776 --> 00:07:35.746 A:middle
of thing that's fairly simple
to build with a StackView.
00:07:36.186 --> 00:07:38.766 A:middle
The API of NS StackView
is purely straightforward,
00:07:39.076 --> 00:07:42.586 A:middle
you create one by giving it
some views, StackView with views
00:07:42.946 --> 00:07:46.866 A:middle
or you can choose to add Views
explicitly one at a time.
00:07:47.006 --> 00:07:49.906 A:middle
Here, you're specifying gravity
and the gravity is the grouping,
00:07:50.056 --> 00:07:53.036 A:middle
either one end, to the other end
or the middle of the StackView.
00:07:53.296 --> 00:07:55.536 A:middle
And there are other
properties on StackView
00:07:55.806 --> 00:08:00.026 A:middle
that lets you specify properties
in Layouts such as the spacing,
WEBVTT
X-TIMESTAMP-MAP=MPEGTS:181083,LOCAL:00:00:00.000
00:07:55.806 --> 00:08:00.026 A:middle
that lets you specify properties
in Layouts such as the spacing,
00:08:00.026 --> 00:08:01.856 A:middle
the priority, what the clipping
00:08:01.856 --> 00:08:03.656 A:middle
and hugging priorities
are and so on.
00:08:04.066 --> 00:08:07.566 A:middle
There will be a more in-depth
coverage of NS StackView
00:08:07.566 --> 00:08:09.856 A:middle
in this talk which is tomorrow,
00:08:10.146 --> 00:08:12.746 A:middle
best practices for
Cocoa Animation.
00:08:12.976 --> 00:08:16.336 A:middle
This talk will also go into
various animation techniques
00:08:16.336 --> 00:08:19.476 A:middle
for Cocoa both old and new,
so it's a great to talk
00:08:19.476 --> 00:08:21.946 A:middle
to learn both about animation
and StackView and in fact
00:08:21.946 --> 00:08:23.566 A:middle
about animating StackViews
as well.
00:08:24.156 --> 00:08:25.476 A:middle
So, next I want to talk--
00:08:25.476 --> 00:08:27.766 A:middle
so just of having to
talk about Auto Layout,
00:08:27.766 --> 00:08:30.006 A:middle
let me just talk a bit
about Auto Layout as well.
00:08:30.296 --> 00:08:33.046 A:middle
In Auto Layout, we've made a
lot of performance improvements
00:08:33.046 --> 00:08:36.086 A:middle
and this is true in
general but especially
00:08:36.086 --> 00:08:37.645 A:middle
in view-based TableViews.
00:08:37.936 --> 00:08:41.116 A:middle
That's because constraints are
now attached to Views in a way
00:08:41.116 --> 00:08:43.566 A:middle
that as Views are removed
or added to the hierarchy,
00:08:43.856 --> 00:08:44.856 A:middle
they stick to the View.
00:08:45.086 --> 00:08:47.416 A:middle
In addition, we've
made the enumeration
00:08:47.416 --> 00:08:50.416 A:middle
of constraints a lot more
efficient and predictable,
00:08:50.666 --> 00:08:53.546 A:middle
so that you will see much
more predictable behavior in--
00:08:53.606 --> 00:08:55.846 A:middle
when dealing with Views that
have a lot of constraints.
00:08:56.166 --> 00:08:58.376 A:middle
So, that's something you should
notice in your applications.
00:08:58.756 --> 00:09:01.016 A:middle
In addition, we have
a new workflow to deal
WEBVTT
X-TIMESTAMP-MAP=MPEGTS:181083,LOCAL:00:00:00.000
00:08:58.756 --> 00:09:01.016 A:middle
In addition, we have
a new workflow to deal
00:09:01.016 --> 00:09:02.516 A:middle
with Auto Layout in Xcode.
00:09:02.846 --> 00:09:07.746 A:middle
In general, Xcode is a lot
more flexible and forgiving
00:09:07.746 --> 00:09:10.946 A:middle
about letting you do
Auto Layout in Xcode.
00:09:10.946 --> 00:09:12.396 A:middle
You can now delete constraints,
00:09:12.396 --> 00:09:15.326 A:middle
you can create ambiguous
structures, you can move Views
00:09:15.326 --> 00:09:18.346 A:middle
around et cetera and Xcode
won't throw a fit anymore.
00:09:18.396 --> 00:09:20.856 A:middle
So this is-- you
are more in control.
00:09:21.216 --> 00:09:24.786 A:middle
And you can see more about
this in tomorrow's session,
00:09:25.036 --> 00:09:27.176 A:middle
taking control of Auto
Layout in Xcode 5.
00:09:27.336 --> 00:09:29.286 A:middle
Next, I want to talk about
Responsive Scrolling,
00:09:29.356 --> 00:09:33.266 A:middle
and you saw a demo of this
yesterday at the Keynote,
00:09:33.266 --> 00:09:35.576 A:middle
in addition you saw it perhaps
at the State of the Union
00:09:35.576 --> 00:09:37.026 A:middle
in the afternoon as
well it's something
00:09:37.026 --> 00:09:39.966 A:middle
that we've worked a lot on
00:09:39.966 --> 00:09:43.026 A:middle
and it's you know
something we think is great.
00:09:43.576 --> 00:09:45.496 A:middle
The goal here is to
provide the users
00:09:45.496 --> 00:09:48.406 A:middle
with non-stuttering
fluid scrolling.
00:09:48.816 --> 00:09:52.986 A:middle
So let me just give you a review
of how scrolling works in 10.8.
00:09:53.716 --> 00:09:56.236 A:middle
So here it is a view and assume,
00:09:56.236 --> 00:09:58.856 A:middle
not the blue border there
is your divisible area
00:09:58.856 --> 00:09:59.646 A:middle
of the ScrollView.
00:09:59.906 --> 00:10:02.976 A:middle
In 10.8, when the user
scrolls, they see this.
WEBVTT
X-TIMESTAMP-MAP=MPEGTS:181083,LOCAL:00:00:00.000
00:09:59.906 --> 00:10:02.976 A:middle
In 10.8, when the user
scrolls, they see this.
00:10:04.346 --> 00:10:07.186 A:middle
Now, really what's
happening under the covers is
00:10:07.186 --> 00:10:10.736 A:middle
that when the scroll
starts, divisible area
00:10:10.736 --> 00:10:15.236 A:middle
of the view is copied up
a blip, blip if you will.
00:10:15.236 --> 00:10:18.806 A:middle
And then the-- reveal the area
is drawn in by calling drawRect.
00:10:19.246 --> 00:10:20.606 A:middle
And then this happens again
00:10:20.606 --> 00:10:22.416 A:middle
for every little
slice that's visible.
00:10:22.666 --> 00:10:25.476 A:middle
And of course, the user
never see the black flash
00:10:25.506 --> 00:10:28.076 A:middle
because we actually copy
the bits up and then we fill
00:10:28.076 --> 00:10:30.386 A:middle
in that area without
flushing the Window
00:10:30.616 --> 00:10:32.366 A:middle
so that the user actually
doesn't see a flash.
00:10:32.796 --> 00:10:37.716 A:middle
But one thing you will notice is
that in a situation like this,
00:10:38.046 --> 00:10:40.376 A:middle
the scrolling performance
is really at the mercy
00:10:40.376 --> 00:10:41.896 A:middle
of the performance of drawRect.
00:10:42.366 --> 00:10:44.766 A:middle
If that drawRect
call just to fill
00:10:44.766 --> 00:10:47.056 A:middle
in that little strip
takes say, half a second,
00:10:47.336 --> 00:10:50.116 A:middle
scrolling all stutter,
really for half a second.
00:10:50.226 --> 00:10:52.756 A:middle
And actually more generally,
scrolling performance is
00:10:52.756 --> 00:10:54.116 A:middle
at the mercy of the main thread
00:10:54.426 --> 00:10:56.626 A:middle
because the drawRect is
happening on the main thread
00:10:56.826 --> 00:10:59.146 A:middle
and the main thread is
a pretty popular place.
00:10:59.516 --> 00:11:00.866 A:middle
There is the Run Loop there.
WEBVTT
X-TIMESTAMP-MAP=MPEGTS:181083,LOCAL:00:00:00.000
00:10:59.516 --> 00:11:00.866 A:middle
There is the Run Loop there.
00:11:01.066 --> 00:11:02.726 A:middle
You know, things are happening.
00:11:03.276 --> 00:11:04.866 A:middle
All sorts of things
might be happening,
00:11:04.866 --> 00:11:06.316 A:middle
network activity,
who knows what?
00:11:06.666 --> 00:11:10.476 A:middle
So, even if drawRect wasn't
badly behaving there might be
00:11:10.476 --> 00:11:13.446 A:middle
other factors which cause the
whole scrolling experience
00:11:13.496 --> 00:11:15.196 A:middle
to stutter in certain
conditions.
00:11:15.836 --> 00:11:16.816 A:middle
So, what's the solution?
00:11:17.896 --> 00:11:22.806 A:middle
The solution is to dissociate
the scrolling from domain thread
00:11:22.806 --> 00:11:24.906 A:middle
as much as possible and
we've done two things