-
Notifications
You must be signed in to change notification settings - Fork 72
/
OGObjcSampleViewController.m
58 lines (45 loc) · 1.73 KB
/
OGObjcSampleViewController.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//
// OGObjcSampleViewController.m
// URLEmbeddedViewSample
//
// Created by 鈴木大貴 on 2016/03/31.
// Copyright © 2016年 鈴木大貴. All rights reserved.
//
#import "OGObjcSampleViewController.h"
#import <URLEmbeddedView/URLEmbeddedView-Swift.h>
#import <MisterFusion/MisterFusion-Swift.h>
@interface OGObjcSampleViewController ()
@property (weak, nonatomic) IBOutlet UITextView *textView;
@property (weak, nonatomic) IBOutlet UIView *containerView;
@property (strong, nonatomic) URLEmbeddedView *embeddedView;
@end
@implementation OGObjcSampleViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
self.textView.text = @"https://github.com/";
[OGDataProvider sharedInstance].updateInterval = [NSNumber days:10];
self.embeddedView = [[URLEmbeddedView alloc] initWithUrl:@""];
[self.containerView addLayoutSubview:self.embeddedView andConstraints:@[
self.embeddedView.Top,
self.embeddedView.Right,
self.embeddedView.Left,
self.embeddedView.Bottom
]];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (IBAction)didTapBackButton:(id)sender {
[self.navigationController popViewControllerAnimated:YES];
}
- (IBAction)didTapFetchButton:(id)sender {
[self.embeddedView loadWithURLString:self.textView.text completion:nil];
[[OGDataProvider sharedInstance] fetchOGDataWithURLString: self.textView.text
completion:^(OpenGraphData *data, NSError *error) {
NSLog(@"OpenGraphData = %@", data);
NSLog(@"siteName = %@", data.siteName);
}];
}
@end