{"id":221519,"date":"2014-05-01T00:21:04","date_gmt":"2014-04-30T20:21:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=221519"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=221519","title":{"rendered":"<span class=\"post_title\">Sapper: Royal Engineer<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u0425\u0430\u0431\u0440\u0430\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438, \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e!<\/p>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u043e\u0441\u0442\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u00ab\u0438\u0441\u0442\u043e\u0440\u0438\u044e\u00bb \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0432\u043e\u0439 \u043d\u0430\u0448\u0435\u0439 \u0438\u0433\u0440\u044b: \u043a\u0430\u043a \u0440\u0438\u0441\u043e\u0432\u0430\u043b\u0441\u044f \u0434\u0438\u0437\u0430\u0439\u043d, \u043a\u0430\u043a \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b\u0438, \u0441 \u043a\u0430\u043a\u0438\u043c\u0438 \u0442\u0440\u0443\u0434\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c, \u043f\u043e\u0447\u0435\u043c\u0443 StackOverflow \u043b\u0443\u0447\u0448\u0435 Apple Dev Forums \u0438 \u0442.\u0434. <br \/>  \u0418\u0433\u0440\u0430 \u0434\u0435\u043b\u0430\u043b\u0430\u0441\u044c \u0441 \u0446\u0435\u043b\u044c\u044e \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u0432 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0434\u0438\u0437\u0430\u0439\u043d\u0435\u0440\u043e\u043c, \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0438\u0433\u0440\u0430\u0445, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0443\u0434\u0438\u0442\u0435 \u0441\u0442\u0440\u043e\u0433\u043e (\u043d\u0430 \u0441\u0442\u043e\u043b\u044c\u043a\u043e, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e).<\/p>\n<p>  \u041a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0434\u043b\u044f \u043f\u0440\u0438\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/4d1\/9d1\/798\/4d19d179813519723c870d75635e800e.jpg\" alt=\"image\"\/> <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/5cb\/85a\/5f9\/5cb85a5f9b399c9b3bb6dbdaf701cb43.jpg\" alt=\"image\"\/> <\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/d4d\/480\/79d\/d4d48079da67acb9e1024b4e3c1f2ccf.jpg\" alt=\"image\"\/> <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/a2b\/054\/b2d\/a2b054b2d03e0396196918f83a26abe1.jpg\" alt=\"image\"\/><\/p>\n<p>  <a name=\"habracut\"><\/a><\/p>\n<h4>\u0421 \u0447\u0435\u0433\u043e \u0432\u0441\u0451 \u043d\u0430\u0447\u0430\u043b\u043e\u0441\u044c?<\/h4>\n<p>  \u0422\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u043d\u0430 \u043d\u043e\u0432\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435, \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c, \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u0438\u0433\u0440 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043e\u0432. \u0420\u0430\u0431\u043e\u0442\u0430\u043b \u044f \u0441 \u0442\u0430\u043b\u0430\u043d\u0442\u043b\u0438\u0432\u044b\u043c \u0434\u0438\u0437\u0430\u0439\u043d\u0435\u0440\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0435\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u0438\u0433\u0440\u044b (\u043d\u0430 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b, \u043f\u043e\u0434 PC, XBox \u0438 \u0442.\u0434). \u0412\u043e\u0442 \u043c\u044b \u0441 \u043d\u0438\u043c \u0438 \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435, \u043d\u043e \u0432 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u043b\u043e\u0436\u043d\u043e\u0435, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0448\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043d\u0435 \u0437\u0430\u0442\u044f\u043d\u0443\u043b\u0430\u0441\u044c \u043d\u0430 4-5-6 \u043c\u0435\u0441\u044f\u0446\u0435\u0432. \u041d\u0438 \u044f, \u043d\u0438 \u043e\u043d \u043d\u0435 \u0431\u044b\u043b\u0438 \u0433\u043e\u0442\u043e\u0432\u044b \u043a \u0442\u0430\u043a\u043e\u043c\u0443 \u0437\u0430\u0442\u044f\u0436\u043d\u043e\u043c\u0443 \u043f\u0440\u044b\u0436\u043a\u0443. <\/p>\n<p>  \u0421\u0430\u043f\u0451\u0440 \u0431\u044b\u043b \u043d\u0435 \u0442\u043e\u0439 \u0438\u0434\u0435\u0435\u0439 \u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u0445\u043e\u0442\u0435\u043b\u0438 \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u0437\u044f\u0442\u044c\u0441\u044f.<\/p>\n<p>  \u0412\u043e\u0442, \u0437\u0430 \u0447\u0442\u043e \u043c\u044b \u0445\u043e\u0442\u0435\u043b\u0438 \u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u043d\u043e \u0440\u0430\u0434\u044b \u043e\u0447\u0435\u043d\u044c, \u0447\u0442\u043e \u0432\u043e\u0432\u0440\u0435\u043c\u044f \u0432\u0435\u0440\u043d\u043e \u043e\u0446\u0435\u043d\u0438\u043b\u0438 \u043d\u0430\u0448\u0438 \u0441\u0438\u043b\u044b:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/69b\/373\/512\/69b373512bfe3d0f84ed1d0b37f18dc4.jpg\" alt=\"image\"\/><\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/899\/2d3\/351\/8992d3351c30c2c24fae06c3cd531619.jpg\" alt=\"image\"\/><\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/980\/166\/4ef\/9801664ef8d44386b3d4082565b21182.jpg\" alt=\"image\"\/><\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/9f0\/4ef\/31e\/9f04ef31eb4a4ede343aa678c9b1857f.jpg\" alt=\"image\"\/><\/p>\n<p>  \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445 \u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u0440\u0430\u0442\u044c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u043b\u043e\u0436\u043d\u0443\u044e \u0438\u0433\u0440\u0443 \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u044f \u043d\u0435 \u043c\u043e\u0433 \u0435\u0449\u0435 \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 SpriteKit \u0438 \u043e\u0447\u0435\u043d\u044c \u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0432 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438 \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u0444\u0438\u0447\u0443 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0440\u0435\u0437 \u043f\u0435\u043d\u044c-\u043a\u043e\u043b\u043e\u0434\u0443.<\/p>\n<p>  \u041d\u0430 StackOverflow \u044f \u0432\u0438\u0434\u0435\u043b, \u0447\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f Cocos2D \u0441\u0430\u043c\u0438\u043c \u0430\u0432\u0442\u043e\u0440\u043e\u043c (LearnCocos2D), \u043d\u043e \u043c\u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e SpriteKit \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Apple \u0438 \u043f\u043e\u043a\u0430\u0437\u0430 \u0438\u0433\u0440\u044b <a href=\"https:\/\/developer.apple.com\/Library\/ios\/documentation\/GraphicsAnimation\/Conceptual\/CodeExplainedAdventure\/AdventureArchitecture\/AdventureArchitecture.html#\/\/apple_ref\/doc\/uid\/TP40013140\">Adventure<\/a>. \u041e\u0433\u043e\u0440\u0447\u0438\u043b \u043c\u0435\u043d\u044f \u043f\u0440\u0430\u0432\u0434\u0430 \u0442\u043e\u0442 \u0444\u0430\u043a\u0442, \u0447\u0442\u043e \u0432 XCode \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0447\u0430\u0441\u0442\u0438\u0446, \u0430 \u044f XCode \u0445\u043e\u0447\u0443 \u0440\u0435\u0436\u0435 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c.<\/p>\n<h4>\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b<\/h4>\n<p>  \u041d\u0430 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0445 \u044d\u0442\u0430\u043f\u0430\u0445 \u0441\u0432\u044f\u0437\u043a\u0430 XCode + AppCode, Photoshop.<br \/>  \u041f\u043e\u0442\u043e\u043c \u0442\u043e\u043b\u044c\u043a\u043e AppCode \u0438 Photoshop.<\/p>\n<p>  \u041f\u0440\u043e SpriteKit \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/developer.apple.com\/library\/ios\/documentation\/GraphicsAnimation\/Conceptual\/SpriteKit_PG\/Introduction\/Introduction.html\">\u0437\u0434\u0435\u0441\u044c<\/a> \u0438\u043b\u0438 <a href=\"http:\/\/devstreaming.apple.com\/videos\/wwdc\/2013\/503xbx3xoaktjug4e05xvl04\/503\/503-HD.mov?dl=1\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<h4>\u0414\u0438\u0437\u0430\u0439\u043d (\u0440\u0435\u0442\u0438\u043d\u0430, \u043d\u0435 \u0440\u0435\u0442\u0438\u043d\u0430, 4 \u0438 5 iPhone)<\/h4>\n<p>  \u042f \u0441\u0440\u0430\u0437\u0443 \u0431\u044b\u043b \u0437\u0430 \u0442\u043e, \u0447\u0442\u043e\u0431\u044b 4 iPhone \u043c\u044b \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u043b\u0438 \u0438 \u043d\u0435 \u043f\u0430\u0440\u0438\u043b\u0438\u0441\u044c \u0441 \u0435\u0449\u0435 \u043a\u0443\u0447\u0435\u0439 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0443 \u043d\u0430\u0441 \u0438 \u0442\u0430\u043a \u0431\u044b\u043b\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438\u0437-\u0437\u0430 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0420\u0430\u0437 \u043e\u0442\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u043e\u0442 4 \u0438 \u0432\u0441\u0435\u0433\u043e, \u0447\u0442\u043e \u043d\u0438\u0436\u0435, \u0437\u043d\u0430\u0447\u0438\u0442 \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0434\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434 \u0440\u0435\u0442\u0438\u043d\u0443 \u2014 \u043e\u0442\u043b\u0438\u0447\u043d\u043e!<\/p>\n<p>  \u0412\u043e\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b \u043d\u0430\u0448 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/12b\/35f\/e97\/12b35fe972caf16f721cf59c0b12c89d.jpg\"\/> <\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/dce\/9f3\/93f\/dce9f393fccd307da86f6301d42edd5e.jpg\"\/><\/p>\n<p>  \u0414\u0430\u043b\u044c\u0448\u0435 \u043c\u044b \u0437\u0430\u0434\u0430\u0432\u0430\u043b\u0438\u0441\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u0438\u043c\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u043c\u0438:  <\/p>\n<ul>\n<li> \u0414\u043e\u043b\u0436\u043d\u0430 \u043b\u0438 \u0431\u044b\u0442\u044c \u0440\u0435\u043a\u043b\u0430\u043c\u0430 \u043d\u0430 \u0438\u0433\u0440\u043e\u0432\u043e\u043c \u044d\u043a\u0440\u0430\u043d\u0435 \u0438 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u0438\u0433\u0440\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435? <\/li>\n<li> \u0423\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043b\u0438 \u043f\u0440\u0438 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0435 \u0444\u043e\u043d\u043e\u0432\u043e\u0433\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u0438 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0440\u0435\u043a\u043b\u0430\u043c\u043d\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430? <\/li>\n<li> \u0414\u043e\u043b\u0436\u043d\u0430 \u043b\u0438 \u0431\u044b\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0430 \u00ab\u041c\u0435\u043d\u044e\u00bb \u0438\u043b\u0438 \u0436\u0435 \u043a\u043d\u043e\u043f\u043a\u0430 \u00ab\u041d\u0430\u0437\u0430\u0434\u00bb? <\/li>\n<li> \u0427\u0442\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u044b\u0438\u0433\u0440\u0430\u043b \u0438\u043b\u0438 \u043f\u0440\u043e\u0438\u0433\u0440\u0430\u043b? <\/li>\n<li> \u0438 \u0442.\u0434.<\/li>\n<\/ul>\n<p>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0443\u0436\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/bff\/771\/c28\/bff771c282e3fe7efec9caae25744e83.jpg\"\/><\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/296\/ea0\/25a\/296ea025a7f1d5ce5f410eba7b744e24.jpg\"\/><\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/fd9\/a60\/b9e\/fd9a60b9ecaf1675717e5774a340c558.jpg\"\/><\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0434\u0438\u0437\u0430\u0439\u043d\u0435\u0440\u0443 \u0432\u043e\u043b\u044e, \u043d\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0439\u0442\u0435. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0448\u0440\u0438\u0444\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0434\u043b\u044f \u043d\u0430\u0434\u043f\u0438\u0441\u0435\u0439 \u0437\u0430\u0442\u0440\u0430\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u043a\u043e\u043b-\u0432\u0430 \u0431\u043e\u043c\u0431 \u043d\u0430 \u043f\u043e\u043b\u0435, \u043d\u0435\u0442 \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u043c \u0441\u043f\u0438\u0441\u043a\u0435, \u0437\u043d\u0430\u0447\u0438\u0442 \u043d\u0430\u0434\u043e \u0438\u0441\u043a\u0430\u0442\u044c \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435. \u041d\u043e \u044d\u0442\u043e \u0435\u0449\u0435 \u043d\u0438\u0447\u0435\u0433\u043e, \u0434\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430\u0434\u043e \u0435\u0449\u0435 \u043d\u0430\u0439\u0442\u0438 _\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439_ \u0448\u0440\u0438\u0444\u0442 \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0437\u0430 \u043d\u0430\u0434\u043f\u0438\u0441\u044c\u044e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0444\u043e\u043d\u043e\u0432\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0441 4 \u0441\u0435\u0440\u044b\u043c\u0438 \u0446\u0438\u0444\u0440\u0430\u043c\u0438 \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u043c\u0438 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438, \u0430 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u043c\u044b \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u043d\u0430\u0434\u043f\u0438\u0441\u0438 \u0441 \u00ab111\u00bb \u0434\u043e \u00ab888\u00bb \u0448\u0438\u0440\u0438\u043d\u0430 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0439 \u043d\u0430\u0434\u043f\u0438\u0441\u0438 (UILabel) \u0438\u0437\u043c\u0435\u043d\u044f\u043b\u0430\u0441\u044c \u0438 \u043c\u0435\u043d\u044f\u043b\u043e\u0441\u044c \u0441\u0430\u043c\u043e \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u043c\u0438, \u0447\u0442\u043e \u043d\u0430\u0441 \u043d\u0435 \u0443\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043b\u043e\u2026 \u043e\u0434\u043d\u0430\u043a\u043e, \u043d\u0443\u0436\u043d\u044b\u0439 \u0448\u0440\u0438\u0444\u0442 \u0431\u044b\u043b \u043d\u0430\u0439\u0434\u0435\u043d, \u0441\u043b\u0430\u0432\u0430 \u0411\u043e\u0433\u0443, \u0438\u043d\u0430\u0447\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0431\u044b \u0434\u0435\u043b\u0430\u0442\u044c 10 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0441\u0447\u0435\u0442\u0447\u0438\u043a \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c. \u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0448\u0440\u0438\u0444\u0442, \u043d\u043e \u0443\u0432\u044b, \u043d\u0435 \u0432\u0441\u0451 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e (\u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u00ab\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430\u00bb \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u0447\u0442\u043e \u0435\u0449\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e \u0431\u044b\u043b\u043e \u0441\u043e \u0448\u0440\u0438\u0444\u0442\u043e\u043c \u044d\u0442\u0438\u043c).<\/p>\n<p>  \u0421\u043e \u0441\u043f\u0440\u0430\u0439\u0442\u0430\u043c\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043d\u0435 \u0431\u044b\u043b\u043e \u043d\u0438\u043a\u0430\u043a\u0438\u0445. \u0411\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043d\u0430\u043c \u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u043b \u0443\u0434\u043e\u0432\u043e\u043b\u044c\u0441\u0442\u0432\u0438\u0435 \u0432\u043e\u0442 \u044d\u0442\u043e\u0442 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u044c:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/202\/04e\/7bb\/20204e7bbba1246124323ce3742ca30f.png\"\/> <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/c7f\/22c\/5d1\/c7f22c5d17c6ded0033679df4a1d41a2.png\"\/><\/p>\n<p>  \u0422\u0440\u0438 \u0432\u0435\u0449\u0438 \u043d\u0430\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0434\u0438\u0437\u0430\u0439\u043d\u0435\u0440 \u0434\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u043b:  <\/p>\n<ul>\n<li> \u0424\u043e\u043d\u043e\u0432\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e \u044d\u043a\u0440\u0430\u043d\u0430 <\/li>\n<li> \u0424\u043e\u043d\u043e\u0432\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u044d\u043a\u0440\u0430\u043d\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a <\/li>\n<li> \u0410\u043d\u0438\u043c\u0430\u0446\u0438\u044f \u0432\u0437\u0440\u044b\u0432\u0430 \u0431\u043e\u043c\u0431\u044b <\/li>\n<\/ul>\n<p>  \u0410\u043d\u0438\u043c\u0430\u0446\u0438\u044f \u0432\u0437\u0440\u044b\u0432\u0430 \u0431\u043e\u043c\u0431\u044b \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 40 \u043a\u0430\u0434\u0440\u043e\u0432 (\u043d\u0430 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0435 \u043d\u0438\u0436\u0435 \u0434\u0432\u0430 \u0442\u0438\u043f\u0430 \u0432\u0437\u0440\u044b\u0432\u0430).<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/e13\/04b\/e3d\/e1304be3db43d314e7887943ed12221a.png\"\/><\/p>\n<p>  \u0421\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u043c\u044b \u0441 \u0434\u0438\u0437\u0430\u0439\u043d\u0435\u0440\u043e\u043c \u0435\u0449\u0435 \u0441 \u043e\u0434\u043d\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043a\u043e\u0439 \u2014 \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u0439. \u0414\u043b\u044f \u043d\u0435\u0433\u043e \u044d\u0442\u043e \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043d\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e, \u043f\u0438\u043a\u0441\u0435\u043b\u044c \u0432\u043b\u0435\u0432\u043e, \u043f\u0438\u043a\u0441\u0435\u043b\u044c \u0432\u043f\u0440\u0430\u0432\u043e \u2014 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u2026 \u043e\u043d \u0440\u0438\u0441\u0443\u0435\u0442 \u0432\u0441\u0451 \u0431\u0435\u0437 \u043b\u0438\u043d\u0435\u0435\u043a, \u0443\u0436 \u0442\u0430\u043a\u043e\u0439 \u0432\u043e\u0442 \u0442\u0432\u043e\u0440\u0447\u0435\u0441\u043a\u0438\u0439 \u0447\u0435\u043b\u043e\u0432\u0435\u043a \ud83d\ude42<br \/>  \u041c\u0435\u043d\u044f \u044d\u0442\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0443\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043b, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043d\u0435 \u043a\u0430\u043a-\u0442\u043e \u043d\u0430\u0434\u043e, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u043d\u0443\u0436\u043d\u044b \u0445\u043e\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b\/\u0440\u0430\u0437\u043c\u0435\u0440\u044b.<\/p>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u043a\u0430\u043a-\u0442\u043e \u0442\u0430\u043a:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/18c\/cb3\/2b3\/18ccb32b3deb5d894ea0d1f31a02d0df.jpg\"\/><\/p>\n<p>  \u0423\u0434\u043e\u0431\u043d\u043e, \u043d\u043e \u0447\u0442\u043e-\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u043d\u0435 \u0442\u0430\u043a, \u043c\u0435\u043d\u044f \u043d\u0435 \u043f\u043e\u043a\u0438\u0434\u0430\u0435\u0442 \u0442\u0430\u043a\u043e\u0435 \u0447\u0443\u0432\u0441\u0442\u0432\u043e.<\/p>\n<h4>\u0417\u0432\u0443\u043a\u0438<\/h4>\n<p>  \u0421\u043e \u0437\u0432\u0443\u043a\u0430\u043c\u0438 \u0442\u043e\u0436\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u0434\u0438\u0437\u0430\u0439\u043d\u0435\u0440\u0443. \u041c\u044b \u043d\u0430\u0448\u043b\u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0441\u0430\u0439\u0442 <a href=\"http:\/\/www.freesound.org\/\">www.freesound.org\/<\/a> \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0432\u0443\u043a\u0438 (\u0441\u043e\u0432\u0441\u0435\u043c \u0431\u0435\u0437 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u2014 \u043e\u0431\u0440\u0435\u0437\u0430\u043d\u0438\u0435, \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f):<\/p>\n<ul>\n<li> \u0412\u0437\u0440\u044b\u0432 <\/li>\n<li> \u041e\u0442\u043a\u0430\u043f\u044b\u0432\u0430\u043d\u0438\u0435 <\/li>\n<li> \u041d\u0430\u0436\u0430\u0442\u0438\u0435 \u043d\u0430 \u043b\u044e\u0431\u043e\u0439 \u00ab\u043a\u043d\u043e\u043f\u043e\u0447\u043d\u044b\u0439\u00bb \u044d\u043b\u0435\u043c\u0435\u043d\u0442 <\/li>\n<\/ul>\n<h4>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430<\/h4>\n<p>  \u041d\u0430\u0447\u0438\u043d\u0430\u043b\u043e\u0441\u044c \u0432\u0441\u0451 \u0441\u043e \u0441\u0442\u043e\u0440\u0438\u0431\u043e\u0440\u0434\u043e\u0432:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/0f6\/a05\/fdb\/0f6a05fdb85ea2cf70f18b291a5758e7.png\"\/><\/p>\n<p>  \u0417\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u043e\u0441\u044c:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/b5d\/bcb\/f67\/b5dbcbf67c6dfaed992b254feb874e26.png\"\/><\/p>\n<p>  \u041f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u2026 \u0445\u0435\u0440\u043d\u044f \u043f\u043e\u043b\u043d\u0430\u044f. \u0421\u043e\u0437\u0434\u0430\u0435\u0448\u044c \u043a\u0430\u0440\u043a\u0430\u0441, \u0430 \u0434\u0430\u043b\u044c\u0448\u0435 \u043d\u0430 \u043d\u0435\u0433\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0448\u044c \u043d\u0430\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b, \u043b\u043e\u0433\u0438\u043a\u0443, \u0433\u0440\u0430\u0444\u0438\u043a\u0443 \u0438 \u0442.\u0434. \u041e\u0442 \u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u043e \u043a\u043e\u043d\u0446\u0430 \u0443 \u043c\u0435\u043d\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0435 \u043c\u0435\u043d\u044f\u043b\u0430\u0441\u044c, \u043d\u043e \u0441\u0445\u0435\u043c\u044b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438 \u043b\u043e\u0433\u0438\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u2014 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437.<\/p>\n<p>  \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e \u044d\u043a\u0440\u0430\u043d\u0430. \u0414\u0432\u0435 \u043a\u043d\u043e\u043f\u043a\u0438, \u043f\u043e \u0442\u0430\u043f\u0443 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d \u0438\u0433\u0440\u044b \u0438 \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438. \u0411\u0430\u0440\u0430\u0431\u0430\u043d\u043d\u0430\u044f \u0434\u0440\u043e\u0431\u044c\u2026 \u043f\u043e \u0442\u0430\u043f\u0443 \u0435\u0449\u0435 \u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u0432\u0443\u043a, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u0437\u0434\u0435\u0441\u044c \u043b\u0438\u0431\u043e SystemSound, \u043b\u0438\u0431\u043e AVAudioPlayer (\u043b\u0438\u0431\u043e \u0435\u0449\u0435 \u0447\u0442\u043e-\u0442\u043e), \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u043d\u0443\u0436\u043d\u0430 \u043f\u0440\u0435\u0434\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u043d\u0443\u0436\u0435\u043d \u0435\u0449\u0435 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b \u043e\u0442\u0432\u0435\u0447\u0430\u043b \u0437\u0430 \u043f\u0440\u0435\u0434\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0432\u0441\u0435\u0445 \u0437\u0432\u0443\u043a\u043e\u0432 \u0438 \u0438\u0445 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435. \u0422\u0430\u043a \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u2014 BGAudioPreloader.<\/p>\n<pre><code class=\"objectivec\">@interface BGResourcePreloader : NSObject &lt;AVAudioPlayerDelegate&gt;  + (instancetype)shared;  \/\/ \u043f\u0440\u0435\u0434\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0430\u0443\u0434\u0438\u043e \u0444\u0430\u0439\u043b \u0438 \u0433\u043e\u0442\u043e\u0432\u0438\u0442 \u0435\u0433\u043e \u043a \u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u043d\u0438\u044e - (void)preloadAudioResource:(NSString *)name;  \/\/ \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0430\u0443\u0434\u0438\u043e\u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u043b\u044f \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0430\u0443\u0434\u0438\u043e \u0444\u0430\u0439\u043b\u0430 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c name \u0438 \/\/ \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c type \/\/ nil - \u0435\u0441\u043b\u0438 \u0437\u0432\u0443\u043a\u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u044b - (AVAudioPlayer *)playerFromGameConfigForResource:(NSString *)name;  \/\/ \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0430\u0443\u0434\u0438\u043e\u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u043b\u044f \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0430\u0443\u0434\u0438\u043e \u0444\u0430\u0439\u043b\u0430 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c name \u0438 \/\/ \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c type. \u041d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0437\u0432\u0443\u043a\u0430 - (AVAudioPlayer *)playerForResource:(NSString *)name;  @end <\/code><\/pre>\n<p>  \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u043e\u0442 \u0442\u0430\u043a\u0430\u044f:  <\/p>\n<pre><code class=\"objectivec\">\/\/ \/\/  BGResourcePreloader.m \/\/  Miner \/\/ \/\/  Created by AndrewShmig on 4\/5\/14. \/\/  Copyright (c) 2014 Bleeding Games. All rights reserved. \/\/  #import &quot;BGResourcePreloader.h&quot; #import &quot;BGSettingsManager.h&quot;   @implementation BGResourcePreloader {     NSMutableDictionary *_data; }  #pragma mark - Class methods  static BGResourcePreloader *shared;  + (instancetype)shared {     static dispatch_once_t once;      dispatch_once(&once, ^{         shared = [[self alloc] init];         shared-&gt;_data = [[NSMutableDictionary alloc] init];     });      return shared; }  #pragma mark - Instance methods  - (void)preloadAudioResource:(NSString *)name {     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{         NSString *soundPath = [[NSBundle mainBundle]                                          pathForResource:name                                                   ofType:nil];         NSURL *soundURL = [NSURL fileURLWithPath:soundPath];         AVAudioPlayer *player = [[AVAudioPlayer alloc]                                                 initWithContentsOfURL:soundURL                                                                 error:nil];         [player prepareToPlay];          _data[name] = player;     }); }  - (AVAudioPlayer *)playerFromGameConfigForResource:(NSString *)name {     \/\/    \u0437\u0432\u0443\u043a\u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u044b     if ([BGSettingsManager sharedManager].soundStatus == BGMinerSoundStatusOff)         return nil;      return [self BGPrivate_playerForResource:name]; }  - (AVAudioPlayer *)playerForResource:(NSString *)name {     return [self BGPrivate_playerForResource:name]; }  #pragma mark - AVAudioDelegate  - (void)audioPlayerBeginInterruption:(AVAudioPlayer *)player {     [player stop];     player.currentTime = 0.0; }  #pragma mark - Private method  - (AVAudioPlayer *)BGPrivate_playerForResource:(NSString *)name {     return (AVAudioPlayer *) _data[name]; }  @end  <\/code><\/pre>\n<p>  \u041d\u0430 \u0433\u043b\u0430\u0432\u043d\u043e\u043c \u044d\u043a\u0440\u0430\u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e. <\/p>\n<p>  \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u044d\u043a\u0440\u0430\u043d\u0443 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a.<\/p>\n<p>  \u0423 \u043d\u0430\u0441 \u0442\u0443\u0442 \u0441\u0440\u0430\u0437\u0443 UISegmentedControl (\u043f\u043e\u0445\u043e\u0436\u0438\u0439) \u0438 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u044c (UIButton).<br \/>  \u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c, \u043a\u0430\u043a \u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434 \u0441 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c UISegmentedControl \u044f \u043e\u0447\u0435\u043d\u044c \u0442\u0449\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0440\u044b\u043b StackOverflow \u0438 \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u043b\u0443\u0447\u0448\u0435 \u043d\u0435 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u0430 \u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0441\u0451-\u0442\u0430\u043a\u0438 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u2026 \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e, \u043d\u043e \u043a\u043e\u0435-\u043a\u0430\u043a\u0438\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0435\u0441\u0442\u044c (\u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u044f \u0442\u0430\u043a\u043e\u0432, \u0447\u0442\u043e \u0434\u0430\u0436\u0435 \u0432\u043e\u0434\u044f \u043f\u0430\u043b\u044c\u0446\u0435\u0432 \u043f\u043e \u043d\u0435\u043c\u0443, \u043e\u043f\u0446\u0438\u044f \u0430\u043a\u0442\u0438\u0432\u0430\u044f \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0442 \u0442\u043e\u0433\u043e, \u0433\u0434\u0435 \u0432\u044b \u043f\u043e\u0434\u043d\u044f\u043b\u0438 \u043f\u0430\u043b\u0435\u0446, \u043d\u043e \u0438 \u043e\u0442 \u0442\u043e\u0433\u043e, \u0433\u0434\u0435 \u0441\u0435\u0439\u0447\u0430\u0441 \u0432\u0430\u0448 \u043f\u0430\u043b\u0435\u0446 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f).<\/p>\n<p>  \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u044f \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"objectivec\">#pragma mark - Touches  - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {     [self updateSegmentedControlUsingTouches:touches]; }  - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {     [self updateSegmentedControlUsingTouches:touches]; }  - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {     [self updateSegmentedControlUsingTouches:touches]; }  #pragma mark - Private method  - (void)updateSegmentedControlUsingTouches:(NSSet *)touches {     UITouch *touch = [touches anyObject];     CGPoint touchPoint = [touch locationInView:self];      for (NSUInteger i = 0; i &lt; _selectedSegments.count; i++) {         CGRect rect = ((UIImageView *) _selectedSegments[i]).frame;          if (CGRectContainsPoint(rect, touchPoint)) {              if (self.selectedSegmentIndex != i) {                 \/\/    \u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u0435\u043c \u0437\u0432\u0443\u043a \u043d\u0430\u0436\u0430\u0442\u0438\u044f - \u0435\u0434\u0438\u043d\u043e\u0436\u0434\u044b \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043d\u043e\u0432\u043e\u043c                 \/\/                \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0438                 [[[BGResourcePreloader shared]                                        playerFromGameConfigForResource:@&quot;buttonTap.mp3&quot;]                                        play];             }              self.selectedSegmentIndex = i;              break;         }     }      [_target performSelector:_action                   withObject:@(_selectedSegmentIndex)]; } <\/code><\/pre>\n<p>  \u0412\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442.<\/p>\n<p>  \u041b\u044e\u0431\u0438\u043c\u044b\u0439 \u043d\u0430\u0448 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u2014 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u044c. \u0421\u043f\u0435\u0440\u0432\u0430 \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u0430\u044f \u043a\u043d\u043e\u043f\u043a\u0430, \u043d\u043e \u043c\u0435\u043d\u044f \u044d\u0442\u043e \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0431\u0435\u0441\u0438\u043b\u043e \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043e\u0449\u0443\u0449\u0435\u043d\u0438\u044f \u043d\u0435 \u0442\u0435 \u0438 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0447\u0443\u0432\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u043e\u043d \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u0430\u043a, \u043a\u0430\u043a \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439.<\/p>\n<p>  \u0412 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u043c\u0438:  <\/p>\n<pre><code class=\"objectivec\">#pragma mark - Touches  - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { \/\/    \u043d\u0435 \u043d\u0430\u0434\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u0435 }  - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {     BGLog();      [self updateActiveRegionUsingTouches:touches];      if ((self.isOn && self.activeRegion == BGUISwitchLeftRegion) ||             (!self.isOn && self.activeRegion == BGUISwitchRightRegion)) {          [super touchesMoved:touches withEvent:event];         [self playSwitchSound];          [_target performSelector:_action withObject:self];          self.on = !self.on;     } }  - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {     BGLog();      [self updateActiveRegionUsingTouches:touches];      if ((self.isOn && self.activeRegion == BGUISwitchLeftRegion) ||             (!self.isOn && self.activeRegion == BGUISwitchRightRegion)) {          [super touchesEnded:touches withEvent:event];         [self playSwitchSound];         [_target performSelector:_action withObject:self];          self.on = !self.on;     } }  - (void)updateActiveRegionUsingTouches:(NSSet *)touches {     UITouch *touch = [touches anyObject];     CGPoint touchPoint = [touch locationInView:self];     CGRect leftRect = CGRectMake(0, 0, self.bounds.size.width \/ 2, self.bounds.size.height);     CGRect rightRect = CGRectMake(self.bounds.size.width \/ 2, 0, self.bounds.size.width \/ 2, self.bounds.size.height);       if (CGRectContainsPoint(leftRect, touchPoint)) {         _activeRegion = BGUISwitchLeftRegion;     } else if (CGRectContainsPoint(rightRect, touchPoint)) {         _activeRegion = BGUISwitchRightRegion;     } else {         _activeRegion = BGUISwitchNoneRegion;     } } <\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043c\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043d\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0432 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a. \u041c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0440\u0435\u043b\u0438\u0437\u043d\u0443\u0442\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438) \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0434\u0435\u0440\u044c\u043c\u043e\u0432\u044b\u043c, \u043f\u043e\u0442\u043e\u043c \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043d\u043e\u0432\u044b\u0439, \u043d\u043e \u043f\u043e\u043a\u0430 \u043d\u0435 \u0437\u0430\u043c\u0435\u043d\u0438\u043b.<\/p>\n<p>  \u0412\u043e\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u043e\u0432\u043e\u0433\u043e \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a:  <\/p>\n<pre><code class=\"objectivec\">static NSString* const kBGSettingManagerUserDefaultsStoreKeyForMainSettings = @&quot;kBGSettingsManagerUserDefaultsStoreKeyForMainSettings&quot;; static NSString* const kBGSettingManagerUserDefaultsStoreKeyForDefaultSettings = @&quot;kBGSettingsManagerUserDefaultsStoreKeyForDefaultSettings&quot;;   \/\/ Class allows to work with app settings in a simple and flexible way. @interface BGSettingsManager : NSObject  \/\/ Delimiters for setting paths. Defaults to &quot;.&quot; (dot) character. @property (nonatomic, readwrite, strong) NSCharacterSet *pathDelimiters; \/\/ Boolean value which specifies if exception should be thrown if settings path \/\/ doesn't exist or they are incorrect. Defaults to YES. @property (nonatomic, readwrite, assign) BOOL throwExceptionForUnknownPath;  + (instancetype)shared;  \/\/ creates default settings which are not used as main settings until \/\/ resetToDefaultSettings method is called \/\/ example: [[BGSettingsManager shared] createDefaultSettingsFromDictionary:@{@&quot;user&quot;:@{@&quot;login&quot;:@&quot;Andrew&quot;, @&quot;password&quot;:@&quot;1234&quot;}}] - (void)createDefaultSettingsFromDictionary:(NSDictionary *)settings; \/\/ resets main settings to default settings - (void)resetToDefaultSettings; \/\/ clears\/removes all settings - main and default - (void)clear;  \/\/ adding new setting value for settingPath \/\/ example: [... setValue:@YES forSettingsPath:@&quot;user.personalInfo.married&quot;]; - (void)setValue:(id)value forSettingsPath:(NSString *)settingPath;  \/\/ return setting value with specified type - (id)valueForSettingsPath:(NSString *)settingsPath; - (BOOL)boolValueForSettingsPath:(NSString *)settingsPath; - (NSInteger)integerValueForSettingsPath:(NSString *)settingsPath; - (NSUInteger)unsignedIntegerValueForSettingsPath:(NSString *)settingsPath; - (CGFloat)floatValueForSettingsPath:(NSString *)settingsPath; - (NSString *)stringValueForSettingsPath:(NSString *)settingsPath; - (NSArray *)arrayValueForSettingsPath:(NSString *)settingsPath; - (NSDictionary *)dictionaryValueForSettingsPath:(NSString *)settingsPath; - (NSData *)dataValueForSettingsPath:(NSString *)settingsPath;  @end <\/code><\/pre>\n<p>  \u0427\u0430\u0441\u0442\u044c \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439:  <\/p>\n<pre><code class=\"objectivec\">\/\/ \/\/ Copyright (C) 4\/27\/14  Andrew Shmig ( andrewshmig@yandex.ru ) \/\/ Russian Bleeding Games. All rights reserved. \/\/ \/\/ Permission is hereby granted, free of charge, to any person \/\/ obtaining a copy of this software and associated documentation \/\/ files (the &quot;Software&quot;), to deal in the Software without \/\/ restriction, including without limitation the rights to use, \/\/ copy, modify, merge, publish, distribute, sublicense, and\/or \/\/ sell copies of the Software, and to permit persons to whom the \/\/ Software is furnished to do so, subject to the following \/\/ conditions: \/\/ \/\/ The above copyright notice and this permission notice shall be \/\/ included in all copies or substantial portions of the Software. \/\/ \/\/ THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, \/\/ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES \/\/ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. \/\/ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE \/\/ FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION \/\/ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN \/\/ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN \/\/ THE SOFTWARE. \/\/  #import &quot;BGSettingsManager.h&quot;   @implementation BGSettingsManager {     NSMutableDictionary *_defaultSettings;     NSMutableDictionary *_settings; }  #pragma mark - Class methods  + (instancetype)shared {     static dispatch_once_t once;     static BGSettingsManager *shared;      dispatch_once(&once, ^{         shared = [[self alloc] init];         shared-&gt;_pathDelimiters = [NSCharacterSet characterSetWithCharactersInString:@&quot;.&quot;];         shared-&gt;_throwExceptionForUnknownPath = YES;          [shared BGPrivateMethod_loadExistingSettings];     });      return shared; }  #pragma mark - Instance methods  - (void)createDefaultSettingsFromDictionary:(NSDictionary *)settings {     _defaultSettings = [self BGPrivateMethod_deepMutableCopy:settings];      [self BGPrivateMethod_saveSettings]; }  - (void)resetToDefaultSettings {     _settings = [_defaultSettings mutableCopy];      [self BGPrivateMethod_saveSettings]; }  - (void)clear {     _settings = [NSMutableDictionary new];     _defaultSettings = [NSMutableDictionary new];      [self BGPrivateMethod_saveSettings]; }   - (void)setValue:(id)value forSettingsPath:(NSString *)settingPath {     NSArray *settingsPathComponents = [settingPath componentsSeparatedByCharactersInSet:self             .pathDelimiters];     __block id currentNode = _settings;      [settingsPathComponents enumerateObjectsUsingBlock:^(id pathComponent,                                                          NSUInteger idx,                                                          BOOL *stop) {          id nextNode = currentNode[pathComponent];          BOOL nextNodeIsNil = (nextNode == nil);         BOOL nextNodeIsDictionary = [nextNode isKindOfClass:[NSMutableDictionary class]];         BOOL lastPathComponent = (idx == [settingsPathComponents count] - 1);          if ((nextNodeIsNil || !nextNodeIsDictionary) && !lastPathComponent) {              [currentNode setObject:[NSMutableDictionary new]                             forKey:pathComponent];         } else if (idx == [settingsPathComponents count] - 1) {              if ([value isKindOfClass:[NSNumber class]])                 currentNode[pathComponent] = [value copy];             else                 currentNode[pathComponent] = [value mutableCopy];         }          currentNode = currentNode[pathComponent];     }];      [self BGPrivateMethod_saveSettings]; }  - (id)valueForSettingsPath:(NSString *)settingsPath {     NSArray *settingsPathComponents = [settingsPath componentsSeparatedByCharactersInSet:self             .pathDelimiters];     __block id currentNode = _settings;     __block id valueForSettingsPath = nil;      [settingsPathComponents enumerateObjectsUsingBlock:^(id obj,                                                          NSUInteger idx,                                                          BOOL *stop) {  \/\/        we have a nil node for a path component which is not the last one \/\/        or a node which is not a leaf node         if ((nil == currentNode && idx != [settingsPathComponents count]) ||                 (currentNode != nil && ![currentNode isKindOfClass:[NSDictionary class]])) {              [self BGPrivateMethod_throwExceptionForInvalidSettingsPath];         }          NSString *key = obj;         id nextNode = currentNode[key];          if (nil == nextNode) {             *stop = YES;         } else {             if (![nextNode isKindOfClass:[NSMutableDictionary class]])                 valueForSettingsPath = nextNode;         }          currentNode = nextNode;     }];      return valueForSettingsPath; }  - (BOOL)boolValueForSettingsPath:(NSString *)settingsPath {     return [[self valueForSettingsPath:settingsPath] boolValue]; }  - (NSInteger)integerValueForSettingsPath:(NSString *)settingsPath {     return [[self valueForSettingsPath:settingsPath] integerValue]; }  - (NSUInteger)unsignedIntegerValueForSettingsPath:(NSString *)settingsPath {     return (NSUInteger) [[self valueForSettingsPath:settingsPath] integerValue]; }  - (CGFloat)floatValueForSettingsPath:(NSString *)settingsPath {     return [[self valueForSettingsPath:settingsPath] floatValue]; }  - (NSString *)stringValueForSettingsPath:(NSString *)settingsPath {     return (NSString *) [self valueForSettingsPath:settingsPath]; }  - (NSArray *)arrayValueForSettingsPath:(NSString *)settingsPath {     return (NSArray *) [self valueForSettingsPath:settingsPath]; }  - (NSDictionary *)dictionaryValueForSettingsPath:(NSString *)settingsPath {     return (NSDictionary *) [self valueForSettingsPath:settingsPath]; }  - (NSData *)dataValueForSettingsPath:(NSString *)settingsPath {     return (NSData *) [self valueForSettingsPath:settingsPath]; }   - (NSString *)description {     return [_settings description]; }  #pragma mark - Private methods  - (void)BGPrivateMethod_saveSettings {     [[NSUserDefaults standardUserDefaults]                      setValue:_settings                        forKey:kBGSettingManagerUserDefaultsStoreKeyForMainSettings];     [[NSUserDefaults standardUserDefaults]                      setValue:_defaultSettings                        forKey:kBGSettingManagerUserDefaultsStoreKeyForDefaultSettings];      [[NSUserDefaults standardUserDefaults] synchronize]; }  - (void)BGPrivateMethod_loadExistingSettings {     id settings = [[NSUserDefaults standardUserDefaults]                                    valueForKey:kBGSettingManagerUserDefaultsStoreKeyForMainSettings];     id defaultSettings = [[NSUserDefaults standardUserDefaults]                                           valueForKey:kBGSettingManagerUserDefaultsStoreKeyForDefaultSettings];      _settings = (settings ? settings : [NSMutableDictionary new]);     _defaultSettings = (defaultSettings ? defaultSettings : [NSMutableDictionary new]); }  - (NSMutableDictionary *)BGPrivateMethod_deepMutableCopy:(NSDictionary *)settings {     NSMutableDictionary *deepMutableCopy = [settings mutableCopy];      [settings enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {         if ([obj isKindOfClass:[NSDictionary class]])             deepMutableCopy[key] = [self BGPrivateMethod_deepMutableCopy:obj];         else             deepMutableCopy[key] = obj;     }];      return deepMutableCopy; }  - (void)BGPrivateMethod_throwExceptionForInvalidSettingsPath {     if (self.throwExceptionForUnknownPath)         [NSException raise:@&quot;Invalid settings path.&quot;                     format:@&quot;Some of your setting path components may intersect incorrectly or they don't exist.&quot;]; }  @end <\/code><\/pre>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u0438, \u043a\u0430\u043a \u044f \u043f\u043e\u0442\u043e\u043c \u0432\u044b\u044f\u0441\u043d\u0438\u043b \u0438 \u043f\u043e\u043d\u044f\u043b, \u0443\u0434\u043e\u0431\u043d\u043e:  <\/p>\n<pre><code class=\"objectivec\">\/\/    CODE -- begin     BGSettingsManager *settingsManager = [BGSettingsManager shared];      [settingsManager createDefaultSettingsFromDictionary:@{             @&quot;user&quot;: @{                     @&quot;info&quot;:@{                             @&quot;name&quot;: @&quot;Andrew&quot;,                             @&quot;surname&quot;: @&quot;Shmig&quot;,                             @&quot;age&quot;: @22                     }             }     }];      [settingsManager resetToDefaultSettings];      [settingsManager setValue:@&quot;+7 920 930 87 56&quot;               forSettingsPath:@&quot;user.info.contacts.phone&quot;];      NSLog(@&quot;%@&quot;, settingsManager);      [settingsManager clear];      NSLog(@&quot;%@&quot;, settingsManager); \/\/    CODE - end <\/code><\/pre>\n<p>  \u0412 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0442\u0430\u043a\u043e\u0439 \u0432\u044b\u0432\u043e\u0434:<\/p>\n<pre><code class=\"objectivec\">2014-04-30 23:45:03.842 BGUtilityLibrary[13730:70b] {     user =     {         info =         {             age = 22;             contacts =             {                 phone = &quot;+7 920 930 87 56&quot;;             };             name = Andrew;             surname = Shmig;         };     }; } 2014-04-30 23:45:03.847 BGUtilityLibrary[13730:70b] { } <\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0438\u0433\u0440\u043e\u0432\u043e\u043c\u0443 \u044d\u043a\u0440\u0430\u043d\u0443. \u042d\u0442\u043e\u0442 \u044d\u043a\u0440\u0430\u043d \u0441\u0442\u0430\u043b \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u043f\u043e-\u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u043c\u0443 \u00ab\u043a\u0440\u043e\u0432\u0430\u0432\u044b\u043c\u00bb\u2026 \u0434\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435, \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 \u00ab\u0418\u0433\u0440\u0430\u0442\u044c\u00bb, \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u043b \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430 \u0438\u0433\u0440\u043e\u0432\u043e\u0439 \u044d\u043a\u0440\u0430\u043d \u0438 \u0442\u0430\u043c, \u0432 viewDidLoad \u043c\u0435\u0442\u043e\u0434\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u0435 (SKScene), \u043d\u043e \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430 \u0431\u044b\u043b\u0430 \u0442\u0430\u043a\u043e\u0439 \u0431\u043e\u043b\u044c\u0448\u043e\u0439, \u0447\u0442\u043e \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0437\u0430\u0434\u0430\u0442\u044c\u0441\u044f \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u043c\u0438:<\/p>\n<ul>\n<li> \u041f\u043e\u043c\u043e\u0436\u0435\u0442 \u043b\u0438 \u043f\u0440\u0435\u0434\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0441\u043f\u0440\u0430\u0439\u0442\u043e\u0432? <\/li>\n<li> \u041f\u043e\u043c\u043e\u0436\u0435\u0442 \u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0435\u0434\u0438\u043d\u043e\u0439 SKNode, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u043f\u0440\u0430\u0439\u0442\u043e\u0432 \u0432 \u043d\u0435\u0451 \u0438 \u043b\u0438\u0448\u044c \u043f\u043e\u0442\u043e\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 SKScene? <\/li>\n<\/ul>\n<p>  \u041d\u0430 \u043e\u0431\u0430 \u0432\u043e\u043f\u0440\u043e\u0441\u0430 \u043e\u0442\u0432\u0435\u0442 \u00ab\u041d\u0435\u0442\u00bb. \u041f\u0435\u0440\u0432\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441 \u0432\u044b\u0442\u0435\u043a\u0430\u0435\u0442 \u0438\u0437 \u0432\u0442\u043e\u0440\u043e\u0433\u043e\u2026 \u0432\u0441\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e addChild: \u043c\u0435\u0442\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0440\u0430\u0439\u043d\u0435 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e, \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u0434\u043e \u0441\u0442\u0430\u0440\u0430\u0442\u044c\u0441\u044f \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043d\u0430 \u0441\u0446\u0435\u043d\u0435 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044c\u0448\u0435 \u043d\u043e\u0434. \u0424\u041f\u0421 \u043a\u0441\u0442\u0430\u0442\u0438 \u0443 \u043c\u0435\u043d\u044f \u043d\u0430 \u0441\u0438\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 30 \u043d\u0435 \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u043b\u0441\u044f, \u0434\u0435\u0432\u0430\u0439\u0441 \u0436\u0435 \u0432\u044b\u0434\u0430\u0432\u0430\u043b \u0447\u0438\u0441\u0442\u044b\u0435 60.<\/p>\n<p>  \u041c\u0435\u0442\u043e\u0434\u043e\u043c \u043d\u0430\u0443\u0447\u043d\u043e\u0433\u043e \u0442\u044b\u043a\u0430 \u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u0430\u043c\u0438 \u043d\u0430 SO:<br \/>  1. <a href=\"https:\/\/stackoverflow.com\/questions\/23027173\/skspritenode-takes-too-much-time-to-be-created-from-texture\">SKSpriteNode takes too much time to be created from texture<\/a><br \/>  2. <a href=\"https:\/\/stackoverflow.com\/questions\/23070591\/strange-thing-happens-with-skspritenode-with-transparent-borders\">Strange thing happens with SKSpriteNode with transparent borders<\/a> (\u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u0443, \u043d\u043e \u0442\u043e\u0436\u0435 \u043e\u0447\u0435\u043d\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442)<\/p>\n<p>  \u041f\u0440\u0438\u0448\u0435\u043b \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043b \u0438\u0433\u0440\u043e\u0432\u043e\u0439 \u044d\u043a\u0440\u0430\u043d \u0432 \u0432\u0438\u0434\u0435 \u0441\u0438\u043d\u0433\u043b\u0442\u043e\u043d\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043f\u043e\u043b\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0440\u0430\u0432\u043e\u0439 (\u043d\u0438\u0436\u043d\u0438\u0439 \u0441\u043b\u043e\u0439 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043b\u0438\u0448\u044c \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0430\u0436\u0430\u043b \u043d\u0430 \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u044f\u0447\u0435\u0439\u043a\u0443\u2026 \u044d\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0435\u0449\u0435 \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0438 \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0441 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0436\u0435 \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u043f\u0430\u0441\u0442\u044c \u043d\u0430 \u043c\u0438\u043d\u0443).<br \/>  \u0412\u0441\u0435 \u0441\u043f\u0440\u0430\u0439\u0442\u044b \u043f\u0440\u0435\u0434\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u044e\u0442\u0441\u044f, \u0434\u0430\u043b\u0435\u0435 \u2014 \u043a\u043e\u043f\u0438\u0440\u0443\u044e\u0442\u0441\u044f, \u0430 \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u0437\u0430\u043d\u043e\u0432\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u043f\u0440\u0430\u0439\u0442\u0430 \u0441 \u0443\u0436\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u043e\u0439 \u0432 \u043f\u0430\u043c\u044f\u0442\u044c \u0442\u0435\u043a\u0441\u0442\u0443\u0440\u044b \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u043c \u0438 \u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u043c\u0443 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e.<br \/>  \u0417\u0432\u0443\u043a\u0438 \u0442\u043e\u0436\u0435 \u043f\u043e\u0434\u0433\u0440\u0443\u0436\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:  <\/p>\n<pre><code class=\"objectivec\">\/\/    \u043f\u0440\u0435\u0434\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0437\u0432\u0443\u043a\u043e\u0432 \u0432 \u0444\u043e\u043d\u043e\u0432\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435 \u0434\u043b\u044f \u0438\u0437\u0431\u0435\u0436\u0430\u043d\u0438\u044f \u0437\u0430\u0442\u043e\u0440\u043c\u0430\u0436\u0438\u0432\u0430\u043d\u0438\u044f     NSArray *audioResources = @[@&quot;switchON.mp3&quot;,                                 @&quot;switchOFF.mp3&quot;,                                 @&quot;flagTapOn.mp3&quot;,                                 @&quot;grassTap.mp3&quot;,                                 @&quot;buttonTap.mp3&quot;,                                 @&quot;flagTapOff.mp3&quot;,                                 @&quot;explosion.wav&quot;];      for (NSString *audioName in audioResources) {         [[BGResourcePreloader shared] preloadAudioResource:audioName];     } <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u043f\u043e\u043b\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f (\u043f\u0435\u0440\u0435\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0441\u043f\u0440\u0430\u0439\u0442\u0430\u043c\u0438), \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438 \u0431\u044b\u0441\u0442\u0440\u043e\u043c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u043b\u043e \u0437\u0430\u0434\u0435\u0440\u0436\u0435\u043a.<\/p>\n<p>  \u0412 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u043e \u0434\u0438\u0437\u0430\u0439\u043d\u0435 \u044f \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b, \u0447\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u043c\u0438 \u0448\u0440\u0438\u0444\u0442\u0430\u043c\u0438 \u0435\u0449\u0435 \u0442\u043e \u0432\u0435\u0441\u0435\u043b\u044c\u0435 \u2014 \u0442\u0430\u043a \u0438 \u0435\u0441\u0442\u044c. \u041c\u0430\u043b\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0448\u0440\u0438\u0444\u0442\u0430 != \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044e \u0444\u0430\u0439\u043b\u0430 \u0441\u043e \u0448\u0440\u0438\u0444\u0442\u043e\u043c, \u0442\u0430\u043a \u0435\u0449\u0435 \u0431\u0435\u0437 \u043f\u0440\u0435\u0434\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0448\u0440\u0438\u0444\u0442\u0430 \u044d\u0442\u0430 \u0437\u0430\u0440\u0430\u0437\u0430 \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u0442\u043e\u0440\u043c\u043e\u0437\u0438\u0442 (\u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u0432\u0441\u0435 \u0441\u043a\u0440\u0438\u043d\u044b \u0438\u0437 Instruments \u0443\u0436\u0435 \u0434\u0430\u0432\u043d\u043e \u0443\u0434\u0430\u043b\u0435\u043d\u044b, \u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043d\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u0442\u0440\u0443\u0434\u0430).<\/p>\n<p>  \u041f\u043e\u043b\u0435 \u0443 \u043c\u0435\u043d\u044f \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f (\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f) \u0432\u043e\u0442 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:  <\/p>\n<pre><code class=\"objectivec\">- (void)generateFieldWithExcludedCellInCol:(NSUInteger)cellCol                                        row:(NSUInteger)cellRow {     BGLog();      \/\/        \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043a\u043b\u0435\u0442\u043e\u043a     NSMutableArray *cells = [NSMutableArray new];  \/\/        \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043f\u043e\u043b\u0435 \u043f\u0443\u0441\u0442\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438     _field = [NSMutableArray new];      for (NSUInteger i = 0; i &lt; self.cols; i++) {         [_field addObject:[NSMutableArray new]];          for (NSUInteger j = 0; j &lt; self.rows; j++) {             [_field[i] addObject:@(BGFieldEmpty)];  \/\/                \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u044f\u0447\u0435\u0439\u043a\u0443 \u0432 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e, \u0435\u0441\u043b\u0438 \u043e\u043d\u0430 \u043d\u0435 &quot;\u0437\u0430\u043f\u0440\u0435\u0449\u0435\u043d\u0430&quot;             if (!(i == cellCol && j == cellRow))                 [cells addObject:@(i * kBGPrime + j)];         }     }  \/\/        \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c \u0431\u043e\u043c\u0431\u044b \u043d\u0430 \u043f\u043e\u043b\u0435     sranddev();      for (NSUInteger i = 0; i &lt; self.bombs; i++) {         NSUInteger index = arc4random() % [cells count];          NSUInteger randomCell = [cells[index] unsignedIntegerValue];         NSUInteger col = randomCell \/ kBGPrime;         NSUInteger row = randomCell % kBGPrime;          _field[col][row] = @(BGFieldBomb);  \/\/            \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u043a\u043b\u0435\u0442\u043a\u0443         [cells removeObjectAtIndex:index];     }  \/\/        \u0440\u0430\u0441\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0446\u0438\u0444\u0440\u044b     _x = @[@0, @1, @1, @1, @0, @(-1), @(-1), @(-1)];     _y = @[@(-1), @(-1), @0, @1, @1, @1, @0, @(-1)];      for (NSUInteger i = 0; i &lt; self.cols; i++) {         for (NSUInteger j = 0; j &lt; self.rows; j++) {             NSInteger cellValue = [_field[i][j] integerValue];             NSInteger count = 0;              if (cellValue == BGFieldEmpty) {                 for (NSUInteger k = 0; k &lt; _x.count; k++) {                     NSInteger newY = i + [_x[k] integerValue];                     NSInteger newX = j + [_y[k] integerValue];                      if (newX &gt;= 0 && newY &gt;= 0 && newX &lt; self.rows && newY &lt; self.cols) {                         if ([_field[(NSUInteger) newY][(NSUInteger) newX] integerValue] == BGFieldBomb) {                             count++;                         }                     }                 }                  _field[i][j] = @(count);             }         }     } } <\/code><\/pre>\n<p>  \u0412 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u0434\u0435\u0442\u0430\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 SKAction, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043a\u0430\u0436\u0443\u0442\u0441\u044f \u0443\u0434\u043e\u0431\u043d\u044b\u043c\u0438, \u043d\u043e \u0432 \u0441\u0430\u043f\u0451\u0440\u0435 \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u0438\u0445 \u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0447\u0438\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u0434, \u043d\u043e \u0443\u0432\u044b\u2026 \u044d\u0442\u043e \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0442\u0440\u0443\u0434\u043e\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c.<\/p>\n<h4>App Store<\/h4>\n<p>  \u041a\u043e\u0440\u043e\u0442\u043a\u043e \u0438 \u044f\u0441\u043d\u043e:<\/p>\n<p>  <img decoding=\"async\" src=\"\/\/habrastorage.org\/files\/c9c\/6fc\/a6b\/c9c6fca6bf704358ba2c50eecf4f911e.png\"\/><\/p>\n<h4>\u041a\u043e\u043d\u0435\u0446<\/h4>\n<p>  \u0412\u0441\u0435\u043c \u0441\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435.<\/p>\n<p>  \u041b\u044e\u0431\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0438 \u0441 \u0443\u0434\u043e\u0432\u043e\u043b\u044c\u0441\u0442\u0432\u0438\u0435\u043c \u043e\u0442\u0432\u0435\u0447\u0443 \u043d\u0430 \u043d\u0438\u0445. \u0415\u0441\u043b\u0438 \u0447\u0442\u043e \u0437\u0430\u0431\u044b\u043b \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u2014 \u043f\u0438\u0448\u0438\u0442\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\/221519\/\"> http:\/\/habrahabr.ru\/post\/221519\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u0425\u0430\u0431\u0440\u0430\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438, \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e!<\/p>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u043e\u0441\u0442\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u00ab\u0438\u0441\u0442\u043e\u0440\u0438\u044e\u00bb \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0432\u043e\u0439 \u043d\u0430\u0448\u0435\u0439 \u0438\u0433\u0440\u044b: \u043a\u0430\u043a \u0440\u0438\u0441\u043e\u0432\u0430\u043b\u0441\u044f \u0434\u0438\u0437\u0430\u0439\u043d, \u043a\u0430\u043a \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b\u0438, \u0441 \u043a\u0430\u043a\u0438\u043c\u0438 \u0442\u0440\u0443\u0434\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c, \u043f\u043e\u0447\u0435\u043c\u0443 StackOverflow \u043b\u0443\u0447\u0448\u0435 Apple Dev Forums \u0438 \u0442.\u0434. <br \/>  \u0418\u0433\u0440\u0430 \u0434\u0435\u043b\u0430\u043b\u0430\u0441\u044c \u0441 \u0446\u0435\u043b\u044c\u044e \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u043e\u0432 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0434\u0438\u0437\u0430\u0439\u043d\u0435\u0440\u043e\u043c, \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0438\u0433\u0440\u0430\u0445, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0443\u0434\u0438\u0442\u0435 \u0441\u0442\u0440\u043e\u0433\u043e (\u043d\u0430 \u0441\u0442\u043e\u043b\u044c\u043a\u043e, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e).<\/p>\n<p>  \u041a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0434\u043b\u044f \u043f\u0440\u0438\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/4d1\/9d1\/798\/4d19d179813519723c870d75635e800e.jpg\" alt=\"image\"\/> <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/5cb\/85a\/5f9\/5cb85a5f9b399c9b3bb6dbdaf701cb43.jpg\" alt=\"image\"\/> <\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/d4d\/480\/79d\/d4d48079da67acb9e1024b4e3c1f2ccf.jpg\" alt=\"image\"\/> <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/a2b\/054\/b2d\/a2b054b2d03e0396196918f83a26abe1.jpg\" alt=\"image\"\/><\/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-221519","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/221519","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=221519"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/221519\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=221519"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=221519"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=221519"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}