{"id":211144,"date":"2014-02-02T22:14:03","date_gmt":"2014-02-02T18:14:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=211144"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=211144","title":{"rendered":"<span class=\"post_title\">UICollectionView \u0438\u043b\u0438 \u0442\u0430\u043d\u0446\u044b \u0441 \u0432\u043e\u043b\u043a\u0430\u043c\u0438<\/span>"},"content":{"rendered":"<div class=\"content html_format\">\n<h2>The dream<\/h2>\n<p>  UICollectionView \u2014 \u043a\u043b\u0430\u0441\u0441 UIKit, \u043f\u043e\u044f\u0432\u0438\u0432\u0448\u0438\u0439\u0441\u044f \u0432 iOS 6. \u0421\u0442\u0440\u043e\u0433\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u044d\u0442\u043e \u043a\u043b\u0430\u0441\u0441, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e \u0430\u0439\u0442\u0435\u043c\u043e\u0432. \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u2014 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u0430\u044f, \u043d\u043e \u043e\u0431\u044b\u0447\u043d\u043e UICollectionView \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u0441\u044f\u043a\u0438\u0445 \u0441\u0435\u0442\u043a\u043e-\u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043e\u0432 \u0441 \u044f\u0447\u0435\u0439\u043a\u0430\u043c\u0438, \u0445\u0435\u0434\u0435\u0440\u0430\u043c\u0438 \u0438 \u0444\u0443\u0442\u0435\u0440\u0430\u043c\u0438. \u041f\u043e\u043d\u0438\u043c\u0430\u044f, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u0435\u043d \u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 Apple \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043c\u043e\u0449\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043b\u044e\u0431\u044b\u0445 \u043b\u0435\u0439\u0430\u0443\u0442\u043e\u0432. \u041f\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u043c\u0443 \u0441\u0447\u0435\u0442\u0443, \u0434\u0430\u0436\u0435 UITableView \u044d\u0442\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f UICollectionView. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430, \u0432 \u043a\u0430\u043a\u043e\u043c-\u0442\u043e \u0441\u043c\u044b\u0441\u043b\u0435, \u0444\u0430\u043d\u0442\u0430\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435. \u041d\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0435\u0442 \u043d\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c.<\/p>\n<p>  \u0410\u0445\u0438\u043b\u043b\u0435\u0441\u043e\u0432\u0430 \u043f\u044f\u0442\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 Apple \u2014 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0435 \u0441\u0442\u0440\u0435\u043c\u043b\u0435\u043d\u0438\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u0421\u0414\u041a, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u00ab\u0430\u0432\u0442\u043e\u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u00bb. \u041f\u0440\u043e\u0441\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u0442\u043e-\u0442\u043e \u0438 \u0442\u043e-\u0442\u043e, \u0438 \u043a\u043b\u0430\u0441\u0441 \u00abwill do the right thing\u00bb. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430. \u0418 UICollectionView \u2014 \u044f\u0440\u043a\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440. \u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0440\u0435\u043b\u0438\u0437\u0430 \u0432 iOS 6 \u0438 \u043f\u043e \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u0438\u0439 \u0434\u0435\u043d\u044c (iOS 7.0.4) \u043a\u043b\u0430\u0441\u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0430\u0433\u043e\u0432, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043e\u0447\u0435\u043d\u044c \u0442\u0440\u0443\u0434\u043d\u043e \u0438 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u0434\u0435\u043b\u043e. \u041f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0443\u0433\u0430\u0434\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u0436\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u00ab\u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c\u00bb, \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0442\u044b\u043a\u0430 \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c UICollectionView \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043a\u0430\u043a \u043d\u0430\u0434\u043e. \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u0438\u043e\u0431\u0440\u0435\u0442\u0435\u043d\u043d\u044b\u0445 \u043a\u043e\u0441\u0442\u044b\u043b\u0435\u0439 \u0443\u0436\u0435 \u0434\u043e\u0441\u0442\u0438\u0433\u043b\u043e \u0442\u0430\u043a\u0438\u0445 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432, \u0447\u0442\u043e \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u043c\u0438 \u0431\u0430\u0433\u0430\u043c\u0438 \u0438 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u043c\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c\u0438.<\/p>\n<p>  \u041a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u2014 \u043c\u0438\u043b\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0441\u0438\u043c \u043f\u043e\u0434 \u043a\u0430\u0442.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h2>Reality<\/h2>\n<p>  \u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u043d\u0430\u0447\u0430\u0442\u044c \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0431\u0430\u0433\u0438, \u044f \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u00ab\u0438\u0434\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439\u00bb, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c UICollectionView \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e, \u0431\u0435\u0437 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u043a\u043e\u0441\u0442\u044b\u043b\u0435\u0439. \u041a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u044d\u0442\u043e UICollectionView, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0435\u0442 \u0445\u0435\u0434\u0435\u0440\u043e\u0432, \u0438 \u0444\u0443\u0442\u0435\u0440\u043e\u0432, \u0442\u043e\u043b\u044c\u043a\u043e \u044f\u0447\u0435\u0439\u043a\u0438. \u041a\u043e\u0433\u0434\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043b\u0441\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u044c(viewDidLoad:), \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 UICollectionView -reloadData. \u0410\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0439, \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0439, \u0438 \u0432\u0441\u0442\u0430\u0432\u043e\u043a \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f. \u0412\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u0434\u043b\u044f UICollectionView \u0431\u0435\u0437 \u043a\u043e\u0441\u0442\u044b\u043b\u0435\u0439. \u041a\u0430\u043a \u0432\u044b \u0432\u0438\u0434\u0438\u0442\u0435, \u043e\u043d \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d. <\/p>\n<p>  \u0421\u0440\u0430\u0437\u0443 \u043e\u0433\u043e\u0432\u043e\u0440\u044e\u0441\u044c, \u0447\u0442\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0435 \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u044c \u0431\u0430\u0433\u0438 \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043d\u0438\u0436\u0435. \u041a\u0430\u0436\u0434\u044b\u0439 \u0431\u0430\u0433 \u043d\u0430\u0445\u043e\u0434\u0438\u043b\u0441\u044f \u0432 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0443 \u0432\u0430\u0441 \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0431\u044b\u0442\u044c. \u0418 \u043a\u0430\u0436\u0434\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0442\u043e\u0436\u0435 \u043f\u043e\u043c\u043e\u0433\u0430\u043b\u043e \u0432 \u043c\u043e\u0435\u043c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043d\u0435\u043b\u044c\u0437\u044f \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u043e\u043d\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0432\u0430\u043c, \u0438 \u0447\u0442\u043e \u043e\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0440\u0435\u043b\u0438\u0437\u0430\u0445 iOS. \u041c\u043d\u043e\u0433\u0438\u0435 \u0438\u0437 \u043a\u043e\u0441\u0442\u044b\u043b\u0435\u0439 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0443\u0440\u043e\u0434\u043b\u0438\u0432\u043e, \u043d\u043e \u043a\u0430\u043a\u043e\u0439 \u043a\u043e\u0441\u0442\u044b\u043b\u044c \u043d\u0435 \u0443\u0440\u043e\u0434\u043b\u0438\u0432? \u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u2014 \u0431\u0443\u0434\u0443 \u0441\u0447\u0430\u0441\u0442\u043b\u0438\u0432 =). \u041f\u043e\u0435\u0445\u0430\u043b\u0438!<\/p>\n<h4>iOS 6 + iOS 7<\/h4>\n<p>  <b>1. <\/b>\u041d\u0435\u043b\u044c\u0437\u044f \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0435\u0440\u0432\u044b\u0439 UICollectionViewCell \u0432 \u0441\u0435\u043a\u0446\u0438\u0438. \u0422\u0430\u043a\u0436\u0435 \u043d\u0435\u043b\u044c\u0437\u044f \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0439\u0441\u044f UICollectionViewCell. \u041f\u043e\u043f\u044b\u0442\u043a\u0430 \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043a\u0440\u0430\u0448\u0443 \u0432 \u0434\u0435\u0431\u0430\u0433 \u0431\u0438\u043b\u0434\u0430\u0445, \u0438 \u043d\u0435\u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u043e\u043c\u0443 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044e \u0432 \u0440\u0435\u043b\u0438\u0437 \u0431\u0438\u043b\u0434\u0430\u0445:<\/p>\n<blockquote><p>*** Terminating app due to uncaught exception &#8216;NSInternalInconsistencyException&#8217;, reason: &#8216;request for index path for global index 1 when there are only 1 items in the collection view&#8217;<\/p><\/blockquote>\n<p>  <b>\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439.<\/b> \u0421\u0430\u043c\u044b\u0439 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u0431\u0430\u0433 \u0441 UICollectionView. \u041e\u0442\u043a\u0440\u044b\u0442 <a href=\"http:\/\/openradar.appspot.com\/12954582\">\u0440\u0430\u0434\u0430\u0440<\/a> \u043d\u0430 \u0431\u0430\u0433-\u0442\u0440\u0435\u043a\u0435\u0440\u0435 Apple. \u0421\u0430\u043c\u043e\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0438 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u2014 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c reloadData. \u0418\u043d\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u043e\u0447\u044c \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 insertItemsAtIndexPaths: \u0432 try-catch \u0431\u043b\u043e\u043a\u0435(\u0434\u0430, \u043d\u043e\u0433\u0430 \u0431\u0435\u0437\u0436\u0430\u043b\u043e\u0441\u0442\u043d\u043e \u043e\u0442\u0441\u0442\u0440\u0435\u043b\u0435\u043d\u0430). <\/p>\n<pre><code class=\"objectivec\">@try {     [self.collectionView insertItemsAtIndexPaths:indexPaths]; } @catch (NSException *exception) {} <\/code><\/pre>\n<p>  \u0415\u0449\u0435 \u043e\u0434\u043d\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u0436\u0430\u043b\u0443\u0439 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u043d\u043e \u0441\u0442\u043e\u0438\u0442 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u044f, \u044d\u0442\u043e \u0432\u044b\u0437\u043e\u0432 reloadData \u0432\u043d\u0443\u0442\u0440\u0438 performBatchUpdates \u0431\u043b\u043e\u043a\u0430.<\/p>\n<pre><code class=\"objectivec\">[self.collectionView performBatchUpdates:^{         [self.collectionView reloadData];     } completion:nil]; <\/code><\/pre>\n<p>  <b>2. <\/b>\u041f\u043e\u043f\u044b\u0442\u043a\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0434\u0432\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0431\u0435\u0437 performBatchUpdates \u0431\u043b\u043e\u043a\u0430 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u043f\u0430\u0434\u0435\u043d\u0438\u044e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. <\/p>\n<blockquote><p> *** Terminating app due to uncaught exception &#8216;NSInternalInconsistencyException&#8217;, reason: &#8216;Invalid update: invalid number of sections. The number of sections contained in the collection view after the update (1) must be equal to the number of sections contained in the collection view before the update (0), plus or minus the number of sections inserted or deleted (0 inserted, 0 deleted).&#8217;<\/p><\/blockquote>\n<p>  <b>\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439. <\/b> \u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u0443\u043d\u043a\u0442 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c, \u043d\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043e\u043d \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u0435\u043d. 80% \u043c\u043e\u0438\u0445 \u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 UICollectionView \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u043b\u043e \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0441\u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0439. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u044d\u0442\u043e \u0431\u044b\u0432\u0430\u0435\u0442 \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 NSFetchedResultsController \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 CoreData. \u0418\u043c\u0435\u0435\u0442\u0441\u044f <a href=\"https:\/\/github.com\/AshFurrow\/UICollectionView-NSFetchedResultsController\">\u043e\u043f\u0435\u043d\u0441\u043e\u0440\u0441\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043e\u0442 Ash Furrow<\/a>, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0435\u0435 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u0432 CoreData.<\/p>\n<p>  <b>3. <\/b>\u041d\u0435\u043b\u044c\u0437\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0441\u0435\u043a\u0446\u0438\u0438 \u0438 \u044f\u0447\u0435\u0439\u043a\u0438 \u0432 \u043e\u0434\u043d\u043e\u043c performBatchUpdates \u0431\u043b\u043e\u043a\u0435. \u041f\u043e\u0434 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0430 \u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435.<\/p>\n<blockquote><p> *** Terminating app due to uncaught exception &#8216;NSInternalInconsistencyException&#8217;, reason: &#8216;Invalid update: invalid number of sections. The number of sections contained in the collection view after the update (1) must be equal to the number of sections contained in the collection view before the update (0), plus or minus the number of sections inserted or deleted (0 inserted, 0 deleted).&#8217;<\/p><\/blockquote>\n<p>  <b>\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439. <\/b> \u0414\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u0434\u0432\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 performBatchUpdates \u0431\u043b\u043e\u043a\u0430, \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u0431\u043b\u043e\u043a\u0435 \u2014 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441\u0435\u043a\u0446\u0438\u0438, \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u2014 \u044f\u0447\u0435\u0439\u043a\u0438.<\/p>\n<p>  <b>4.<\/b> \u041d\u0435\u043b\u044c\u0437\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c performBatchUpdates \u0441\u0440\u0430\u0437\u0443 \u0437\u0430 \u0432\u044b\u0437\u043e\u0432\u043e\u043c reloadData. <\/p>\n<blockquote><p>attempt to delete section 0, but there are only 0 sections before the update<\/p><\/blockquote>\n<p>  <b>\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439.<\/b> \u0422\u0430\u043a\u043e\u0435 \u043e\u0449\u0443\u0449\u0435\u043d\u0438\u0435, \u0447\u0442\u043e reloadData \u0432 UICollectionView \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 UITableView.<\/p>\n<p>  <b>5.<\/b> \u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 UICollectionViewFlowLayout, \u0435\u0441\u043b\u0438 headerSize \u0438\u043b\u0438 footerSize \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043d\u0443\u043b\u044f, \u043c\u0435\u0442\u043e\u0434 collectionView:viewForSupplementaryElementOfKind:atIndexPath: \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c nil, \u0438\u043d\u0430\u0447\u0435 \u2014 \u043a\u0440\u0430\u0448.<\/p>\n<blockquote><p> *** Terminating app due to uncaught exception &#8216;NSInternalInconsistencyException&#8217;, reason: &#8216;the view returned from -collectionView:viewForSupplementaryElementOfKind:atIndexPath (UICollectionElementKindSectionFooter,&lt;NSIndexPath: 0x8e55df0&gt; {length = 2, path = 0 \u2014 0}) was not retrieved by calling -dequeueReusableSupplementaryViewOfKind:withReuseIdentifier:forIndexPath: or is nil ((null))&#8217;<\/p><\/blockquote>\n<p>  <b> \u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439. <\/b> \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 UICollectionView, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c header \u0438\u043b\u0438 footer \u043c\u043e\u0433\u0443\u0442 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u043e\u0432\u0441\u043a\u0438\u0439 \u043c\u0435\u0442\u043e\u0434<\/p>\n<pre><code class=\"objectivec\"> -(CGSize)collectionView:(UICollectionView *)collectionView                  layout:(UICollectionViewFlowLayout *)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)sectionNumber <\/code><\/pre>\n<p>  \u0418 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0435\u043a\u0446\u0438\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 header, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c CGSizeZero.<\/p>\n<h4> iOS 6<\/h4>\n<p>  <b> 1. <\/b>UICollectionViewFLowLayout. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0441\u0435\u043a\u0446\u0438\u044f \u0431\u0435\u0437 \u044f\u0447\u0435\u0435\u043a, \u0438 \u0432\u044b \u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438 \u0434\u0435\u043b\u0435\u0433\u0430\u0442\u043e\u0432\u0441\u043a\u0438\u0439 \u043c\u0435\u0442\u043e\u0434 collectionView:layout:referenceSizeForHeaderInSection:, \u0432\u0430\u043c \u043d\u0435 \u043f\u043e\u0432\u0435\u0437\u043b\u043e, \u043a\u0440\u0430\u0448 \u0440\u0430\u043d\u0442\u0430\u0439\u043c.<\/p>\n<blockquote><p> *** Assertion failure in -[UICollectionViewData indexPathForItemAtGlobalIndex:]<br \/>  request for index path for global index 805306368 when there are only 0 items in the collection view<\/p><\/blockquote>\n<p>  <b>\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439.<\/b> \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043c\u0435\u0442\u043e\u0434 collectionView:layout:referenceSizeForHeaderInSection:, \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u043b\u0438 \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 \u043d\u0435\u0442 \u044f\u0447\u0435\u0435\u043a, \u0432\u0435\u0440\u043d\u0443\u0442\u044c CGSizeZero.<\/p>\n<p>  2. \u0418\u043d\u043e\u0433\u0434\u0430 \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 reloadData \u0441\u0442\u0430\u0440\u044b\u0435 \u044f\u0447\u0435\u0439\u043a\u0438 \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u043c\u0435\u0441\u0442\u0435, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043c\u0435\u0442\u043e\u0434\u044b UICollectionViewDatasource \u0447\u0435\u0442\u043a\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442, \u0447\u0442\u043e \u0438\u0445 \u043d\u0435\u0442. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 UICollectionView \u0437\u0430\u043a\u0440\u044b\u0442 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u043e\u0439, \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u043c UIView. \u0420\u0435\u0448\u0435\u043d\u0438\u044f \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u043d\u0435\u0442.<\/p>\n<h4>iOS 7<\/h4>\n<p>  <b>1. <\/b>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u044f\u0447\u0435\u0439\u043a\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0432 \u0441\u0435\u043a\u0446\u0438\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0444\u0443\u0442\u0435\u0440\u043e\u0432 \u0432 UICollectionView, \u0432\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430 moveItemAtIndexPath:toIndexPath: \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u044f\u0447\u0435\u0439\u043a\u0438 \u0432 \u0434\u0440\u0443\u0433\u0443\u044e \u0441\u0435\u043a\u0446\u0438\u044e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u043f\u0430\u0434\u0435\u043d\u0438\u044e<\/p>\n<blockquote><p>Terminating app due to uncaught exception &#8216;NSInternalInconsistencyException&#8217;, reason: &#8216;no UICollectionViewLayoutAttributes instance for -layoutAttributesForSupplementaryElementOfKind: UICollectionElementKindSectionFooter at path &lt;NSIndexPath: 0xc054730&gt; {length = 2, path = 0 \u2014 0}&#8217;<\/p><\/blockquote>\n<p>  <b>\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439. <\/b> \u0414\u0430\u043d\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043e\u0447\u0435\u043d\u044c \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442 \u0432\u0441\u0442\u0430\u0432\u043a\u0443 \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0430\u0439\u0442\u0435\u043c\u0430 \u0432 \u0441\u0435\u043a\u0446\u0438\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0442\u0430\u043a\u043e\u0435-\u0436\u0435, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c reloadData \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0430\u0439\u0442\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439.<\/p>\n<p>  <b>2. <\/b>\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0441\u0435\u043a\u0446\u0438\u0438 \u0432 \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 UICollectionView \u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435, \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043f\u0430\u0434\u0435\u043d\u0438\u044e.<\/p>\n<blockquote><p> *** Assertion failure in -[UICollectionViewData validateLayoutInRect:], \/SourceCache\/UIKit_Sim\/UIKit-2903.23\/UICollectionViewData.m:341<br \/>  2014-01-10 17:34:55.198 SMS-Bank[47090:70b] *** Terminating app due to uncaught exception &#8216;NSInternalInconsistencyException&#8217;, reason: &#8216;UICollectionView recieved layout attributes for a cell with an index path that does not exist: &lt;NSIndexPath: 0xc000000000000056&gt; {length = 2, path = 1 \u2014 0}&#8217;<\/p><\/blockquote>\n<p>  <b>\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439<\/b>. \u0412 \u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 UICollectionView \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u0447\u0435\u0437\u0430\u0442\u044c, \u0437\u0430\u043d\u0443\u043b\u044f\u0435\u043c \u0434\u0435\u043b\u0435\u0433\u0430\u0442 \u0438 \u0434\u0430\u0442\u0430\u0441\u043e\u0440\u0441. <\/p>\n<pre><code class=\"objectivec\">self.collectionView.delegate = nil; self.collectionView.dataSource = nil; <\/code><\/pre>\n<p>  <\/p>\n<h2>The end<\/h2>\n<p>  \u0421\u043f\u0438\u0441\u043e\u043a \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u043f\u043e\u043b\u043e\u043d, \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e UICollectionView \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043d\u0435\u0441\u0442\u0430\u0431\u0438\u043b\u0435\u043d. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u043a\u043e\u0433\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 Apple \u0434\u043e\u0432\u0435\u0434\u0443\u0442 \u0435\u0433\u043e \u0434\u043e \u0443\u043c\u0430. \u0410 \u043f\u043e\u043a\u0430-\u0447\u0442\u043e \u2014 \u043c\u043e\u0433\u0443 \u043f\u043e\u0441\u043e\u0432\u0435\u0442\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/github.com\/DenHeadless\/DTCollectionViewManager\">\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443<\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u044b\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 UICollectionView.<\/p>\n<p>  \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0430\u0432\u0442\u043e\u0440 \u0438 \u043d\u0430\u0448\u0435\u043b \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0431\u0430\u0433\u043e\u0432, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435. \u0426\u0435\u043b\u044c\u044e \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0431\u044b\u043b \u0444\u0438\u043a\u0441 \u0431\u0430\u0433\u043e\u0432 iOS SDK, \u043e\u0434\u043d\u0430\u043a\u043e \u043d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u0438\u0439 \u0434\u0435\u043d\u044c \u043a\u043e\u0441\u0442\u044b\u043b\u0438, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f iOS 6 \u0438 iOS 7, \u0441\u0442\u0430\u043b\u0438 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0432\u0430\u0436\u043d\u044b\u0445 \u0444\u0438\u0447. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u0431\u044b\u0442\u044c \u043e \u043a\u043e\u0448\u043c\u0430\u0440\u0435 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c UICollectionView + NSInternalInconsistencyException \u2014 \u0431\u0435\u0441\u0446\u0435\u043d\u043d\u0430. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043b\u0438\u0431\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0434\u0440\u0443\u0433\u0438\u0445 \u0431\u0430\u0433\u0430\u0445 UICollectionView \u2014 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u0435\u0441\u044c \u0435\u044e \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445!<\/p>\n<p>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435!    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/211144\/\"> http:\/\/habrahabr.ru\/post\/211144\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">\n<h2>The dream<\/h2>\n<p>  UICollectionView \u2014 \u043a\u043b\u0430\u0441\u0441 UIKit, \u043f\u043e\u044f\u0432\u0438\u0432\u0448\u0438\u0439\u0441\u044f \u0432 iOS 6. \u0421\u0442\u0440\u043e\u0433\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u044d\u0442\u043e \u043a\u043b\u0430\u0441\u0441, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e \u0430\u0439\u0442\u0435\u043c\u043e\u0432. \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u2014 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u0430\u044f, \u043d\u043e \u043e\u0431\u044b\u0447\u043d\u043e UICollectionView \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u0441\u044f\u043a\u0438\u0445 \u0441\u0435\u0442\u043a\u043e-\u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043e\u0432 \u0441 \u044f\u0447\u0435\u0439\u043a\u0430\u043c\u0438, \u0445\u0435\u0434\u0435\u0440\u0430\u043c\u0438 \u0438 \u0444\u0443\u0442\u0435\u0440\u0430\u043c\u0438. \u041f\u043e\u043d\u0438\u043c\u0430\u044f, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u0435\u043d \u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 Apple \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043c\u043e\u0449\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043b\u044e\u0431\u044b\u0445 \u043b\u0435\u0439\u0430\u0443\u0442\u043e\u0432. \u041f\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u043c\u0443 \u0441\u0447\u0435\u0442\u0443, \u0434\u0430\u0436\u0435 UITableView \u044d\u0442\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f UICollectionView. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430, \u0432 \u043a\u0430\u043a\u043e\u043c-\u0442\u043e \u0441\u043c\u044b\u0441\u043b\u0435, \u0444\u0430\u043d\u0442\u0430\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435. \u041d\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0435\u0442 \u043d\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c.<\/p>\n<p>  \u0410\u0445\u0438\u043b\u043b\u0435\u0441\u043e\u0432\u0430 \u043f\u044f\u0442\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 Apple \u2014 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0435 \u0441\u0442\u0440\u0435\u043c\u043b\u0435\u043d\u0438\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u0421\u0414\u041a, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u00ab\u0430\u0432\u0442\u043e\u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u00bb. \u041f\u0440\u043e\u0441\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u0442\u043e-\u0442\u043e \u0438 \u0442\u043e-\u0442\u043e, \u0438 \u043a\u043b\u0430\u0441\u0441 \u00abwill do the right thing\u00bb. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430. \u0418 UICollectionView \u2014 \u044f\u0440\u043a\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440. \u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0440\u0435\u043b\u0438\u0437\u0430 \u0432 iOS 6 \u0438 \u043f\u043e \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u0438\u0439 \u0434\u0435\u043d\u044c (iOS 7.0.4) \u043a\u043b\u0430\u0441\u0441 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0430\u0433\u043e\u0432, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043e\u0447\u0435\u043d\u044c \u0442\u0440\u0443\u0434\u043d\u043e \u0438 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u0434\u0435\u043b\u043e. \u041f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0443\u0433\u0430\u0434\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u0436\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u00ab\u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c\u00bb, \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0442\u044b\u043a\u0430 \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c UICollectionView \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043a\u0430\u043a \u043d\u0430\u0434\u043e. \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u0438\u043e\u0431\u0440\u0435\u0442\u0435\u043d\u043d\u044b\u0445 \u043a\u043e\u0441\u0442\u044b\u043b\u0435\u0439 \u0443\u0436\u0435 \u0434\u043e\u0441\u0442\u0438\u0433\u043b\u043e \u0442\u0430\u043a\u0438\u0445 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432, \u0447\u0442\u043e \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u043c\u0438 \u0431\u0430\u0433\u0430\u043c\u0438 \u0438 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u043c\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c\u0438.<\/p>\n<p>  \u041a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u2014 \u043c\u0438\u043b\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0441\u0438\u043c \u043f\u043e\u0434 \u043a\u0430\u0442.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-211144","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/211144","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=211144"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/211144\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=211144"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=211144"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=211144"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}