Commit 6fc57053 authored by admin's avatar admin

pdf不能分享

parent 396e4590
......@@ -91,6 +91,7 @@
849B2F771C0CABE6005D809F /* AnnounceDetailModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 849B2F761C0CABE6005D809F /* AnnounceDetailModel.m */; };
849F3F271C438A8300080F91 /* LargePictureViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 849F3F261C438A8300080F91 /* LargePictureViewController.m */; };
84A2270E1C229409002766DC /* RankPickView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84A2270D1C229409002766DC /* RankPickView.m */; };
84A48E0E1C473EE100150C93 /* ShowPDFWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84A48E0D1C473EE100150C93 /* ShowPDFWebViewController.m */; };
84A673881C0B50B4000F828E /* OnLineCompleteViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84A673871C0B50B4000F828E /* OnLineCompleteViewController.m */; };
84A6738E1C0BE2D0000F828E /* OnLineCompleteCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84A6738D1C0BE2D0000F828E /* OnLineCompleteCell.m */; };
84A673911C0C2681000F828E /* FunctionViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84A673901C0C2681000F828E /* FunctionViewController.m */; };
......@@ -359,6 +360,8 @@
849F3F261C438A8300080F91 /* LargePictureViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LargePictureViewController.m; sourceTree = "<group>"; };
84A2270C1C229409002766DC /* RankPickView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RankPickView.h; sourceTree = "<group>"; };
84A2270D1C229409002766DC /* RankPickView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RankPickView.m; sourceTree = "<group>"; };
84A48E0C1C473EE100150C93 /* ShowPDFWebViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShowPDFWebViewController.h; sourceTree = "<group>"; };
84A48E0D1C473EE100150C93 /* ShowPDFWebViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ShowPDFWebViewController.m; sourceTree = "<group>"; };
84A673861C0B50B4000F828E /* OnLineCompleteViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OnLineCompleteViewController.h; sourceTree = "<group>"; };
84A673871C0B50B4000F828E /* OnLineCompleteViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OnLineCompleteViewController.m; sourceTree = "<group>"; };
84A6738C1C0BE2D0000F828E /* OnLineCompleteCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OnLineCompleteCell.h; sourceTree = "<group>"; };
......@@ -789,6 +792,7 @@
8426A4AD1BDF0CD600E5FDF5 /* Standard */ = {
isa = PBXGroup;
children = (
84A48E081C473EC500150C93 /* ShowPDF */,
84D2F5111C2CD3C300651EFB /* SOPCategarys */,
84CC34D91C09538E002F10E2 /* StandardHandout */,
84CC34D51C094557002F10E2 /* Cell */,
......@@ -1464,6 +1468,39 @@
path = ViewController;
sourceTree = "<group>";
};
84A48E081C473EC500150C93 /* ShowPDF */ = {
isa = PBXGroup;
children = (
84A48E091C473EC500150C93 /* Cell */,
84A48E0A1C473EC500150C93 /* View */,
84A48E0B1C473EC500150C93 /* ViewController */,
);
path = ShowPDF;
sourceTree = "<group>";
};
84A48E091C473EC500150C93 /* Cell */ = {
isa = PBXGroup;
children = (
);
path = Cell;
sourceTree = "<group>";
};
84A48E0A1C473EC500150C93 /* View */ = {
isa = PBXGroup;
children = (
);
path = View;
sourceTree = "<group>";
};
84A48E0B1C473EC500150C93 /* ViewController */ = {
isa = PBXGroup;
children = (
84A48E0C1C473EE100150C93 /* ShowPDFWebViewController.h */,
84A48E0D1C473EE100150C93 /* ShowPDFWebViewController.m */,
);
path = ViewController;
sourceTree = "<group>";
};
84A673821C0B4D3B000F828E /* OnLineTaskComplete */ = {
isa = PBXGroup;
children = (
......@@ -2471,6 +2508,7 @@
8490C4C31BF9A394006B6569 /* CustomPageControl.m in Sources */,
848A201D1C180C1900422FAB /* OnLineCompleteDetailCell.m in Sources */,
84CEB16F1C2946DB0072ED0A /* OnLineDetailModel.m in Sources */,
84A48E0E1C473EE100150C93 /* ShowPDFWebViewController.m in Sources */,
84F57C461BEC388A00DDEEB1 /* CommentView.m in Sources */,
84D2F51A1C2CE67500651EFB /* SOPTableView.m in Sources */,
84ED5DD81BF2E64300A1BB6D /* ScreenView.m in Sources */,
......
......@@ -6,28 +6,12 @@
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
scope = "0"
stopOnStyle = "0">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "redstar/Classes/Module/Function/Question/QuestionList/View/MoreScreenView.m"
timestampString = "473679011.613156"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "225"
endingLineNumber = "225"
landmarkName = "-textView:shouldChangeTextInRange:replacementText:"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
......@@ -10,13 +10,13 @@
#define Url_h
// url 测试环境
// #define kRedStarURL @"http://218.244.151.129:7580/"
//#define kRedStarURL @"http://218.244.151.129:7580/"
// 正式环境
#define kRedStarURL @"http://219.235.234.225:7580/"
// #define kRedStarURL @"http://219.235.234.225:7580/"
// 最新正式环境
// #define kRedStarURL @"http://219.235.234.212:7580/"
#define kRedStarURL @"http://219.235.234.212:7580/"
// 检查更新
#define kCheckUpdateURL @"redstar-server/rest/ipapk?type=ipa"
......
......@@ -117,7 +117,6 @@
NSFileManager *fileManager = [NSFileManager defaultManager];
if ([fileManager fileExistsAtPath:url]) {
UIDocumentInteractionController *docController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:url]];//为该对象初始化一个加载路径
docController.delegate = self;//设置代理
[docController presentPreviewAnimated:YES];
......
......@@ -14,6 +14,8 @@
#import "AttachmentTableViewCell.h"
#import "AttachmentModel.h"
#import "ShowPDFWebViewController.h"
#import <MBProgressHUD.h>
#define kAttachmentTableCell @"sopAttachmentCell"
......@@ -235,9 +237,20 @@
NSFileManager *fileManager = [NSFileManager defaultManager];
if ([fileManager fileExistsAtPath:url]) {
UIDocumentInteractionController *docController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:url]];//为该对象初始化一个加载路径
docController.delegate = self;//设置代理
[docController presentPreviewAnimated:YES];
ShowPDFWebViewController *showVC = [[ShowPDFWebViewController alloc] init];
showVC.url = url;
showVC.fileName = atta.fileName;
[self.navigationController pushViewController:showVC animated:YES];
// NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL fileURLWithPath:url]];
// UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)];
// [webView loadRequest:request];
//
// [self.view addSubview:webView];
// UIDocumentInteractionController *docController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:url]];//为该对象初始化一个加载路径
// docController.delegate = self;//设置代理
// [docController presentPreviewAnimated:YES];
} else {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"文件不存在,请先下载在查看!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
......
//
// ShowPDFWebViewController.h
// redstar
//
// Created by admin on 16/1/14.
// Copyright © 2016年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ShowPDFWebViewController : UIViewController
@property (nonatomic, strong) NSString *url;
@property (nonatomic, strong) NSString *fileName;
@end
//
// ShowPDFWebViewController.m
// redstar
//
// Created by admin on 16/1/14.
// Copyright © 2016年 ZWF. All rights reserved.
//
#import "ShowPDFWebViewController.h"
@interface ShowPDFWebViewController ()
@property (nonatomic, strong) UIWebView *webView;
@end
@implementation ShowPDFWebViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self setupNav];
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL fileURLWithPath:self.url]];
[self.webView loadRequest:request];
}
- (void)setupNav
{
UILabel *customLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 40, 30)];
[customLab setTextColor:[UIColor whiteColor]];
[customLab setText:self.fileName];
customLab.font = [UIFont boldSystemFontOfSize:19];
self.navigationItem.titleView = customLab;
UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
backBtn.frame = CGRectMake(0, 0, 30, 44);
[backBtn setImage:[UIImage imageNamed:@"back_btn"] forState:UIControlStateNormal];
[backBtn addTarget:self action:@selector(doBack:) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
self.navigationItem.leftBarButtonItem = backItem;
}
- (void)doBack:(UIBarButtonItem *)sender
{
[self.navigationController popViewControllerAnimated:YES];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (UIWebView *)webView
{
if (!_webView) {
_webView = [[UIWebView alloc] initWithFrame:[UIScreen mainScreen].bounds];
_webView.translatesAutoresizingMaskIntoConstraints = NO;
[self.view addSubview:_webView];
NSLayoutConstraint *tableTop = [NSLayoutConstraint constraintWithItem:_webView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.view addConstraint:tableTop];
NSLayoutConstraint *tableLeft = [NSLayoutConstraint constraintWithItem:_webView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.view addConstraint:tableLeft];
NSLayoutConstraint *tableRight = [NSLayoutConstraint constraintWithItem:_webView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self.view addConstraint:tableRight];
NSLayoutConstraint *tableBottom = [NSLayoutConstraint constraintWithItem:_webView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.view addConstraint:tableBottom];
}
return _webView;
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment