33#import < CoreData/CoreData.h>
44#import " JetpackState.h"
55
6+ NS_ASSUME_NONNULL_BEGIN
7+
68@class BlogSettings;
79@class WPAccount;
810@class WordPressComApi;
@@ -54,53 +56,53 @@ typedef NS_ENUM(NSInteger, SiteVisibility) {
5456
5557@interface Blog : NSManagedObject
5658
57- @property (nonatomic , strong , readwrite ) NSNumber *blogID __deprecated_msg (" Use dotComID instead" );
58- @property (nonatomic , strong , readwrite ) NSNumber *dotComID;
59- @property (nonatomic , strong , readwrite ) NSString *xmlrpc;
60- @property (nonatomic , strong , readwrite ) NSString *apiKey;
61- @property (nonatomic , strong , readwrite ) NSNumber *hasOlderPosts;
62- @property (nonatomic , strong , readwrite ) NSNumber *hasOlderPages;
63- @property (nonatomic , strong , readwrite ) NSSet *posts;
64- @property (nonatomic , strong , readwrite ) NSSet *categories;
65- @property (nonatomic , strong , readwrite ) NSSet *tags;
66- @property (nonatomic , strong , readwrite ) NSSet *comments;
67- @property (nonatomic , strong , readwrite ) NSSet *connections;
68- @property (nonatomic , strong , readwrite ) NSSet *themes;
69- @property (nonatomic , strong , readwrite ) NSSet *media;
70- @property (nonatomic , strong , readwrite ) NSOrderedSet *menus;
71- @property (nonatomic , strong , readwrite ) NSOrderedSet *menuLocations;
72- @property (nonatomic , strong , readwrite ) NSString *currentThemeId;
59+ @property (nonatomic , strong , readwrite , nullable ) NSNumber *blogID __deprecated_msg (" Use dotComID instead" );
60+ @property (nonatomic , strong , readwrite , nullable ) NSNumber *dotComID;
61+ @property (nonatomic , strong , readwrite , nullable ) NSString *xmlrpc;
62+ @property (nonatomic , strong , readwrite , nullable ) NSString *apiKey;
63+ @property (nonatomic , strong , readwrite , nullable ) NSNumber *hasOlderPosts;
64+ @property (nonatomic , strong , readwrite , nullable ) NSNumber *hasOlderPages;
65+ @property (nonatomic , strong , readwrite , nullable ) NSSet *posts;
66+ @property (nonatomic , strong , readwrite , nullable ) NSSet *categories;
67+ @property (nonatomic , strong , readwrite , nullable ) NSSet *tags;
68+ @property (nonatomic , strong , readwrite , nullable ) NSSet *comments;
69+ @property (nonatomic , strong , readwrite , nullable ) NSSet *connections;
70+ @property (nonatomic , strong , readwrite , nullable ) NSSet *themes;
71+ @property (nonatomic , strong , readwrite , nullable ) NSSet *media;
72+ @property (nonatomic , strong , readwrite , nullable ) NSOrderedSet *menus;
73+ @property (nonatomic , strong , readwrite , nullable ) NSOrderedSet *menuLocations;
74+ @property (nonatomic , strong , readwrite , nullable ) NSString *currentThemeId;
7375@property (nonatomic , assign , readwrite ) BOOL isSyncingPosts;
7476@property (nonatomic , assign , readwrite ) BOOL isSyncingPages;
7577@property (nonatomic , assign , readwrite ) BOOL isSyncingMedia;
76- @property (nonatomic , strong , readwrite ) NSDate *lastPostsSync;
77- @property (nonatomic , strong , readwrite ) NSDate *lastPagesSync;
78- @property (nonatomic , strong , readwrite ) NSDate *lastCommentsSync;
79- @property (nonatomic , strong , readwrite ) NSDate *lastStatsSync;
80- @property (nonatomic , strong , readwrite ) NSString *lastUpdateWarning;
78+ @property (nonatomic , strong , readwrite , nullable ) NSDate *lastPostsSync;
79+ @property (nonatomic , strong , readwrite , nullable ) NSDate *lastPagesSync;
80+ @property (nonatomic , strong , readwrite , nullable ) NSDate *lastCommentsSync;
81+ @property (nonatomic , strong , readwrite , nullable ) NSDate *lastStatsSync;
82+ @property (nonatomic , strong , readwrite , nullable ) NSString *lastUpdateWarning;
8183@property (nonatomic , assign , readwrite ) BOOL visible;
82- @property (nonatomic , weak , readwrite ) NSNumber *isActivated;
83- @property (nonatomic , strong , readwrite ) NSDictionary *options;
84- @property (nonatomic , strong , readwrite ) NSSet *postTypes;
85- @property (nonatomic , strong , readwrite ) NSDictionary *postFormats;
86- @property (nonatomic , strong , readwrite ) WPAccount *account;
87- @property (nonatomic , strong , readwrite ) WPAccount *jetpackAccount;
88- @property (nonatomic , strong , readwrite ) WPAccount *accountForDefaultBlog;
84+ @property (nonatomic , weak , readwrite , nullable ) NSNumber *isActivated;
85+ @property (nonatomic , strong , readwrite , nullable ) NSDictionary *options;
86+ @property (nonatomic , strong , readwrite , nullable ) NSSet *postTypes;
87+ @property (nonatomic , strong , readwrite , nullable ) NSDictionary *postFormats;
88+ @property (nonatomic , strong , readwrite , nullable ) WPAccount *account;
89+ @property (nonatomic , strong , readwrite , nullable ) WPAccount *jetpackAccount;
90+ @property (nonatomic , strong , readwrite , nullable ) WPAccount *accountForDefaultBlog;
8991@property (nonatomic , assign , readwrite ) BOOL videoPressEnabled;
9092@property (nonatomic , assign , readwrite ) BOOL isMultiAuthor;
9193@property (nonatomic , assign , readwrite ) BOOL isHostedAtWPcom;
92- @property (nonatomic , strong , readwrite ) NSString *icon;
94+ @property (nonatomic , strong , readwrite , nullable ) NSString *icon;
9395@property (nonatomic , assign , readwrite ) SiteVisibility siteVisibility;
94- @property (nonatomic , strong , readwrite ) NSNumber *planID;
95- @property (nonatomic , strong , readwrite ) NSSet *sharingButtons;
96- @property (nonatomic , strong , readwrite ) NSDictionary *capabilities;
96+ @property (nonatomic , strong , readwrite , nullable ) NSNumber *planID;
97+ @property (nonatomic , strong , readwrite , nullable ) NSSet *sharingButtons;
98+ @property (nonatomic , strong , readwrite , nullable ) NSDictionary *capabilities;
9799
98100
99101/* *
100102 * @details Maps to a BlogSettings instance, which contains a collection of the available preferences,
101103 * and their values.
102104 */
103- @property (nonatomic , strong , readwrite ) BlogSettings *settings;
105+ @property (nonatomic , strong , readwrite , nullable ) BlogSettings *settings;
104106
105107/* *
106108 * @details Flags whether the current user is an admin on the blog.
@@ -112,23 +114,23 @@ typedef NS_ENUM(NSInteger, SiteVisibility) {
112114 *
113115 * @warn For WordPress.com or Jetpack Managed sites this will be nil. Use usernameForSite instead
114116 */
115- @property (nonatomic , strong , readwrite ) NSString *username;
116- @property (nonatomic , strong , readwrite ) NSString *password;
117+ @property (nonatomic , strong , readwrite , nullable ) NSString *username;
118+ @property (nonatomic , strong , readwrite , nullable ) NSString *password;
117119
118120
119121// Readonly Properties
120- @property (nonatomic , weak , readonly ) NSArray *sortedPostFormatNames;
121- @property (nonatomic , weak , readonly ) NSArray *sortedPostFormats;
122- @property (nonatomic , strong , readonly ) WPXMLRPCClient *api;
123- @property (nonatomic , weak , readonly ) NSString *version;
124- @property (nonatomic , strong , readonly ) NSString *authToken;
125- @property (nonatomic , strong , readonly ) NSSet *allowedFileTypes;
126- @property (nonatomic , copy , readonly ) NSString *usernameForSite;
122+ @property (nonatomic , weak , readonly , nullable ) NSArray *sortedPostFormatNames;
123+ @property (nonatomic , weak , readonly , nullable ) NSArray *sortedPostFormats;
124+ @property (nonatomic , strong , readonly , nullable ) WPXMLRPCClient *api;
125+ @property (nonatomic , weak , readonly , nullable ) NSString *version;
126+ @property (nonatomic , strong , readonly , nullable ) NSString *authToken;
127+ @property (nonatomic , strong , readonly , nullable ) NSSet *allowedFileTypes;
128+ @property (nonatomic , copy , readonly , nullable ) NSString *usernameForSite;
127129
128130/* *
129131 * @details Contains the Jetpack state. Returns nil if the blog options haven't been downloaded yet
130132 */
131- @property (nonatomic , strong , readonly ) JetpackState *jetpack;
133+ @property (nonatomic , strong , readonly , nullable ) JetpackState *jetpack;
132134
133135
134136/* *
@@ -137,23 +139,23 @@ typedef NS_ENUM(NSInteger, SiteVisibility) {
137139
138140// User to display the blog url to the user (IDN decoded, no http:)
139141// wp.koke.me/sub
140- @property (weak , readonly ) NSString *displayURL;
142+ @property (weak , readonly , nullable ) NSString *displayURL;
141143// alias of displayURL
142144// kept for compatibilty, used as a key to store passwords
143- @property (weak , readonly ) NSString *hostURL;
144- @property (weak , readonly ) NSString *homeURL;
145+ @property (weak , readonly , nullable ) NSString *hostURL;
146+ @property (weak , readonly , nullable ) NSString *homeURL;
145147// http://wp.koke.me/sub
146- @property (nonatomic , strong ) NSString *url;
148+ @property (nonatomic , strong , nullable ) NSString *url;
147149// Used for reachability checks (IDN encoded)
148150// wp.koke.me
149- @property (weak , readonly ) NSString *hostname;
151+ @property (weak , readonly , nullable ) NSString *hostname;
150152
151- @property (weak , readonly ) NSString *defaultPostFormatText;
153+ @property (weak , readonly , nullable ) NSString *defaultPostFormatText;
152154
153155#pragma mark - Blog information
154156- (BOOL )isPrivate ;
155- - (NSArray *)sortedCategories ;
156- - (id )getOptionValue : (NSString *) name ;
157+ - (nullable NSArray *)sortedCategories ;
158+ - (nullable id )getOptionValue : (NSString *) name ;
157159- (NSString *)loginUrl ;
158160- (NSString *)urlWithPath : (NSString *)path ;
159161- (NSString *)adminUrlWithPath : (NSString *)path ;
@@ -171,7 +173,7 @@ typedef NS_ENUM(NSInteger, SiteVisibility) {
171173 *
172174 * @return a string with the post format description and if no description was found the postFormatCode sent.
173175 */
174- - (NSString *)postFormatTextFromSlug : (NSString *)postFormatSlug ;
176+ - (nullable NSString *)postFormatTextFromSlug : (NSString *)postFormatSlug ;
175177/* *
176178 Returns a human readable description for logging
177179
@@ -190,6 +192,8 @@ typedef NS_ENUM(NSInteger, SiteVisibility) {
190192
191193 @return a WordPressComApi object if available
192194 */
193- - (WordPressComApi *)restApi ;
195+ - (nullable WordPressComApi *)restApi ;
194196
195197@end
198+
199+ NS_ASSUME_NONNULL_END
0 commit comments