Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Tidy.

  • Loading branch information...
commit c714e1b12f62d98a8032cb726a3b8e7cabb09c0b 1 parent f2b1913
Igor Sutton authored

Showing 1 changed file with 48 additions and 48 deletions. Show diff stats Hide diff stats

  1. +48 48 TKPost.m
96 TKPost.m
@@ -23,36 +23,36 @@
23 23 #import "TKPost.h"
24 24
25 25 static NSString *TKPostTypeFromTumblrAsString[] =
26   -{
27   - @"",
28   - @"regular",
29   - @"link",
30   - @"quote",
31   - @"photo",
32   - @"conversation",
33   - @"video",
34   - @"audio",
35   - @"answer"
36   -};
  26 + {
  27 + @"",
  28 + @"regular",
  29 + @"link",
  30 + @"quote",
  31 + @"photo",
  32 + @"conversation",
  33 + @"video",
  34 + @"audio",
  35 + @"answer"
  36 + };
37 37
38 38 static NSString *TKPostTypeAsString[] =
39   -{
40   - @"",
41   - @"TKPostTypeRegular",
42   - @"TKPostTypeLink",
43   - @"TKPostTypeQuote",
44   - @"TKPostTypePhoto",
45   - @"TKPostTypeConversation",
46   - @"TKPostTypeVideo",
47   - @"TKPostTypeAudio",
48   - @"TKPostTypeAnswer"
49   -};
  39 + {
  40 + @"",
  41 + @"TKPostTypeRegular",
  42 + @"TKPostTypeLink",
  43 + @"TKPostTypeQuote",
  44 + @"TKPostTypePhoto",
  45 + @"TKPostTypeConversation",
  46 + @"TKPostTypeVideo",
  47 + @"TKPostTypeAudio",
  48 + @"TKPostTypeAnswer"
  49 + };
50 50
51 51 static NSString *TKPostFormatAsString[] =
52   -{
53   - @"TKPostFormatHTML",
54   - @"TKPostFormatMarkdown"
55   -};
  52 + {
  53 + @"TKPostFormatHTML",
  54 + @"TKPostFormatMarkdown"
  55 + };
56 56
57 57 @implementation TKPost
58 58
@@ -82,8 +82,8 @@ - (id)initWithAttributes:(NSDictionary *)attributeDict
82 82 self.slug = [attributeDict objectForKey:@"slug"];
83 83 self.reblogKey = [attributeDict objectForKey:@"reblog-key"];
84 84 self.format = [[attributeDict objectForKey:@"format"] isEqualToString:@"html"]
85   - ? TKPostFormatHTML
86   - : TKPostFormatMarkdown;
  85 + ? TKPostFormatHTML
  86 + : TKPostFormatMarkdown;
87 87 }
88 88
89 89 return self;
@@ -101,22 +101,22 @@ + (id)postWithAttributes:(NSDictionary *)attributeDict
101 101 Simplistic dictionary to be used statically. Used to map a Tumblr's post type
102 102 to internal TumblrKit class names.
103 103 */
104   - NSDictionary *TKPostTypeToClassNameDict = [NSDictionary dictionaryWithObjectsAndKeys:
105   - @"TKPostPhoto", @"photo",
106   - @"TKPostConversation", @"conversation",
107   - @"TKPostLink", @"link",
108   - @"TKPostQuote", @"quote",
109   - @"TKPostRegular", @"regular",
110   - @"TKPostVideo", @"video",
111   - @"TKPostAudio", @"audio",
112   - nil];
113   -
  104 + NSDictionary *TKPostTypeToClassNameDict = [NSDictionary dictionaryWithObjectsAndKeys:
  105 + @"TKPostPhoto", @"photo",
  106 + @"TKPostConversation", @"conversation",
  107 + @"TKPostLink", @"link",
  108 + @"TKPostQuote", @"quote",
  109 + @"TKPostRegular", @"regular",
  110 + @"TKPostVideo", @"video",
  111 + @"TKPostAudio", @"audio",
  112 + nil];
  113 +
114 114 Class postClass = nil;
115 115 NSString *type_ = [attributeDict objectForKey:@"type"];
116 116
117 117 postClass = NSClassFromString([TKPostTypeToClassNameDict objectForKey:type_]);
118   -
119   - return [(TKPost *)[postClass alloc] initWithAttributes:attributeDict];
  118 +
  119 + return [(TKPost *) [postClass alloc] initWithAttributes:attributeDict];
120 120 }
121 121
122 122 - (NSString *)typeAsString
@@ -127,9 +127,9 @@ - (NSString *)typeAsString
127 127 - (NSDictionary *)attributesAsDictionary
128 128 {
129 129 NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithObjectsAndKeys:
130   - [self typeAsString], @"type",
131   - [self group], @"group",
132   - nil];
  130 + [self typeAsString], @"type",
  131 + [self group], @"group",
  132 + nil];
133 133 return dict;
134 134 }
135 135
@@ -190,7 +190,7 @@ - (NSString *)description
190 190
191 191 - (NSDictionary *)attributesAsDictionary
192 192 {
193   - NSMutableDictionary *dict = (NSMutableDictionary *)[super attributesAsDictionary];
  193 + NSMutableDictionary *dict = (NSMutableDictionary *) [super attributesAsDictionary];
194 194 [dict setObject:body forKey:@"body"];
195 195 [dict setObject:title forKey:@"title"];
196 196 return dict;
@@ -243,7 +243,7 @@ - (NSString *)description
243 243
244 244 - (NSDictionary *)attributesAsDictionary
245 245 {
246   - NSMutableDictionary *dict = (NSMutableDictionary *)[super attributesAsDictionary];
  246 + NSMutableDictionary *dict = (NSMutableDictionary *) [super attributesAsDictionary];
247 247 [dict setObject:text forKey:@"name"];
248 248 [dict setObject:[URL absoluteString] forKey:@"url"];
249 249 return dict;
@@ -306,7 +306,7 @@ - (NSString *)description
306 306
307 307 - (NSDictionary *)attributesAsDictionary
308 308 {
309   - NSMutableDictionary *dict = (NSMutableDictionary *)[super attributesAsDictionary];
  309 + NSMutableDictionary *dict = (NSMutableDictionary *) [super attributesAsDictionary];
310 310 [dict setObject:text forKey:@"quote"];
311 311 [dict setObject:source forKey:@"whatever"];
312 312 return dict;
@@ -351,7 +351,7 @@ - (NSString *)description
351 351
352 352 - (NSDictionary *)attributesAsDictionary
353 353 {
354   - NSMutableDictionary *dict = (NSMutableDictionary *)[super attributesAsDictionary];
  354 + NSMutableDictionary *dict = (NSMutableDictionary *) [super attributesAsDictionary];
355 355 [dict setObject:text forKey:@"conversation"];
356 356 [dict setObject:@"" forKey:@"title"];
357 357 return dict;
@@ -412,7 +412,7 @@ - (NSString *)description
412 412
413 413 - (NSDictionary *)attributesAsDictionary
414 414 {
415   - NSMutableDictionary *dict = (NSMutableDictionary *)[super attributesAsDictionary];
  415 + NSMutableDictionary *dict = (NSMutableDictionary *) [super attributesAsDictionary];
416 416 if (source != nil)
417 417 [dict setObject:source forKey:@"source"];
418 418 if (image != nil && source == nil) {

0 comments on commit c714e1b

Please sign in to comment.
Something went wrong with that request. Please try again.