{"id":256262,"date":"2015-04-29T01:59:02","date_gmt":"2015-04-28T21:59:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=256262"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=256262","title":{"rendered":"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Parse [Swift]"},"content":{"rendered":"<p>     \t<b>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! \u041a\u0430\u043a \u0441\u0430\u043c?<\/b>  <\/p>\n<h5>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043e\u043f\u044b\u0442\u043e\u043c, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Swift \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0442\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 <a href=\"http:\/\/www.parse.com\">Parse<\/a>.<\/h5>\n<p>  \u041d\u0435 \u0431\u0443\u0434\u0443 \u0434\u043e\u043b\u0433\u043e \u0442\u043e\u043c\u0438\u0442\u044c \u043d\u0430\u0447\u043d\u0435\u043c, \u043f\u043e\u0436\u0430\u043b\u0443\u0439 \u0441 \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e. \u041a\u0440\u0430\u0442\u043a\u043e \u043e\u043f\u0438\u0448\u0443 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 <u>Parse<\/u>. \u0417\u0430\u0445\u043e\u0434\u0438\u043c <a href=\"http:\/\/www.parse.com\">\u0441\u044e\u0434\u0430<\/a>. \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c\u0441\u044f \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e Google.<br \/>  \u0412 Dashboard \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c Create New App.<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/cd0\/899\/c71\/cd0899c714974bba43a8b2dbd662385c.jpg\" alt=\"image\"\/><\/p>\n<p>  \u0414\u0430\u0434\u0438\u043c \u0435\u0439 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443\u2026 HabraLogin.<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/e58\/d16\/e85\/e58d16e858813bc930447a5a98456cd4.jpg\" alt=\"image\"\/><br \/>  \u0413\u043e\u0442\u043e\u0432\u043e! \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u043e\u0437\u0434\u0430\u043b\u043e\u0441\u044c. \u041d\u0430\u0432\u043e\u0434\u0438\u043c \u043d\u0430 \u043d\u0435\u0433\u043e, \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c Quickstart: <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Quickstart<\/b><\/p>\n<div class=\"spoiler_text\">Quickstart \u2014 \u0431\u044b\u0441\u0442\u0440\u0430\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430\/\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u0441 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u043c.  <\/div>\n<\/div>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u044b\u0431\u0435\u0440\u0435\u043c Data &gt; Mobile &gt; iOS &gt; Swift &gt; New Project.<br \/>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0432\u0441\u0435 \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u0432\u0430\u043c \u0434\u043e\u043b\u0436\u043d\u043e \u0432\u044b\u0441\u0432\u0435\u0442\u0438\u0442\u044c\u0441\u044f \u044d\u0442\u043e \u043c\u0435\u043d\u044e.<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/143\/f7b\/4ed\/143f7b4ed60a6fc5387c1dddc21ce782.jpg\" alt=\"image\"\/> \u041a\u0430\u0447\u0430\u0435\u043c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u043c \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 Parse. \u0417\u0430\u0445\u043e\u0434\u0438\u043c. \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 <i>AppDelegate<\/i>. <br \/>  \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u044f\u043c \u044d\u0442\u0438 \u0441\u0442\u0440\u043e\u043a\u0438:  <\/p>\n<pre><code class=\"smalltalk\">Parse.setApplicationId(&quot;1qvNmGQ0KuYAZdSTsV1lm26Xf6fBEq7D18vjCu1N&quot;,    clientKey: &quot;WkpnPrVw70dGAEiJtmPuVUXL9kapbBYnY5MoNUSO&quot;) <\/code><\/pre>\n<p>  <s>\u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043c\u0435\u043d\u044f\u0435\u0442\u0435 \u043a\u043b\u044e\u0447\u0438 \u043d\u0430 \u0441\u0432\u043e\u0438<\/s><br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442 \u0433\u043e\u0442\u043e\u0432 \u043a \u0440\u0430\u0431\u043e\u0442\u0435 \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d \u043a Parse.<br \/>  \u0418\u0434\u0435\u043c \u0434\u0430\u043b\u0435\u0435.\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 MainStoryboard \u0438 \u043d\u0430 \u0433\u043e\u0442\u043e\u0432\u044b\u0439 VC \u043a\u0438\u0434\u0430\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b:  <\/p>\n<ul>\n<li>textField <\/li>\n<li>textField<\/li>\n<li>textField<\/li>\n<li>Button<\/li>\n<\/ul>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0430\u0443\u0442\u043b\u0435\u0442\u044b \u043a \u043d\u0430\u0448\u0438\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c. \u041d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435 \u0443\u043a\u0430\u0437\u0430\u043d \u0438\u0445 \u0432\u0438\u0434 \u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0432 VC:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/cbd\/3a0\/7fa\/cbd3a07fa3c67de8835bc00cbee5d686.jpg\" alt=\"image\"\/><br \/>   \u0421\u043e\u0437\u0434\u0430\u0435\u043c Action \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u043a\u043d\u043e\u043f\u043a\u0438:   <\/p>\n<pre><code class=\"objectivec\">   @IBAction func SignUpButton(sender: UIButton) {         if cpasswordField.text == passwordField.text && loginField.text != nil && passwordField.text != nil {              var user = PFUser()             user.username = loginField.text             user.password = passwordField.text             user.signUpInBackgroundWithBlock {                 (succeeded: Bool, error: NSError?) -&gt; Void in                 if !(error != nil) {                                          println(&quot;error of register&quot;)                                      } else {                     println(&quot;register complete&quot;)                 }             }         } else {             println(&quot;error from filling fields&quot;)         }     } } <\/code><\/pre>\n<p>  \u0420\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u044e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e: \u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u0432\u0432\u0435\u0442\u043b\u0435\u043d\u0438\u0438 if, \u043c\u044b \u043e\u043f\u0438\u0441\u0430\u043b\u0438, \u0447\u0442\u043e \u043d\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044e, \u0435\u0441\u043b\u0438: <br \/>  1. \u041f\u043e\u043b\u044f \u043f\u0443\u0441\u0442\u044b\u0435<br \/>  2. \u041f\u0430\u0440\u043e\u043b\u044c \u043d\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0441 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435\u043c \u043f\u0430\u0440\u043e\u043b\u044f<br \/>  \u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043e \u0432\u0435\u0440\u043d\u043e, \u043d\u0430\u0441 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0442, \u0438\u043d\u0430\u0447\u0435 \u2014 \u0432\u044b\u0434\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0443 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438. \u041a\u0441\u0442\u0430\u0442\u0438, Parse \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0435 \u0432\u0430\u043c \u043c\u043e\u0436\u0435\u0442 <s>\u043f\u043e\u0434\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e\u0435.<\/s> \ud83d\ude42<\/p>\n<p>  \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f user \u0437\u0430\u0434\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 PFUser, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0424\u0443\u043d\u043a\u0446\u0438\u044f signUpInBackgroundWithBlock \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u043e\u0431\u043b\u0430\u043a\u0435 Parse. \u041f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 if \u2014 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f. \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443.<br \/>  \u0412\u0432\u043e\u0434\u0438\u043c \u043d\u0443\u0436\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u0437\u0430\u0445\u043e\u0434\u0438\u043c \u0432\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0443 Core, \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 Parse.<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/922\/130\/dad\/922130dad78cc2cc529686650043a571.jpg\" alt=\"image\"\/><br \/>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0432\u0441\u0435 \u043f\u0440\u0430\u0438\u0432\u043b\u044c\u043d\u043e, \u0443 \u0432\u0430\u0441 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f \u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 User. <\/p>\n<p>  \u041e\u0442\u043b\u0438\u0447\u043d\u043e, \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0430\u0441\u044c. \u041e\u0441\u0442\u0430\u043b\u0430\u0441\u044c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f. \u0412\u0435\u0434\u044c \u0442\u0430\u043a? <br \/>  \u0421\u043e\u0432\u0435\u0440\u0448\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f.<br \/>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c NavigationController \u043a \u043d\u0430\u0448\u0435\u043c\u0443 VC. \u0418 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c Button \u043d\u0430 View. \u0410 \u0442\u0430\u043a\u0436\u0435 \u043d\u043e\u0432\u044b\u0439, \u043f\u0443\u0441\u0442\u043e\u0439 View Controller. \u0412\u0441\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a: <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/361\/853\/7a4\/3618537a41fa4482251c4bbe026c1960.jpg\" alt=\"image\"\/><br \/>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0443\u0448 \u043e\u0442 \u043a\u043d\u043e\u043f\u043a\u0438 \u043a \u043d\u043e\u0432\u043e\u043c\u0443 VC. \u0423\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c <i>control<\/i> \u0438 \u0442\u044f\u043d\u0435\u043c \u043a VC. \u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c <b>push<\/b>. <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/6b6\/c48\/0a6\/6b6c480a66909b312d29260dc83308e6.jpg\" alt=\"image\"\/><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 Sign In \u043d\u0430\u0441 \u043a\u0438\u0434\u0430\u0435\u0442 \u0432 \u043e\u043a\u043d\u043e \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438.<br \/>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b UI:  <\/p>\n<ul>\n<li>textField <\/li>\n<li>textField <\/li>\n<li>Button<\/li>\n<\/ul>\n<p>  \u0414\u043b\u044f \u043d\u043e\u0432\u043e\u0433\u043e VC \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043b\u0430\u0441\u0441. New file &gt; Cocoa Touch Class. \u041d\u0430\u0437\u043e\u0432\u0435\u043c SignInViewController. Subclass: UIViewController.<br \/>  \u0412 \u043e\u043a\u043d\u0435 Identity Inspector \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043d\u0430\u0448 \u043a\u043b\u0430\u0441\u0441:<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/ffa\/704\/d8a\/ffa704d8a209d16c883c18de8385fc3d.jpg\" alt=\"image\"\/><br \/>  \u0414\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u043a\u0430\u043a \u0438 \u0441 \u043f\u0435\u0440\u0432\u044b\u043c VC. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0430\u0443\u0442\u043b\u0435\u0442\u044b, \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435. \u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c<\/p>\n<pre><code class=\"objectivec\">import Parse <\/code><\/pre>\n<p>\u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u043a\u043b\u0430\u0441\u0441\u0430.<br \/>  \u0418 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043a\u043d\u043e\u043f\u043a\u0438 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c: <\/p>\n<pre><code class=\"objectivec\"> @IBAction func siginact(sender: UIButton) {         PFUser.logInWithUsernameInBackground(loginfield.text, password:passwordfield.text) {             (user: PFUser?, error: NSError?) -&gt; Void in             if user != nil {  println(&quot;succes&quot;)             } else { println(&quot;failed&quot;)             }         }     } <\/code><\/pre>\n<p>  \u0422\u0443\u0442 \u0432\u0441\u0435 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0449\u0435. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c!<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/5d2\/b9a\/2bf\/5d2b9a2bf2ecc5c40b62b2ef2abbbcdc.jpg\" alt=\"image\"\/><br \/>  \u0413\u043e\u0442\u043e\u0432\u043e! \u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u0415\u0435 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u043f\u0440\u043e\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0442 \u0432\u0430\u0441. \u041d\u0430\u0434\u0435\u044e\u0441\u044c \u044f \u0432\u0430\u043c \u0445\u043e\u0442\u044c \u0447\u0435\u043c-\u0442\u043e \u043f\u043e\u043c\u043e\u0433. \u0412\u0441\u0435\u043c \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0445 \u043a\u043e\u0434\u043e\u0432! \ud83d\ude09<a name=\"habracut\"><\/a>     \t<\/p>\n<div class=\"clear\"><\/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\/256897\/\"> http:\/\/habrahabr.ru\/post\/256897\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>     \t<b>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! \u041a\u0430\u043a \u0441\u0430\u043c?<\/b>  <\/p>\n<h5>\u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043e\u043f\u044b\u0442\u043e\u043c, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Swift \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0442\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 <a href=\"http:\/\/www.parse.com\">Parse<\/a>.<\/h5>\n<p>  \u041d\u0435 \u0431\u0443\u0434\u0443 \u0434\u043e\u043b\u0433\u043e \u0442\u043e\u043c\u0438\u0442\u044c \u043d\u0430\u0447\u043d\u0435\u043c, \u043f\u043e\u0436\u0430\u043b\u0443\u0439 \u0441 \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e. \u041a\u0440\u0430\u0442\u043a\u043e \u043e\u043f\u0438\u0448\u0443 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 <u>Parse<\/u>. \u0417\u0430\u0445\u043e\u0434\u0438\u043c <a href=\"http:\/\/www.parse.com\">\u0441\u044e\u0434\u0430<\/a>. \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c\u0441\u044f \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e Google.<br \/>  \u0412 Dashboard \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c Create New App.<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/cd0\/899\/c71\/cd0899c714974bba43a8b2dbd662385c.jpg\" alt=\"image\"\/><\/p>\n<p>  \u0414\u0430\u0434\u0438\u043c \u0435\u0439 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443\u2026 HabraLogin.<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/e58\/d16\/e85\/e58d16e858813bc930447a5a98456cd4.jpg\" alt=\"image\"\/><br \/>  \u0413\u043e\u0442\u043e\u0432\u043e! \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u043e\u0437\u0434\u0430\u043b\u043e\u0441\u044c. \u041d\u0430\u0432\u043e\u0434\u0438\u043c \u043d\u0430 \u043d\u0435\u0433\u043e, \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c Quickstart: <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Quickstart<\/b><\/p>\n<div class=\"spoiler_text\">Quickstart \u2014 \u0431\u044b\u0441\u0442\u0440\u0430\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430\/\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u0441 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u043c.  <\/div>\n<\/div>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u044b\u0431\u0435\u0440\u0435\u043c Data &gt; Mobile &gt; iOS &gt; Swift &gt; New Project.<br \/>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0432\u0441\u0435 \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u0432\u0430\u043c \u0434\u043e\u043b\u0436\u043d\u043e \u0432\u044b\u0441\u0432\u0435\u0442\u0438\u0442\u044c\u0441\u044f \u044d\u0442\u043e \u043c\u0435\u043d\u044e.<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/143\/f7b\/4ed\/143f7b4ed60a6fc5387c1dddc21ce782.jpg\" alt=\"image\"\/> \u041a\u0430\u0447\u0430\u0435\u043c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u043c \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 Parse. \u0417\u0430\u0445\u043e\u0434\u0438\u043c. \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 <i>AppDelegate<\/i>. <br \/>  \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u044f\u043c \u044d\u0442\u0438 \u0441\u0442\u0440\u043e\u043a\u0438:  <\/p>\n<pre><code class=\"smalltalk\">Parse.setApplicationId(&quot;1qvNmGQ0KuYAZdSTsV1lm26Xf6fBEq7D18vjCu1N&quot;,    clientKey: &quot;WkpnPrVw70dGAEiJtmPuVUXL9kapbBYnY5MoNUSO&quot;) <\/code><\/pre>\n<p>  <s>\u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043c\u0435\u043d\u044f\u0435\u0442\u0435 \u043a\u043b\u044e\u0447\u0438 \u043d\u0430 \u0441\u0432\u043e\u0438<\/s><br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442 \u0433\u043e\u0442\u043e\u0432 \u043a \u0440\u0430\u0431\u043e\u0442\u0435 \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d \u043a Parse.<br \/>  \u0418\u0434\u0435\u043c \u0434\u0430\u043b\u0435\u0435.\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 MainStoryboard \u0438 \u043d\u0430 \u0433\u043e\u0442\u043e\u0432\u044b\u0439 VC \u043a\u0438\u0434\u0430\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b:  <\/p>\n<ul>\n<li>textField <\/li>\n<li>textField<\/li>\n<li>textField<\/li>\n<li>Button<\/li>\n<\/ul>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0430\u0443\u0442\u043b\u0435\u0442\u044b \u043a \u043d\u0430\u0448\u0438\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c. \u041d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435 \u0443\u043a\u0430\u0437\u0430\u043d \u0438\u0445 \u0432\u0438\u0434 \u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0432 VC:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/cbd\/3a0\/7fa\/cbd3a07fa3c67de8835bc00cbee5d686.jpg\" alt=\"image\"\/><br \/>   \u0421\u043e\u0437\u0434\u0430\u0435\u043c Action \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u043a\u043d\u043e\u043f\u043a\u0438:   <\/p>\n<pre><code class=\"objectivec\">   @IBAction func SignUpButton(sender: UIButton) {         if cpasswordField.text == passwordField.text &#038;& loginField.text != nil &#038;& passwordField.text != nil {              var user = PFUser()             user.username = loginField.text             user.password = passwordField.text             user.signUpInBackgroundWithBlock {                 (succeeded: Bool, error: NSError?) -&gt; Void in                 if !(error != nil) {                                          println(&quot;error of register&quot;)                                      } else {                     println(&quot;register complete&quot;)                 }             }         } else {             println(&quot;error from filling fields&quot;)         }     } } <\/code><\/pre>\n<p>  \u0420\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u044e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e: \u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u0432\u0432\u0435\u0442\u043b\u0435\u043d\u0438\u0438 if, \u043c\u044b \u043e\u043f\u0438\u0441\u0430\u043b\u0438, \u0447\u0442\u043e \u043d\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044e, \u0435\u0441\u043b\u0438: <br \/>  1. \u041f\u043e\u043b\u044f \u043f\u0443\u0441\u0442\u044b\u0435<br \/>  2. \u041f\u0430\u0440\u043e\u043b\u044c \u043d\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0441 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435\u043c \u043f\u0430\u0440\u043e\u043b\u044f<br \/>  \u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043e \u0432\u0435\u0440\u043d\u043e, \u043d\u0430\u0441 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0442, \u0438\u043d\u0430\u0447\u0435 \u2014 \u0432\u044b\u0434\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0443 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438. \u041a\u0441\u0442\u0430\u0442\u0438, Parse \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0435 \u0432\u0430\u043c \u043c\u043e\u0436\u0435\u0442 <s>\u043f\u043e\u0434\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e\u0435.<\/s> \ud83d\ude42<\/p>\n<p>  \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f user \u0437\u0430\u0434\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 PFUser, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0424\u0443\u043d\u043a\u0446\u0438\u044f signUpInBackgroundWithBlock \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u043e\u0431\u043b\u0430\u043a\u0435 Parse. \u041f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 if \u2014 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f. \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443.<br \/>  \u0412\u0432\u043e\u0434\u0438\u043c \u043d\u0443\u0436\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u0437\u0430\u0445\u043e\u0434\u0438\u043c \u0432\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0443 Core, \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 Parse.<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/922\/130\/dad\/922130dad78cc2cc529686650043a571.jpg\" alt=\"image\"\/><br \/>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0432\u0441\u0435 \u043f\u0440\u0430\u0438\u0432\u043b\u044c\u043d\u043e, \u0443 \u0432\u0430\u0441 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f \u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 User. <\/p>\n<p>  \u041e\u0442\u043b\u0438\u0447\u043d\u043e, \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0430\u0441\u044c. \u041e\u0441\u0442\u0430\u043b\u0430\u0441\u044c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f. \u0412\u0435\u0434\u044c \u0442\u0430\u043a? <br \/>  \u0421\u043e\u0432\u0435\u0440\u0448\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f.<br \/>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c NavigationController \u043a \u043d\u0430\u0448\u0435\u043c\u0443 VC. \u0418 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c Button \u043d\u0430 View. \u0410 \u0442\u0430\u043a\u0436\u0435 \u043d\u043e\u0432\u044b\u0439, \u043f\u0443\u0441\u0442\u043e\u0439 View Controller. \u0412\u0441\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a: <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/361\/853\/7a4\/3618537a41fa4482251c4bbe026c1960.jpg\" alt=\"image\"\/><br \/>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0443\u0448 \u043e\u0442 \u043a\u043d\u043e\u043f\u043a\u0438 \u043a \u043d\u043e\u0432\u043e\u043c\u0443 VC. \u0423\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c <i>control<\/i> \u0438 \u0442\u044f\u043d\u0435\u043c \u043a VC. \u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c <b>push<\/b>. <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/6b6\/c48\/0a6\/6b6c480a66909b312d29260dc83308e6.jpg\" alt=\"image\"\/><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 Sign In \u043d\u0430\u0441 \u043a\u0438\u0434\u0430\u0435\u0442 \u0432 \u043e\u043a\u043d\u043e \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438.<br \/>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b UI:  <\/p>\n<ul>\n<li>textField <\/li>\n<li>textField <\/li>\n<li>Button<\/li>\n<\/ul>\n<p>  \u0414\u043b\u044f \u043d\u043e\u0432\u043e\u0433\u043e VC \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043b\u0430\u0441\u0441. New file &gt; Cocoa Touch Class. \u041d\u0430\u0437\u043e\u0432\u0435\u043c SignInViewController. Subclass: UIViewController.<br \/>  \u0412 \u043e\u043a\u043d\u0435 Identity Inspector \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043d\u0430\u0448 \u043a\u043b\u0430\u0441\u0441:<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/ffa\/704\/d8a\/ffa704d8a209d16c883c18de8385fc3d.jpg\" alt=\"image\"\/><br \/>  \u0414\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u043a\u0430\u043a \u0438 \u0441 \u043f\u0435\u0440\u0432\u044b\u043c VC. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0430\u0443\u0442\u043b\u0435\u0442\u044b, \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435. \u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c<\/p>\n<pre><code class=\"objectivec\">import Parse <\/code><\/pre>\n<p>\u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u043a\u043b\u0430\u0441\u0441\u0430.<br \/>  \u0418 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043a\u043d\u043e\u043f\u043a\u0438 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c: <\/p>\n<pre><code class=\"objectivec\"> @IBAction func siginact(sender: UIButton) {         PFUser.logInWithUsernameInBackground(loginfield.text, password:passwordfield.text) {             (user: PFUser?, error: NSError?) -&gt; Void in             if user != nil {  println(&quot;succes&quot;)             } else { println(&quot;failed&quot;)             }         }     } <\/code><\/pre>\n<p>  \u0422\u0443\u0442 \u0432\u0441\u0435 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0449\u0435. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c!<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/5d2\/b9a\/2bf\/5d2b9a2bf2ecc5c40b62b2ef2abbbcdc.jpg\" alt=\"image\"\/><br \/>  \u0413\u043e\u0442\u043e\u0432\u043e! \u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u0415\u0435 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u043f\u0440\u043e\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0442 \u0432\u0430\u0441. \u041d\u0430\u0434\u0435\u044e\u0441\u044c \u044f \u0432\u0430\u043c \u0445\u043e\u0442\u044c \u0447\u0435\u043c-\u0442\u043e \u043f\u043e\u043c\u043e\u0433. \u0412\u0441\u0435\u043c \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0445 \u043a\u043e\u0434\u043e\u0432! \ud83d\ude09<\/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-256262","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/256262","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=256262"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/256262\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=256262"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=256262"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=256262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}