GOOGLE MAP CODE IN SWIFT let camera = GMSCameraPosition.cameraWithLatitude(-33.86, longitude: 151.20, zoom: 6) let mapView = GMSMapView.mapWithFrame(CGRectZero, camera: camera) mapView.myLocationEnabled = true self.view = mapView
class ViewController: UIViewController,UICollectionViewDelegate,UICollectionViewDataSource {
@IBOutlet weak var clvPhotos : UICollectionView! var arrProductList : [Dictionary] = [Dictionary]() var screenSize : CGFloat? override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib.
self.wsProductList()
}
override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. }
https://drive.google.com/open?id=0B2WmZB5JOxMqSHdSZHFJU2RxeG8
ReplyDeletehttps://drive.google.com/open?id=0B2WmZB5JOxMqSXlidFl5N0xnVUE ;- userDoer
ReplyDeletehttps://drive.google.com/open?id=0B2WmZB5JOxMqSExzbmwzMzhYaW8 :- R
ReplyDeletefunc numberOfSectionsInTableView(tableView: UITableView) -> Int
ReplyDelete{
return 0
}
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int
{
return 0
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell
{
let cell:THSubcategoryCell? = tableView.dequeueReusableCellWithIdentifier("THSubcategoryCell") as? THSubcategoryCell
cell?.selectionStyle = .None
return cell!
}
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath)
{
}
GET MAIN QUEUE :-
ReplyDeletedispatch_async(dispatch_get_main_queue(), {() -> Void in
self.showAlertView(response[MESSAGE] as! String)
})
RELOAD PARTICULAR INDEX :-
ReplyDeletelet indexPath1 = NSIndexPath(forRow: 0, inSection: 2)
self.tblCreateRecipe.reloadRowsAtIndexPaths([indexPath1], withRowAnimation: UITableViewRowAnimation.Automatic)
BUTTON ADD TARGET :-
ReplyDeletetblCell.btnCancelInvoice.addTarget(self, action: "btnCancelInvoiceTapped:", forControlEvents: .TouchUpInside)
AFTER DELAY CALL METHODS
ReplyDeletelet delayTime = dispatch_time(DISPATCH_TIME_NOW, Int64(1 * Double(NSEC_PER_SEC)))
dispatch_after(delayTime, dispatch_get_main_queue()){
let valueHeight = self.tags.collectionView?.contentSize.height
self.tagsHeight.constant = valueHeight!
}
STORY BOARD NAVIGATIONS :-
ReplyDeletelet varStroryboad = UIStoryboard.init(name:"THPayment", bundle: nil)
let THSubCategory = varStroryboad.instantiateViewControllerWithIdentifier("THSelectPaymentCardVC")
self.navigationController?.pushViewController(THSubCategory, animated: true)
COLLECTIONVIEW DELEGATE METHODS :_
ReplyDeletefunc collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize {
return CGSizeMake(0, 0)
}
func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int
{
return 0
}
func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell
{
let cell:THHomeCategoryCell! = collectionView.dequeueReusableCellWithReuseIdentifier("THHomeCategoryCell", forIndexPath: indexPath) as! THHomeCategoryCell
return cell
}
func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath)
{
}
ATTRIBUTE TEXT
ReplyDeletelet style : NSMutableParagraphStyle = NSMutableParagraphStyle()
style.minimumLineHeight = 24
let strPrice = NSMutableAttributedString()
let attrString1 : NSAttributedString = NSAttributedString(string: strLine1, attributes: [NSFontAttributeName:THFont.OpenSansRegular(12), NSForegroundColorAttributeName:THColor.attributeLightColor])
let attrString2 : NSAttributedString = NSAttributedString(string:"\n")
let attrString3 : NSAttributedString = NSAttributedString(string:strLine2, attributes: [NSFontAttributeName:THFont.OpenSansSemiBold(15), NSForegroundColorAttributeName:THColor.attributeDarkColor,NSParagraphStyleAttributeName :style])
strPrice.appendAttributedString(attrString1)
strPrice.appendAttributedString(attrString2)
strPrice.appendAttributedString(attrString3)
Demo about webservice
ReplyDeletehttps://drive.google.com/open?id=0B2WmZB5JOxMqVDZvampNallfeU0
Qatarrat Project
ReplyDeletehttps://drive.google.com/open?id=0B2WmZB5JOxMqazhJczhleGFFRzg
RAHA LATEST
ReplyDeletehttps://drive.google.com/open?id=0B2WmZB5JOxMqdUJiMHg4c1NQckU
QatarSc Latest https://drive.google.com/open?id=0B2WmZB5JOxMqSHdSZHFJU2RxeG8
ReplyDeletelast demo link
ReplyDeletehttps://drive.google.com/open?id=0B2WmZB5JOxMqQnRDMldWc29EbFE
Google map details
ReplyDeletehttps://developers.google.com/maps/documentation/ios-sdk/start#step_6_add_a_map
GET API KEY GOOGLE MAP
ReplyDeletehttps://developers.google.com/maps/documentation/ios-sdk/get-api-key
GOOGLE MAP CODE IN SWIFT
ReplyDeletelet camera = GMSCameraPosition.cameraWithLatitude(-33.86,
longitude: 151.20, zoom: 6)
let mapView = GMSMapView.mapWithFrame(CGRectZero, camera: camera)
mapView.myLocationEnabled = true
self.view = mapView
let marker = GMSMarker()
marker.position = CLLocationCoordinate2DMake(-33.86, 151.20)
marker.title = "Sydney"
marker.snippet = "Australia"
marker.map = mapView
Fabric digit guidence setup in fabric
ReplyDeletehttps://docs.fabric.io/ios/digits/digitskit-setup.html
Coding wise steps
https://docs.fabric.io/ios/digits/digits.html
Code for WS
ReplyDelete//MARK:- WS methods
func wsRecipeList(strSearchKey : String,strPageNo : String , strType : String)
{
let dictReqPrm = [
page_no: strPageNo,
searchKey:strSearchKey,
type :strType
]
JSONParser.sharedInstance.parseWithURL(ws_RecipeList, HTTPMethod: "POST", requestPrm: dictReqPrm) {
(response) -> Void in
if self.tblRecipes!.tableFooterView != nil{
removeLoadMoreIndicator(self.tblRecipes!)
self.view.layoutIfNeeded()
}
if response["status"] as! Int == 200 {
let dictUserInfo = response[DATA] as? Dictionary
if let arr = dictUserInfo![recipes] as? [Dictionary]{
self.arrRecipeList += arr
}
self.totalPages = dictUserInfo![totalpages] as! Int
dispatch_async(dispatch_get_main_queue(), {() -> Void in
self.tblRecipes.reloadData()
})
} else if response["status"] as! Int == 300
{
dispatch_async(dispatch_get_main_queue(), {() -> Void in
self.tblRecipes.reloadData()
})
}
else
{
}
}
}
TEXTFIELD DID CHANGE
ReplyDelete//MARK:- UITextfield delegate methods
func textDidChange()
{
if tfSearchRecipe.text?.length > 3
{
self.clearData()
self.wsRecipeList(tfSearchRecipe.text!, strPageNo:String(currentPage), strType:"")
}
}
tfSearchRecipe.addTarget(self, action:"textDidChange", forControlEvents: UIControlEvents.EditingChanged)
ReplyDeleteMapDemo link
ReplyDeletehttps://drive.google.com/open?id=0B9hgnK1nQEjaQzFkd1VhLXlMSzg
MAP DEMO FINAL 6
ReplyDeletehttps://drive.google.com/open?id=0B9hgnK1nQEjaVnVOTzltYjktcnM
The theme is very interesting to me see, with the information in here could make me greater insight, nice post.
ReplyDeleteiphone app development
Bonito project file
ReplyDeletehttps://drive.google.com/open?id=0B2WmZB5JOxMqYkJCbkFTMC15TTg
little snail
ReplyDeletehttps://drive.google.com/open?id=0B2WmZB5JOxMqV25IN1UwZHYtRFk
https://drive.google.com/open?id=0B2WmZB5JOxMqNnVJS0x2N0wyVTg
https://drive.google.com/open?id=0B2WmZB5JOxMqWnh1UDY4SWVQWUk
https://drive.google.com/open?id=0B2WmZB5JOxMqYkJCbkFTMC15TTg
JSON PARSE IN STRING
ReplyDeleteprint(WS_URL)
let jsonRequest: NSMutableURLRequest = NSMutableURLRequest(URL: NSURL(string: WS_URL)!)
do{
if let requestData : NSData! = try NSJSONSerialization.dataWithJSONObject(requestPrm, options: NSJSONWritingOptions(rawValue : 0))
{
let requestString : NSString = NSString(data: requestData, encoding: NSUTF8StringEncoding)!
print("requestString",requestString)
let jsonRequestData = requestString.dataUsingEncoding(NSUTF8StringEncoding)
jsonRequest.HTTPBody = jsonRequestData
jsonRequest.HTTPMethod = HTTPMethod
jsonRequest.addValue("application/json", forHTTPHeaderField: "Content-Type")
jsonRequest.timeoutInterval = 180
}
Alamofire Link
ReplyDeletehttps://drive.google.com/file/d/0Bxh97m9JB3pZMVpNbkllelJMNFk/view?usp=drivesdk
Webservice Demo swift 2.2
ReplyDeletehttps://drive.google.com/open?id=0B9hgnK1nQEjacWp3V3g1MkRYVlE
NIA Sharable link
ReplyDeletehttps://drive.google.com/open?id=0B9hgnK1nQEjaRlpmZGljVWVvNEU
PictureThis link
ReplyDeletehttps://drive.google.com/open?id=0B9hgnK1nQEjaRDNwVWJqVkJ3dnc
PICTURE THIS WS LINK INTERVIEW
Deletehttps://drive.google.com/open?id=0B9hgnK1nQEjaVWFsbjFqWGtlZzg
JSON ENCODING
ReplyDeletelet parameters: Parameters = [
"foo": [1,2,3],
"bar": [
"baz": "qux"
]
]
// Both calls are equivalent
Alamofire.request("https://httpbin.org/post", method: .post, parameters: parameters, encoding: JSONEncoding.default)
Alamofire.request("https://httpbin.org/post", method: .post, parameters: parameters, encoding: JSONEncoding(options: []))
// HTTP body: {"foo": [1, 2, 3], "bar": {"baz": "qux"}}
ALAMOFIRE GET/POST INTERVIEW
ReplyDeletehttps://drive.google.com/open?id=0B9hgnK1nQEjaMFJQRkRrUVIxVUk
Alamofire 4.0 latest
Deletealamofire 4.0 , not terminal working
DeleteWebservice GET/POST demo swift 2.0
ReplyDeletehttps://drive.google.com/open?id=0B9hgnK1nQEjaVWd6NVVhTmZSblU
ALAMOFIRE GITHUB LINK
ReplyDeletehttps://github.com/Alamofire/Alamofire
TODO FINAL DEMOS
ReplyDeletehttps://drive.google.com/open?id=0B9hgnK1nQEjaUjRWbW5JQzFIN1U
COLLECTIONVIEW DELEGATE METHODS IN SWIFT 3.0
ReplyDelete//MARK:- collectionView delegate methods
func numberOfSections(in collectionView: UICollectionView) -> Int {
return 1
}
internal func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int
{
return 3
}
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
print("cntHeight.constant cell",cntHeight.constant)
let height = _screenSize.width / 3
if height < 125 {
return CGSize(width: height , height: 125)
}
return CGSize(width: height , height: height )
}
internal func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell:ClvHomeCell! = collectionView.dequeueReusableCell(withReuseIdentifier: "ClvHomeCell", for: indexPath as IndexPath) as! ClvHomeCell
cell.lblName.text = arrHomeLblNames[indexPath.row]["lblName"]
cell.imgVHome.image = UIImage(named:arrHomeLblNames[indexPath.row]["Img"]!)
return cell
}
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath)
{
}
SWIFT 3 webservice final
ReplyDeletehttps://drive.google.com/open?id=0B9hgnK1nQEjaXzB3dVRnMmNPYms
Webservice alamofire4
ReplyDeletehttps://drive.google.com/open?id=0B9hgnK1nQEjaMm1naTY4bV83cWs
http://demo.dealfixkar.com/wp-content/rest-api-dealfixkar/api/products.php
ReplyDelete//
ReplyDelete// ViewController.swift
// DemoWebServiceAlamofire4
//
// Created by BINITA MODI on 5/7/17.
// Copyright © 2017 BINITA MODI. All rights reserved.
//
import UIKit
import SwiftyJSON
import Alamofire
import SDWebImage
class ViewController: UIViewController,UICollectionViewDelegate,UICollectionViewDataSource {
@IBOutlet weak var clvPhotos : UICollectionView!
var arrProductList : [Dictionary] = [Dictionary]()
var screenSize : CGFloat?
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
self.wsProductList()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
override func viewDidAppear(_ animated: Bool) {
screenSize = (clvPhotos.frame.size.width/2)
}
//MARK:- CollectionView delegate methods
func numberOfSections(in collectionView: UICollectionView) -> Int {
return 1
}
internal func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int
{
return (arrProductList.count)
}
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
let height = 200
return CGSize(width: Int(screenSize!),height: height )
}
internal func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell:ClvProductListCell! = collectionView.dequeueReusableCell(withReuseIdentifier: "ClvProductListCell", for: indexPath as IndexPath) as! ClvProductListCell
cell.lblProductName.text = arrProductList[indexPath.row]["title"] as? String
cell.lblProductPrice.text = arrProductList[indexPath.row]["price"] as? String
// cell.imgVHome.image = UIImage(named:arrHomeLblNames[indexPath.row]["Img"]!)
//cell.imgPhoto.sd_setShowActivityIndicatorView(true)
//cell.imgPhoto.sd_setIndicatorStyle(.Gray)
let arrImages = arrProductList[indexPath.row]["images"] as? [Dictionary]
//["src"] as String
print("arrImages",arrImages!)
if let strVal = arrImages?[0]["src"] as? String
{
print("src",strVal)
cell.imgPhoto.sd_setImage(with: URL(string:strVal), placeholderImage: UIImage(named: "placeholder.png"))
}
return cell
}
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath)
{
}
func wsProductList()
{
let jsonObject: [String: String] = [
"action": "product_list"]
let headersVal: HTTPHeaders = [
"Content-Type": "application/x-www-form-urlencoded",
]
Alamofire.request("http://demo.dealfixkar.com/wp-content/rest-api-dealfixkar/api/products.php", method: .post ,parameters: jsonObject, headers:headersVal)
.responseJSON { response in
print("RESPONSE =====",response.result.value as Any) // result of response serialization
let dictRes = response.result.value as! Dictionary
self.arrProductList = (dictRes["data"] as! [Dictionary]?)!
print("self.arrProductList",self.arrProductList.count)
self.clvPhotos.reloadData()
}
}
}
PRACTICAL DEMO
ReplyDeletehttps://drive.google.com/open?id=0B9hgnK1nQEjaMnMyUlM4RnQwMm8
BUG REPORT EXCEL SHEET
ReplyDeletehttps://docs.google.com/spreadsheets/d/1hsEVMi2FczL73HPBH0N71MRXYIUZ-sEOv0T6yB7oJ6Q/edit?usp=sharing
QA testcases documents
ReplyDeletehttps://docs.google.com/spreadsheets/d/12BtJyOGPLvTRBTWXXM5QL5c3S6Bl7ZiMqbUS4nQ4Qbk/edit?usp=sharing
QA Bug Report
ReplyDeletehttps://docs.google.com/spreadsheets/d/1hsEVMi2FczL73HPBH0N71MRXYIUZ-sEOv0T6yB7oJ6Q/edit?usp=sharing
ALAMOFIRE WEBSERVICE AND SIDE MENU
ReplyDeletehttps://drive.google.com/file/d/0B9hgnK1nQEjaekt0cVBRYk11VHc/view?usp=sharing
3-Dec-2017 work
ReplyDeletehttps://drive.google.com/open?id=1GaMF4D_Ts3ETtDuQ7UYjwdW1E5dPQF-r