Xcode Tutorial - How to use a UIWebView (Load PDF Files, local HTML documents/ etc...)

Xcode Tutorial - How to use a UIWebView (Load PDF Files, local HTML documents/ etc...)


In this Xcode tutorial I will be showing you how to use a UIWebView in your iOS Application. You can use it to load a website from the internet, load a local file (such as a PDF file) and more.

Links:
Website: http://supertecnoboff.co.uk
Twitter: http://twitter.com/supertecnoboff
Tumblr: http://supertecnoboff.tumblr.com
Facebook: http://facebook.com/supertecnoboff
iOS Apps: http://itunes.apple.com/artist/supert...
Closed Caption:

hey guys sleep 1000 fear and then we
have another xk 20 feet today
now this tutorial I'm going to be one
scan covering one of my old Charles this
is going to be talking about you I web
these now in a previous tutorial of UI
web these I talked about how could a
uiwebview to application which loads a
website online blow seven the end of
that teacher that I would make another
video which covers how to load a webpage
or HTML document for example which is
stored offline or basically in the
resources folder of your iOS application
so here I've got a simple little group
here I've got a simple web app here it's
a basically well just hdmi made in a Jap
dash code and i'm just going to launch
here in the iOS simulator in safari so
doesn't really do much but you get the
idea is just for demonstration purposes
and sort of a little button here too man
and so on but it's all done in HTML you
can see right and what we're gonna do is
we're gonna be servin storing this
online and then loading it in the UI
webview we're gonna load this locally in
the resource from the resources folder
in our iOS application so let's close
this and start a new Xcode project gonna
call this i'm going to select a single
View application or if you're on the
older iOS four an old SD case it will be
a few base application- selects a local
weather you save this to the desktop we
go
so the very first thing I'm gonna do is
of course add in our HTML documents to
the resources or in this case the
supporting files folder of iOS
application so just drag and drop that
in him and here just one thing to note
here when you want to load documents
such as HTML document locally it's
better to select create folders
references for any added folders just
select this option when you're copying
the files now I don't know
why but when you select this option it
doesn't work when you're loading the
local HTML farm and but when you set
this when you select this option it does
work now I don't exactly know why but
all the forum's I saw always said this
and I try to know if you use quite been
in the past and this way by selecting
this option it works a lot better said
well let's just copy those items in so
here they are here RV here is the local
HTML forint and if we open that folder
we have all the contents of that folder
in xcode project that's all good now
let's come to our viewcontroller h and
begin with the coding so it's really
simple here we're just going to open and
close to curly brackets and make an
iboutlet 4i uiwebview so I be outlet
place why web the space-car i'm going to
give our web view a name I'm going to
call this with you
very simple now we're going to come and
a day a spotty function so that property
space open bracket non-atomic comma
space contain retain close brackets
space UI webview a star and now type in
the name of our web so in my case its
web deep semicolon safe now we're going
to come into the viewcontroller am far
and because we used a property function
we're gonna be synthesized it so at
synthesized and then type in the name of
our web usin my classes lucky semicolon
save that's so good
now what I'm going to do for the
purposes of this tutorial I'm going to
make it so that when our application
loads the webview starts loading the
HTML content so i'm going to use the
super viewdidload function in search
delete this year and type in the
following code NS string space star path
people space equals space open to square
brackets and it's bundle space main
London close square brackets or just
close one square
it's space pass for resource then at and
openly close to quotation marks and here
we're going to put in the name of our
HTML document now in most cases lot of
people will be implementing for example
web apps and just like a website any web
app starts with the index fun
so you're going to want to type an index
in and then off type well in this case
is HTML so i'm going to put at open to
quotation marks and in between the
quotation marks in the format of the
file so here at speech the amount after
the closing quotation mark space and
then type in the following code in the
dictionary or directory sorry that sign
open to crack open to quotation marks
and in between these quotation put
quotation marks
we're going to write write in the name
of the folder of which are HTML
documents are stored in so in this case
the name of the photo is local HTML
similar type n local then after the
closing quotation marks close the square
bracket semicolon say we come down the
line and type in NS URL space star URL
space people's space open the square
brackets NS around space file URL with
path then put close the square bracket
semicolon come down line now for next
line of code then NS URL request based
our request equal space sorry open
square brackets and s URL request space
request with you
RL and then put around poster brackets
semicolon safe and come down for our
very last line of code which is going to
be open square brackets now type in the
name of our web view so in this case is
a web meeting space load request code on
and then type in request close bracket
semicolon saved and that's it we're done
so that's it for the code so now we go
to come into our xib file and add in a
uiwebview so that's coming to the
viewcontroller the xib file open this up
and make sure our files owner is
selected or actually selected once we
add in the UI webview sorry
so it's going to open this up and I'm
going to drag and drop a simple UI
webview there we go now select all files
owner come into the connections tab in
interface builder hip and connect the
iboutlet which in this case is webview
tu ru I web-like so safe and now let's
build one and this should work perfectly
fine so as you can see no issues here
whatsoever so it's all works fine and
here is rui overview and it has loaded
our local HTML document so can press
this button and the idea is it should
work although maybe that's to do with my
code in dash code but you get the idea
it does work here has loaded our HTML
document as you can see so is there is
our uiwebview and that's is and that is
how we can load a local HTML document
now this also has some other uses for
example you can also load PDF documents
like this as well and I just quickly
show you that as well so if we stop this
here come into the control that Haitians
really very simple is not much to it but
basically you type in the name of your
PDF here so I'm going to just to have a
simple PDF this one right
I'm going to do on these pages and
quickly make a PDF file and this is just
to demonstrate how you can use a PDF
file in a UI webview as well so let's
just do that make our PDF fun
so this is a PDF file save as a PDF file
we're gonna have an explosion no save it
save it
PDF PDF PDF hope so yeah on our desktop
we have a PDF file here and it's called
PDF from enough so we're just gonna drag
and drop this into our supporting files
or if you're on the older sdk is going
to drag and drop it into the resources
folder going to select create groups for
need added folders in this case and
finish so here is a PDF file
well let's come back into the control RM
file and we're just going to change a
few things here so here what it says for
path resource we're going to change this
to the name of our PDF files in my case
it's called literally called PDF and off
type well the document is a PDF on some
of the media and in directory
well it's not technically in any
directory so you can probably like and
we should be able to build and run and
there we have it guys
so this is rui worldview and it's
loading a PDF farm now obviously if you
have more pages will scroll down and the
all the pages in this case we only have
one page of our PDF phone and this is it
that we have guys that is how you can
use a uiwebview to load local data from
the resources or in the new SDK from the
supporting farms folder and this can
load sounds like PDF HTML documents java
documents things like that so thank you
very much watching I hope this tutorial
has helped
if it has please subscribe to my youtube
channel and I'll see you in my next
video bye

Video Length: 11:00
Uploaded By: Supertecnoboff
View Count: 42,916

Related Software Products
Html To PDF
Html To PDF

Published By:
Utralshareware Software

Description:
Do you want to convert your html files into PDF? Html to PDF is the batch html to pdf conversion utility you want. It takes html file or remote webpage as input, load the html content into standard browser, render the html content into a standard PDF file. It can be used on multiple OS platform like linux and Windows. Key Benefits: Convert html into PDF on the fly With Html To PDF, it can convert your Html documents into Adobe PDF files easily. It can handle the complex webpages on the ...


Related Videos
Creating Dynamic PDF in PHP from HTML
Creating Dynamic PDF in PHP from HTML

Generating a Dynamic PDF from HTML Form Data using fpdf library.Also includes a slight introduction to basic usage of fpdf library. hr / bClosed Caption:/b hey guys today I'm going to show you how to create your dynamic a PDF in PHP so in my last video i have shown you how to create the static PDF but in this video I'm going to show you how to create an video from his team or forms so i have a simple form here it's just to hisbr ...
Video Length: 13:39
Uploaded By: yrrhelp
View Count: 95,387

convert VCE to PDF
convert VCE to PDF

http://www.4shared.com/rar/M3XMDxWa/c... the first file http://www.4shared.com/rar/6_GaFZwb/C... the second file
Video Length: 09:07
Uploaded By: EnG. AhmeD
View Count: 94,774

Converting PDF Files to HTML
Converting PDF Files to HTML

In this session we'll discuss how to convert a PDF file into an editable HTML file that maintains images, tables, hyperlinks, and table of contents. Learn more about this Acrobat XI course at: https://www.udemy.com/learn-acrobat-xi/ hr / bClosed Caption:/b in this session will discuss how to convert a PDF file into an editable HTML file while maintaining all the images tables hyperlinks and even the table of contents now ...
Video Length: 06:28
Uploaded By: Lori Kassuba
View Count: 76,752

How to Convert PDF to Word, Excel,HTML and 6 Popular Formats on Mac(support OCR)
How to Convert PDF to Word, Excel,HTML and 6 Popular Formats on Mac(support OCR)

http://www.wondershare.com/pdf-conver... Wondershare PDF Converter Pro for Mac is not only convert normal PDF to Office formats, EPUB, HTML and more with high quality,also support scanned PDF document with its simple interface, Mac users can easily convert PDF to other formats as easy as 1-2-3. Keywords: PDF to word Mac, PDF to word for Mac, convert PDF to word Mac, PDF to word converter Mac, PDF to doc Mac hr / bClosed Caption:/b do you have a ...
Video Length: 01:42
Uploaded By: Wondershare
View Count: 72,086

How to Convert PDF to Word, PDF to Excel, PDF to HTML, & Edit PDF files with deskUNPDF
How to Convert PDF to Word, PDF to Excel, PDF to HTML, & Edit PDF files with deskUNPDF

Free trial at: http://docudesk.com This tutorial shows how to edit PDF files using deskUNPDF Professional. Quicklinks: How to start with deskUNPDF 00:17 Output formats 00:37 PDF to Word 01:39 PDF to Excel 02:00 How to open a PDF in Word 02:53 Demonstrated is how to convert a PDF to Word & PDF to Excel. This can also be useful for PDF to HTML, PDF to XML, and PDF to jpeg or other image formats. deskUNPDF can convert PDF to ...
Video Length: 04:14
Uploaded By: Docudesk Corporation
View Count: 66,012

Create HTML Email from a PDF-Part 2
Create HTML Email from a PDF-Part 2

See the full tutorial @ http://www.edhart.me/2011/02/how-to-c... This is the second part of a multiple part tutorial series on creating HTML emails from a pre-designed document. Many firms that rely on marketing have a similar scenario: The marketing staff has created various marketing pieces that work great as print pieces, but when they want to do some customized e-mail marketing, the effort boils down to sending attached PDF documents or using template based subscription ...
Video Length: 01:07
Uploaded By: Ed Hart
View Count: 55,305

How To Convert HTML to PDF Document
How To Convert HTML to PDF Document

I have found an easiest online tool for convert HTML to PDF Format. You can easily convert any html page to pdf document in seconds. Click this link to access the HTML to PDF Converter http://onlinehtmltools.com/html-to-pd... hr / bClosed Caption:/b hello my difference today have formed and easiest tool for converting has TMO fire files into video format this tool this is this is an online web browser toolbar buy online has tml tools ...
Video Length: 05:14
Uploaded By: Sathya Moorthi
View Count: 54,006

How to Convert PDF to Word, Excel, PowerPoint, EPUB, HTML and Text on Mac?
How to Convert PDF to Word, Excel, PowerPoint, EPUB, HTML and Text on Mac?

http://www.anypdftools.com/pdf-conver... AnyBizSoft 6-in-1 PDF Converter can easily help you to convert PDF to Word, Excel, PowerPoint, EPUB, HTML and Text on Mac OS X. Just a few clicks, task will be done in seconds.
Video Length: 01:58
Uploaded By: Melvinjames18
View Count: 49,308

How To Convert HTML to PDF, HTML to Excel, HTML to Word, & PDF to HTML
How To Convert HTML to PDF, HTML to Excel, HTML to Word, & PDF to HTML

Free trial at: http://docudesk.com This short tutorial demonstrates how to convert HTML to Excel (.xls) format, and also how to convert HTML for use on an e-book reader. Quicklinks: Overview: 00:07 HTML to Excel: 00:36 HTML to e-book: 01:38 With PDF Essentials Plus, any file which can be printed to paper can be converted to any of the deskUNPDF output formats such as .doc, .xls, & .html. This can also be very useful to convert HTML ...
Video Length: 02:51
Uploaded By: Docudesk Corporation
View Count: 32,133

Copyright © 2025, Ivertech. All rights reserved.