This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <UIKit/UIKit.h> | |
@interface CardView : UIView | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// set data be like this | |
var dataList = [Any]() | |
for items in DataArray | |
{ | |
let data = RunnningJobModel.initWithDictionary(dictionary: items as! NSDictionary) | |
self.dataList.append(data) | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// GET the JSON Data like this | |
Alamofire.request("YOUR-SERVER-URL").responseJSON { response in | |
print("Request: \(String(describing: response.request))") // original url request | |
print("Response: \(String(describing: response.response))") // http url response | |
print("Result: \(response.result)")// response serialization resul | |
if let json = response.result.value{ | |
let JsonData = json as! NSDictionary | |
let status = JsonData["status"] as? Int | |
let message = JsonData["message"] as? String |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
step 1-import the following | |
using System.Text.RegularExpressions; | |
step 2- define | |
public const string MatchEmailPattern = | |
@"^(([\w-]+\.)+[\w-]+|([a-zA-Z]{1}|[\w-]{2,}))@" | |
+ @"((([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\.([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\." | |
+ @"([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\.([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])){1}|" | |
+ @"([a-zA-Z]+[\w-]+\.)+[a-zA-Z]{2,4})$"; | |
step 3-call the following function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//#define USE_SharpZipLib | |
#if !UNITY_WEBPLAYER | |
#define USE_FileIO | |
#endif | |
/* * * * * | |
* A simple JSON Parser / builder | |
* ------------------------------ | |
* | |
* It mainly has been written as a simple JSON parser. It can build a JSON string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//follow to following steps to get twitter login | |
step1- register your app on twitter dashboard | |
step 2- add following code in info.plist betbeen <dict> and </dict> | |
<key>CFBundleURLTypes</key> | |
<array> | |
<dict> | |
<key>CFBundleURLSchemes</key> | |
<array> | |
<string>twitterkit-<consumerKey></string> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void showToast(string text) | |
{ | |
if (Application.platform == RuntimePlatform.Android) { | |
AndroidJavaClass unityPlayer = new AndroidJavaClass ("com.unity3d.player.UnityPlayer"); | |
AndroidJavaObject currentActivity = unityPlayer.GetStatic<AndroidJavaObject> ("currentActivity"); | |
AndroidJavaClass Toast = new AndroidJavaClass ("android.widget.Toast"); | |
AndroidJavaObject javaString = new AndroidJavaObject ("java.lang.String", text); | |
AndroidJavaObject context = currentActivity.Call<AndroidJavaObject> ("getApplicationContext"); | |
AndroidJavaObject toast = Toast.CallStatic<AndroidJavaObject> ("makeText", context, javaString, Toast.GetStatic<int> ("LENGTH_SHORT")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func sendData() | |
{ | |
let old_price = Price.text! | |
UserDefaults.standard.setValue(old_price, forKey: "old_price") | |
let prs = [ | |
"coupon_code": CoupanField.text! as String , | |
"order_price" : "\(final_price)" | |
] as [String:String] | |
Service.Start(VC: self,dic: prs, url: "\(GlobalVariable.serverName)coupon.php", onCompletion: { result in | |
print("result \(result)") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(void)sendData:(NSString*)email : (NSString*)password :(NSString*)user_id : (NSString*)urlString : (NSString*)name { | |
NSLog(@"sendData"); | |
NSURL *url = [NSURL URLWithString:urlString]; | |
NSMutableURLRequest * urlRequest = [NSMutableURLRequest requestWithURL:url]; | |
NSString *dataString = [NSString stringWithFormat:@"email=%@&password=%@&id=%@",email,password,user_id]; | |
NSData *requestData = [dataString dataUsingEncoding:NSUTF8StringEncoding]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// add the webview to your view controller add call web view delegate | |
// register your app into instagram | |
// add following code in to button action | |
let clientID = "aef611af2a1e4806a7de8c0aca13daac" | |
let redirect_uri = "http://weebook.in/" | |
let getAccessToken = "https://api.instagram.com/oauth/authorize/?client_id=\(clientID)&redirect_uri=\(redirect_uri)&response_type=token" | |
self.InstagramWebView.loadRequest(NSURLRequest(url: NSURL(string:getAccessToken as String)! as URL) as URLRequest) | |
// delegate function of weview |
NewerOlder