ios - Check if UIWebview is displaying PDF -



ios - Check if UIWebview is displaying PDF -

to clear, question not asking how display pdf in uiwebview. want check if user has navigated pdf (.pdf) document website or link. way can show more options user, saving pdf or printing it. what's best way check if uiwebview's content pdf?

you can check mime type too, longer journey:

@property (nonatomic, strong) nsstring *mime; - (void)connection:(nsurlconnection *)connection didreceiveresponse:(nsurlresponse *)response { mime = [response mimetype]; } - (bool)isdisplayingpdf { nsstring *extension = [[mime substringfromindex:([mime length] - 3)] lowercasestring]; homecoming ([[[self.webview.request.url pathextension] lowercasestring] isequaltostring:@"pdf"] || [extension isequaltostring:@"pdf"]); }

ios pdf uiwebview

Comments

Popular posts from this blog

javascript - mongodb won't find my schema method in nested container -

How do you set up a perforce server to work over the internet? -

ios - Lagging ScrollView with UIWebview inside -