- Default
- Change Color
- No og:title but have title
- No response or tag (og:)
使用cocoapods安裝,加入指令到專案的Podfile:
URLPreviewPod is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "URLPreviewPod"
下載專案複製Framework進入你的專案
Download Project and copy Framework in your Project
1.Linked Framworks and Libraries -> 新增本Framework、libxml2.(dylib/tbd)
2.Build Settings -> Header Search Paths -> 新增 /usr/include/libxml2
3.Build Phases -> Copy Boundle Resources -> 新增本Framework
1.Linked Framworks and Libraries -> Add this Framework and libxml2.(dylib/tbd)
2.Build Settings -> Header Search Paths -> Add /usr/include/libxml2
3.Build Phases -> Copy Boundle Resources -> Add this Framework
1.請先用initWithFrame初始化物件(最低尺寸 -> 寬:>=300,高:>=100)
2.如果需要點擊後導到該網站,請設定delegate,並實作URLPreviewDelegate的方法
3.使用saveTemporaryImage判斷是否暫存圖片
4.用showURLPreviewWithURL放入您的網址
1.First use initWithFrame init you'r object(Minimum size -> Width:>=300,Height:>=100)
2.If you need to push to you'r URL, set URLPreviewDelegate
3.Use saveTemporaryImage to save Image
4.Use function showURLPreviewWithURL to set you'r URL
#import <URLPreview/Preview.h>
Preview *preview = [[Preview alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, 100)];
preview.center = self.view.center;
preview.delegate = self;
[preview showURLPreviewWithURL:@"https://github.com/StewartXIII/URLPreview"];
preview.titleColorHexString = @"#fe5b18";
preview.descriptionColorHexString = @"#7c6262";
preview.siteNameColorHexString = @"#2918df";
preview.longPressColorHexString = @"#f38181";
[preview use3DTouchOnController:self];
- Objective-C-HMTL-Parser is a great HTML parser for Objective-c. (Created by @zootreeves)
Stewart, [email protected]
URLPreviewPod is available under the MIT license. See the LICENSE file for more info.