commit | author | age
|
3eceb5
|
1 |
// |
W |
2 |
// VKShareDialogController.h |
|
3 |
// |
|
4 |
// Copyright (c) 2014 VK.com |
|
5 |
// |
|
6 |
// Permission is hereby granted, free of charge, to any person obtaining a copy of |
|
7 |
// this software and associated documentation files (the "Software"), to deal in |
|
8 |
// the Software without restriction, including without limitation the rights to |
|
9 |
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of |
|
10 |
// the Software, and to permit persons to whom the Software is furnished to do so, |
|
11 |
// subject to the following conditions: |
|
12 |
// |
|
13 |
// The above copyright notice and this permission notice shall be included in all |
|
14 |
// copies or substantial portions of the Software. |
|
15 |
// |
|
16 |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
17 |
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
|
18 |
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
|
19 |
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
|
20 |
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
|
21 |
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|
22 |
|
|
23 |
#import <UIKit/UIKit.h> |
|
24 |
#import "VKObject.h" |
|
25 |
#import "VKUploadImage.h" |
|
26 |
|
|
27 |
|
|
28 |
typedef NS_ENUM(NSInteger, VKShareDialogControllerResult) { |
|
29 |
VKShareDialogControllerResultCancelled, |
|
30 |
VKShareDialogControllerResultDone |
|
31 |
}; |
|
32 |
|
|
33 |
/* |
|
34 |
* Link representation for share dialog |
|
35 |
*/ |
|
36 |
@interface VKShareLink : VKObject |
|
37 |
/// Use that field for present link description in share dialog interface |
|
38 |
@property(nonatomic, copy) NSString *title; |
|
39 |
/// Use that field for pass real link to VK. Host of the link will be displayed in share dialog |
|
40 |
@property(nonatomic, copy) NSURL *link; |
|
41 |
|
|
42 |
- (instancetype)initWithTitle:(NSString *)title link:(NSURL *)link; |
|
43 |
@end |
|
44 |
|
|
45 |
|
|
46 |
/** |
|
47 |
* Creates dialog for sharing some information from your app to user wall in VK |
|
48 |
*/ |
|
49 |
@interface VKShareDialogController : UIViewController |
|
50 |
/// Array of prepared VKUploadImage objects for upload and share. User can remove any attachment |
|
51 |
@property(nonatomic, strong) NSArray *uploadImages; |
|
52 |
|
|
53 |
/// Photos already uploaded to VK. That is array of photos ids: @["ownerid_photoid", ...]; |
|
54 |
@property(nonatomic, strong) NSArray *vkImages; |
|
55 |
|
|
56 |
/// Links attachment for new post |
|
57 |
@property(nonatomic, strong) VKShareLink *shareLink; |
|
58 |
|
|
59 |
/// Text to share. User can change it |
|
60 |
@property(nonatomic, copy) NSString *text; |
|
61 |
|
|
62 |
/// Put only needed scopes into that array. By default equals @[VK_PER_WALL,VK_PER_PHOTOS] |
|
63 |
@property(nonatomic, strong) NSArray *requestedScope; |
|
64 |
|
|
65 |
/// You can receive information about sharing state |
|
66 |
@property(nonatomic, copy) void (^completionHandler)(VKShareDialogController *dialog, VKShareDialogControllerResult result); |
|
67 |
|
|
68 |
/// Flag meaning the share viewcontroller manage it's presentation state by itself |
|
69 |
@property(nonatomic, assign) BOOL dismissAutomatically; |
|
70 |
|
|
71 |
/// Contains post id created via share dialog. Example string: 123_4567890 |
|
72 |
@property(nonatomic, readonly, copy) NSString *postId; |
|
73 |
|
|
74 |
@end |