SlideShare a Scribd company logo
1 of 31
Developing Mobile
Application
Ios : session # 4
By : Amr Elghadban
AMR
ELGHADB
AN
ABOUT ME
———————————
SOFTWARE
ENGINEER
FCI - HELWAN 2010
ITI INTAKE 32
WORKED BEFORE IN
- Tawasol IT
- Etisalat Masr
- NTG Clarity
Previous session we have built an app
that showed a few important different
areas of Xcode including your first look
at storyboards and the Assistant Editor in
addition to understanding where the
entry point for an application is
Outlet and IBAction•Outlets are the bridge between Interface Builder
and code.
• Each control you place in IB can be
represented by an outlet in your Code files.
• An outlet reference can be used to modify the
look of these controls and update the data they
present.
•To add an outlet, we need to use the Assistant
Editor in Xcode, then hold Ctrl while dragging a
connection line from the control in IB to the
source code file where we want to create the
Layers
LayersUp to this point, we’ve been dealing with views, and views only.
In reality, most view classes in UIKit do not expose properties that
you come to expect when designing user interfaces.
Corner radiuses and borders are two notable examples. This is
where layers (represented by the CALayer main class) come into
play.
Put simply, every view in iOS is backed by a layer object that is
responsible for drawing what you see on the screen and managing
its geometry (origin, position, rotation, etc).
Several methods and properties on UIView subclasses act as a thin
wrapper over their layer counterparts.
While a view can have only one backing layer (or root layer), you
can insert any number of sublayers into its layer stack, effectively
creating a layer hierarchy, where layers are nested within other
Navigation Controller
A Navigation Controller is a very common
navigation technique in iOS development.
This is very useful when you have a
hierarchy of views where you might tap
something in one view and descend into
another view where you want to have a back
button to return to the first.
In this instance, you’d have a back button at
the top left of the navigation bar on the
second view.
Navigation Controller
select the view (click anywhere in the
whitespace of the view)
and go to the Editor menu and
choose Embed In –> Navigation
Controller.
Navigation Controller
Navigation Controller
loading View
Create A view
UIActivityIndicatorVie
w
Hide and show from
Buttons Action
progress bar
Download Library from
https://github.com/jdg/MBProgressH
UD
2)Copy the MBProgressHUD.h and
MBProgressHUD.m file into your
project.
progress barHow to use MBProgressHUD
MBProgressHUD is very popular and well designed
circular activity indicator library for developing
IphoneApplications.
MBProgressHUD is very flexible and well functioned
ProgressView library.
MBProgressHUD is simple general library could
integrate by new developers.Its not that much hard
enough.
MBProgressHUD does not need to install Cocoa
Pods,You can directly drag and drop class files in your
project.
UIWebView (
WebView )
How to add UIWebView to a View
Load Request/Data in UIWebView
UIWebViewDelegate methods
Execute Javascript in UIWebView
Create UIWebView programmatically
UIWebVie
w (
WebView
)
How to Add
UIWebView to A view
Drag and drop UIWebView Widget from
Object Library to storyboard.
Add an IBOutlet to view controller and
link it to WebView
@interface ViewController :
UIViewController{
}
@property (weak, nonatomic) IBOutlet
UIWebView *webview;
@end
LOADING REQUEST
IN WEBVIEW
requestWithURL is used to load a URL in Webview
NSURL *url = [NSURL
URLWithString:“http://www.google.com”];
NSURLRequest *request = [NSURLRequest
requestWithURL:url];
[WebView loadRequest:request];
http://stackoverflow.com/questions/30731785/how-do-i-
load-an-http-url-with-app-transport-security-enabled-in-
ios-9
App Transport Security policy requires
Because App Transport Security policy
requires the use of a secure connection, or
unless you whitelist it.
Add the following to your Info.plst:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
NSString * string =
@“<html><body><h1> hi its me
again </h1>How to <a href="/add-
custom-fonts-ios/">Add Custom
Font</a>”;
[webView loadHTMLString:string
baseURL:[NSURL
URLWithString:@"http://google.com"]
];
NSString * path =[[NSBundle mainBundle]
pathForResource:@"Resume"
ofType:@“doc”];
NSData *data =[[NSFileManager
defaultManager] contentsAtPath:path];
[webView loadData:data
MIMEType:@"application/msword"
textEncodingName:@"UTF-8"
baseURL:nil];
To get the list of MIME
types:http://webdesign.about.com/od/multi
Delegate
Let's assume an object A calls an object B to perform an
action.
Once the action is complete, object A should know that
B has completed the task and take necessary action.
This is achieved with the help of delegates.
The key concepts in the above example are −
1.A is a delegate object of B.
2.B will have a reference of A.
3.A will implement the delegate methods of B.
4.B will notify A through the delegate methods.
UIWEBVIEWDELEGA
TE METHODSin .h file —> @interface ViewController :
UIViewController<UIWebViewDelegate>{
}
—————————————————————-
in .m file —> @implementation ViewController
- (void)viewDidLoad{
[super viewDidLoad];
[webview setDelegate:self];
}
@end
UIWebViewDelegate has the following
delegate methods.
1.webView:shouldStartLoadWithRequest:na
vigationType
2.webViewDidStartLoad
3.webViewDidFinishLoad
4.webView:didFailLoadWithError
https://developer.apple.com/reference/uikit/u
iwebviewdelegate
webView:shouldStartLoa
dWithRequest:navigation
Type
method is called before loading a
frame. If the method returns YES,
request is loaded. Otherwise NO.
Using this method, requests can be
filtered.
webView:shouldStartLoa
dWithRequest:navigation
Type- (BOOL)webView:(UIWebView *)webView
shouldStartLoadWithRequest:(NSURLRequest
*)request
navigationType:(UIWebViewNavigationType)navigati
onType
{
NSLog(@"Loading URL
:%@",request.URL.absoluteString);
//return FALSE; //to stop loading
return YES;
}
webViewDidStartLoad
method is called when a frame starts
loading.
- (void)webViewDidStartLoad:(UIWebView *)webView
{
}
webViewDidStartLoad
method is called when a frame starts
loading.
- (void)webViewDidStartLoad:(UIWebView *)webView
{
}
webView:didFailLoad
WithError
method is called if frame loading is
failed.
- (void)webView:(UIWebView *)webView
didFailLoadWithError:(NSError *)error
{
NSLog(@"Failed to load with error :%@",[error
debugDescription]);
}
Assignment
1-Create a Browser Application that have the
following
1- Can Go back
2- Can GO Forward
3- Have Loading bar while requesting string
4- User can write any url to surf the internet
THANKS
▸Skype : amr_elghadban
▸Email : amr.elghadban@gmail.com
▸Phone : (+20) 1098558500
▸Fb/amr.elghadban
▸Linkedin/amr_elghadban
▸ios_course facebook group :
https://www.facebook.com/groups/1161387897317786/
WISH YOU WONDERFUL DAY

More Related Content

What's hot

Angular tutorial
Angular tutorialAngular tutorial
Angular tutorialRohit Gupta
 
Angular 8
Angular 8 Angular 8
Angular 8 Sunil OS
 
Phonegap android
Phonegap androidPhonegap android
Phonegap androidumesh patil
 
An Implementation Tour to AngularJS
An Implementation Tour to AngularJSAn Implementation Tour to AngularJS
An Implementation Tour to AngularJSrahulmonikasharma
 
Dive into Angular, part 1: Introduction
Dive into Angular, part 1: IntroductionDive into Angular, part 1: Introduction
Dive into Angular, part 1: IntroductionOleksii Prohonnyi
 
Mobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhoneMobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhoneMohammad Shaker
 
Flutter vs React: взгляд нативщика / Александр Смирнов (Splyt)
Flutter vs React: взгляд нативщика / Александр Смирнов (Splyt)Flutter vs React: взгляд нативщика / Александр Смирнов (Splyt)
Flutter vs React: взгляд нативщика / Александр Смирнов (Splyt)Ontico
 
Mobile Software Engineering Crash Course - C04 Android Cont.
Mobile Software Engineering Crash Course - C04 Android Cont.Mobile Software Engineering Crash Course - C04 Android Cont.
Mobile Software Engineering Crash Course - C04 Android Cont.Mohammad Shaker
 
UI5con 2017 - Create your own UI5 controls – what’s coming up
UI5con 2017 - Create your own UI5 controls – what’s coming upUI5con 2017 - Create your own UI5 controls – what’s coming up
UI5con 2017 - Create your own UI5 controls – what’s coming upAndreas Kunz
 
Angular View Encapsulation
Angular View EncapsulationAngular View Encapsulation
Angular View EncapsulationJennifer Estrada
 
Dive into Angular, part 2: Architecture
Dive into Angular, part 2: ArchitectureDive into Angular, part 2: Architecture
Dive into Angular, part 2: ArchitectureOleksii Prohonnyi
 
AngularJS Introduction (Talk given on Aug 5 2013)
AngularJS Introduction (Talk given on Aug 5 2013)AngularJS Introduction (Talk given on Aug 5 2013)
AngularJS Introduction (Talk given on Aug 5 2013)Abhishek Anand
 
Creation of simple application using - step by step
Creation of simple application using - step by stepCreation of simple application using - step by step
Creation of simple application using - step by steppriya Nithya
 
Training Session 2
Training Session 2 Training Session 2
Training Session 2 Vivek Bhusal
 

What's hot (20)

Angular tutorial
Angular tutorialAngular tutorial
Angular tutorial
 
Angular 8
Angular 8 Angular 8
Angular 8
 
Phonegap android
Phonegap androidPhonegap android
Phonegap android
 
Angular js
Angular jsAngular js
Angular js
 
An Implementation Tour to AngularJS
An Implementation Tour to AngularJSAn Implementation Tour to AngularJS
An Implementation Tour to AngularJS
 
Dive into Angular, part 1: Introduction
Dive into Angular, part 1: IntroductionDive into Angular, part 1: Introduction
Dive into Angular, part 1: Introduction
 
Google+ API (2012)
Google+ API (2012)Google+ API (2012)
Google+ API (2012)
 
Mobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhoneMobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhone
 
Flutter vs React: взгляд нативщика / Александр Смирнов (Splyt)
Flutter vs React: взгляд нативщика / Александр Смирнов (Splyt)Flutter vs React: взгляд нативщика / Александр Смирнов (Splyt)
Flutter vs React: взгляд нативщика / Александр Смирнов (Splyt)
 
Mobile Software Engineering Crash Course - C04 Android Cont.
Mobile Software Engineering Crash Course - C04 Android Cont.Mobile Software Engineering Crash Course - C04 Android Cont.
Mobile Software Engineering Crash Course - C04 Android Cont.
 
UI5con 2017 - Create your own UI5 controls – what’s coming up
UI5con 2017 - Create your own UI5 controls – what’s coming upUI5con 2017 - Create your own UI5 controls – what’s coming up
UI5con 2017 - Create your own UI5 controls – what’s coming up
 
What's new in Angular 2?
What's new in Angular 2?What's new in Angular 2?
What's new in Angular 2?
 
jsf2 Notes
jsf2 Notesjsf2 Notes
jsf2 Notes
 
Angular View Encapsulation
Angular View EncapsulationAngular View Encapsulation
Angular View Encapsulation
 
Dive into Angular, part 2: Architecture
Dive into Angular, part 2: ArchitectureDive into Angular, part 2: Architecture
Dive into Angular, part 2: Architecture
 
Angular Seminar-js
Angular Seminar-jsAngular Seminar-js
Angular Seminar-js
 
AngularJS Introduction (Talk given on Aug 5 2013)
AngularJS Introduction (Talk given on Aug 5 2013)AngularJS Introduction (Talk given on Aug 5 2013)
AngularJS Introduction (Talk given on Aug 5 2013)
 
Creation of simple application using - step by step
Creation of simple application using - step by stepCreation of simple application using - step by step
Creation of simple application using - step by step
 
Training Session 2
Training Session 2 Training Session 2
Training Session 2
 
Single Page Application
Single Page ApplicationSingle Page Application
Single Page Application
 

Similar to 04 objective-c session 4

Android Development : (Android Studio, PHP, XML, MySQL)
Android Development : (Android Studio, PHP, XML, MySQL)Android Development : (Android Studio, PHP, XML, MySQL)
Android Development : (Android Studio, PHP, XML, MySQL)Kavya Barnadhya Hazarika
 
Basic iOS Training with SWIFT - Part 4
Basic iOS Training with SWIFT - Part 4Basic iOS Training with SWIFT - Part 4
Basic iOS Training with SWIFT - Part 4Manoj Ellappan
 
Progressive Web Application by Citytech
Progressive Web Application by CitytechProgressive Web Application by Citytech
Progressive Web Application by CitytechRitwik Das
 
iOS Development (Part 3) - Additional GUI Components
iOS Development (Part 3) - Additional GUI ComponentsiOS Development (Part 3) - Additional GUI Components
iOS Development (Part 3) - Additional GUI ComponentsAsim Rais Siddiqui
 
Android Workshop
Android WorkshopAndroid Workshop
Android WorkshopJunda Ong
 
Password security system for websites
Password security system for websitesPassword security system for websites
Password security system for websitesMike Taylor
 
Intro to iOS Application Architecture
Intro to iOS Application ArchitectureIntro to iOS Application Architecture
Intro to iOS Application ArchitectureMake School
 
Compose camp 4.pptx
Compose camp 4.pptxCompose camp 4.pptx
Compose camp 4.pptxbcedsc
 
Android Tutorial
Android TutorialAndroid Tutorial
Android TutorialFun2Do Labs
 
Android Bootcamp Tanzania:understanding ui in_android
Android Bootcamp Tanzania:understanding ui in_androidAndroid Bootcamp Tanzania:understanding ui in_android
Android Bootcamp Tanzania:understanding ui in_androidDenis Minja
 
ASP.NEt MVC and Angular What a couple
ASP.NEt MVC and Angular What a coupleASP.NEt MVC and Angular What a couple
ASP.NEt MVC and Angular What a coupleAlexandre Marreiros
 
Customer FX Technical Reference Sheet
Customer FX Technical Reference SheetCustomer FX Technical Reference Sheet
Customer FX Technical Reference SheetGoodCustomers
 
Case study on tablet application for real time video, audio and ppt conversion
Case study on tablet application for real time video, audio and ppt conversionCase study on tablet application for real time video, audio and ppt conversion
Case study on tablet application for real time video, audio and ppt conversionGrey Matter India Technologies PVT LTD
 
Service Worker 201 (en)
Service Worker 201 (en)Service Worker 201 (en)
Service Worker 201 (en)Chang W. Doh
 

Similar to 04 objective-c session 4 (20)

Android Development : (Android Studio, PHP, XML, MySQL)
Android Development : (Android Studio, PHP, XML, MySQL)Android Development : (Android Studio, PHP, XML, MySQL)
Android Development : (Android Studio, PHP, XML, MySQL)
 
Introduction of Xcode
Introduction of XcodeIntroduction of Xcode
Introduction of Xcode
 
Basic iOS Training with SWIFT - Part 4
Basic iOS Training with SWIFT - Part 4Basic iOS Training with SWIFT - Part 4
Basic iOS Training with SWIFT - Part 4
 
Progressive Web Application by Citytech
Progressive Web Application by CitytechProgressive Web Application by Citytech
Progressive Web Application by Citytech
 
iOS Development (Part 3) - Additional GUI Components
iOS Development (Part 3) - Additional GUI ComponentsiOS Development (Part 3) - Additional GUI Components
iOS Development (Part 3) - Additional GUI Components
 
Swift
SwiftSwift
Swift
 
Android Workshop
Android WorkshopAndroid Workshop
Android Workshop
 
Password security system for websites
Password security system for websitesPassword security system for websites
Password security system for websites
 
Stmik bandung
Stmik bandungStmik bandung
Stmik bandung
 
Intro to iOS Application Architecture
Intro to iOS Application ArchitectureIntro to iOS Application Architecture
Intro to iOS Application Architecture
 
Compose camp 4.pptx
Compose camp 4.pptxCompose camp 4.pptx
Compose camp 4.pptx
 
Android Tutorial
Android TutorialAndroid Tutorial
Android Tutorial
 
Android Bootcamp Tanzania:understanding ui in_android
Android Bootcamp Tanzania:understanding ui in_androidAndroid Bootcamp Tanzania:understanding ui in_android
Android Bootcamp Tanzania:understanding ui in_android
 
Android ui with xml
Android ui with xmlAndroid ui with xml
Android ui with xml
 
ios basics
ios basicsios basics
ios basics
 
ASP.NEt MVC and Angular What a couple
ASP.NEt MVC and Angular What a coupleASP.NEt MVC and Angular What a couple
ASP.NEt MVC and Angular What a couple
 
Customer FX Technical Reference Sheet
Customer FX Technical Reference SheetCustomer FX Technical Reference Sheet
Customer FX Technical Reference Sheet
 
Neha
NehaNeha
Neha
 
Case study on tablet application for real time video, audio and ppt conversion
Case study on tablet application for real time video, audio and ppt conversionCase study on tablet application for real time video, audio and ppt conversion
Case study on tablet application for real time video, audio and ppt conversion
 
Service Worker 201 (en)
Service Worker 201 (en)Service Worker 201 (en)
Service Worker 201 (en)
 

More from Amr Elghadban (AmrAngry) (15)

Code detox
Code detoxCode detox
Code detox
 
08 objective-c session 8
08  objective-c session 808  objective-c session 8
08 objective-c session 8
 
07 objective-c session 7
07  objective-c session 707  objective-c session 7
07 objective-c session 7
 
05 objective-c session 5
05  objective-c session 505  objective-c session 5
05 objective-c session 5
 
03 objective-c session 3
03  objective-c session 303  objective-c session 3
03 objective-c session 3
 
02 objective-c session 2
02  objective-c session 202  objective-c session 2
02 objective-c session 2
 
01 objective-c session 1
01  objective-c session 101  objective-c session 1
01 objective-c session 1
 
00 intro ios
00 intro ios00 intro ios
00 intro ios
 
10- java language basics part4
10- java language basics part410- java language basics part4
10- java language basics part4
 
9-java language basics part3
9-java language basics part39-java language basics part3
9-java language basics part3
 
8- java language basics part2
8- java language basics part28- java language basics part2
8- java language basics part2
 
7-Java Language Basics Part1
7-Java Language Basics Part17-Java Language Basics Part1
7-Java Language Basics Part1
 
3-oop java-inheritance
3-oop java-inheritance3-oop java-inheritance
3-oop java-inheritance
 
1-oop java-object
1-oop java-object1-oop java-object
1-oop java-object
 
0-oop java-intro
0-oop java-intro0-oop java-intro
0-oop java-intro
 

Recently uploaded

CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceanilsa9823
 
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...wyqazy
 
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Pooja Nehwal
 
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceanilsa9823
 
9892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x79892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x7Pooja Nehwal
 
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...Niamh verma
 
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝soniya singh
 

Recently uploaded (7)

CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
 
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
 
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
 
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
 
9892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x79892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x7
 
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
 
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Shalimar Bagh Delhi reach out to us at 🔝8264348440🔝
 

04 objective-c session 4

  • 1. Developing Mobile Application Ios : session # 4 By : Amr Elghadban
  • 2. AMR ELGHADB AN ABOUT ME ——————————— SOFTWARE ENGINEER FCI - HELWAN 2010 ITI INTAKE 32 WORKED BEFORE IN - Tawasol IT - Etisalat Masr - NTG Clarity
  • 3. Previous session we have built an app that showed a few important different areas of Xcode including your first look at storyboards and the Assistant Editor in addition to understanding where the entry point for an application is
  • 4. Outlet and IBAction•Outlets are the bridge between Interface Builder and code. • Each control you place in IB can be represented by an outlet in your Code files. • An outlet reference can be used to modify the look of these controls and update the data they present. •To add an outlet, we need to use the Assistant Editor in Xcode, then hold Ctrl while dragging a connection line from the control in IB to the source code file where we want to create the
  • 5.
  • 7. LayersUp to this point, we’ve been dealing with views, and views only. In reality, most view classes in UIKit do not expose properties that you come to expect when designing user interfaces. Corner radiuses and borders are two notable examples. This is where layers (represented by the CALayer main class) come into play. Put simply, every view in iOS is backed by a layer object that is responsible for drawing what you see on the screen and managing its geometry (origin, position, rotation, etc). Several methods and properties on UIView subclasses act as a thin wrapper over their layer counterparts. While a view can have only one backing layer (or root layer), you can insert any number of sublayers into its layer stack, effectively creating a layer hierarchy, where layers are nested within other
  • 8. Navigation Controller A Navigation Controller is a very common navigation technique in iOS development. This is very useful when you have a hierarchy of views where you might tap something in one view and descend into another view where you want to have a back button to return to the first. In this instance, you’d have a back button at the top left of the navigation bar on the second view.
  • 9. Navigation Controller select the view (click anywhere in the whitespace of the view) and go to the Editor menu and choose Embed In –> Navigation Controller.
  • 12. loading View Create A view UIActivityIndicatorVie w Hide and show from Buttons Action
  • 13. progress bar Download Library from https://github.com/jdg/MBProgressH UD 2)Copy the MBProgressHUD.h and MBProgressHUD.m file into your project.
  • 14. progress barHow to use MBProgressHUD MBProgressHUD is very popular and well designed circular activity indicator library for developing IphoneApplications. MBProgressHUD is very flexible and well functioned ProgressView library. MBProgressHUD is simple general library could integrate by new developers.Its not that much hard enough. MBProgressHUD does not need to install Cocoa Pods,You can directly drag and drop class files in your project.
  • 15. UIWebView ( WebView ) How to add UIWebView to a View Load Request/Data in UIWebView UIWebViewDelegate methods Execute Javascript in UIWebView Create UIWebView programmatically
  • 17. How to Add UIWebView to A view Drag and drop UIWebView Widget from Object Library to storyboard. Add an IBOutlet to view controller and link it to WebView @interface ViewController : UIViewController{ } @property (weak, nonatomic) IBOutlet UIWebView *webview; @end
  • 18. LOADING REQUEST IN WEBVIEW requestWithURL is used to load a URL in Webview NSURL *url = [NSURL URLWithString:“http://www.google.com”]; NSURLRequest *request = [NSURLRequest requestWithURL:url]; [WebView loadRequest:request]; http://stackoverflow.com/questions/30731785/how-do-i- load-an-http-url-with-app-transport-security-enabled-in- ios-9
  • 19. App Transport Security policy requires Because App Transport Security policy requires the use of a secure connection, or unless you whitelist it. Add the following to your Info.plst: <key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict>
  • 20. NSString * string = @“<html><body><h1> hi its me again </h1>How to <a href="/add- custom-fonts-ios/">Add Custom Font</a>”; [webView loadHTMLString:string baseURL:[NSURL URLWithString:@"http://google.com"] ];
  • 21. NSString * path =[[NSBundle mainBundle] pathForResource:@"Resume" ofType:@“doc”]; NSData *data =[[NSFileManager defaultManager] contentsAtPath:path]; [webView loadData:data MIMEType:@"application/msword" textEncodingName:@"UTF-8" baseURL:nil]; To get the list of MIME types:http://webdesign.about.com/od/multi
  • 22. Delegate Let's assume an object A calls an object B to perform an action. Once the action is complete, object A should know that B has completed the task and take necessary action. This is achieved with the help of delegates. The key concepts in the above example are − 1.A is a delegate object of B. 2.B will have a reference of A. 3.A will implement the delegate methods of B. 4.B will notify A through the delegate methods.
  • 23. UIWEBVIEWDELEGA TE METHODSin .h file —> @interface ViewController : UIViewController<UIWebViewDelegate>{ } —————————————————————- in .m file —> @implementation ViewController - (void)viewDidLoad{ [super viewDidLoad]; [webview setDelegate:self]; } @end
  • 24. UIWebViewDelegate has the following delegate methods. 1.webView:shouldStartLoadWithRequest:na vigationType 2.webViewDidStartLoad 3.webViewDidFinishLoad 4.webView:didFailLoadWithError https://developer.apple.com/reference/uikit/u iwebviewdelegate
  • 25. webView:shouldStartLoa dWithRequest:navigation Type method is called before loading a frame. If the method returns YES, request is loaded. Otherwise NO. Using this method, requests can be filtered.
  • 27. webViewDidStartLoad method is called when a frame starts loading. - (void)webViewDidStartLoad:(UIWebView *)webView { }
  • 28. webViewDidStartLoad method is called when a frame starts loading. - (void)webViewDidStartLoad:(UIWebView *)webView { }
  • 29. webView:didFailLoad WithError method is called if frame loading is failed. - (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error { NSLog(@"Failed to load with error :%@",[error debugDescription]); }
  • 30. Assignment 1-Create a Browser Application that have the following 1- Can Go back 2- Can GO Forward 3- Have Loading bar while requesting string 4- User can write any url to surf the internet
  • 31. THANKS ▸Skype : amr_elghadban ▸Email : amr.elghadban@gmail.com ▸Phone : (+20) 1098558500 ▸Fb/amr.elghadban ▸Linkedin/amr_elghadban ▸ios_course facebook group : https://www.facebook.com/groups/1161387897317786/ WISH YOU WONDERFUL DAY