Skip to content

Instantly share code, notes, and snippets.

//Method just for getting keyboard height
@objc func keyboardWillShow(_ notification: Notification) {
if let keyboardFrame: NSValue = notification.userInfo?[UIKeyboardFrameEndUserInfoKey] as? NSValue {
let keyboardRectangle = keyboardFrame.cgRectValue
keyboardHeight = keyboardRectangle.height
}
}
func checkIfKeyboardIsOverTextField(keyboardHeight: CGFloat) {
for field in textfieldCollection {
//Data coming from API when selecting
{
data = {
food = (
);
logo = "";
picture = "";
};
msg = "Venue detail";
status = 1;
Needs to return venue objects
{
"place_id": "1",
"name": "Elitch Garden",
"picture": "http://api.lineopener.com/uploads/elitches_3.jpg",
"status": "1",
"created": "2017-12-18 00:00:00",
"venue_count": 2
},
{
"venue_id": "3",
"place_id": "5",
"name": "McCrady's",
"cuisine_filter": {"Indian", "Breakfast", "American", "Burger"} <-- or whatever
"address": "Per Se, New York City",
"phone_number": "7854732545",
"description": "Test Data To add data",
"picture": "http://api.lineopener.com/uploads/street-view.jpg",
"logo": "http://api.lineopener.com/uploads/street-view.jpg",
{
"status": 1,
"msg": "Venue detail",
"statuscode": 201,
"data": {
"venue_id": "1",
"place_id": "1",
"name": "Test Venue",
"address": "Its A test Address",
"phone_number": "123456123456",
{
"status": 1,
"msg": "Category List",
"statuscode": 201,
"data": [
{
"category_id": "1",
"name": "burgers",
"venue_id": "1",
"picture": "http://api.lineopener.com/uploads/burguer.png",
{
"status": 1,
"msg": "Food style List",
"statuscode": 201,
"data": {
"patty": [
{
"food_style_id": "1",
"food_id": "1",
"style_name": "patty",
<NSHTTPURLResponse: 0x604000226700> { URL: http://api.lineopener.com/index.php/api/login } { Status Code: 200, Headers {
"Cache-Control" = (
"no-store, no-cache, must-revalidate, post-check=0, pre-check=0"
);
Connection = (
"Keep-Alive"
);
"Content-Type" = (
"application/json"
);
//modified curl method - Success
curl -d "email=test@test.com&password=test123" -X POST http://api.lineopener.com/index.php/api/login
{"status":1,"msg":"Login successfully","statuscode":201,"data":{"user_id":"2","email":"test@test.com","phone_number":"","password":"cc03e747a6afbbcbf8be7668acfebee5","fb_id":"","password_reset_code":"","status":"1","created":"2017-10-26 14:17:29","updated":"2017-10-26 14:17:29"}}
//tried as single line (failed)
curl --request POST --url http://api.lineopener.com/index.php/api/login --header 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' --form email=test@test.com --form password=test123
{"status":0,"msg":"Please enter email","statuscode":403}