Skip to content

Instantly share code, notes, and snippets.

https://re-engines.com/2018/12/25/swiftios%E3%81%AE%E8%84%B1%E7%8D%84%E3%83%81%E3%82%A7%E3%83%83%E3%82%AF%E3%82%92%E8%A1%8C%E3%81%86%E3%80%82/
var isJailBroken :Bool{
if TARGET_OS_SIMULATOR != 1{
if checkCydia||checkPass||checkWritable{
return true
}
}
return false
}
@hongseok
hongseok / SwiftKeychain.swift
Last active April 16, 2018 02:07
Simple Swift Keychain Sample
public class Keychain {
public class func save(val: String, key: String) {
let query = keychainQuery(withKey: key)
let objectData = val.data(using: .utf8, allowLossyConversion: false)
if SecItemCopyMatching(query, nil) == noErr {
if let dictData = objectData {
_ = SecItemUpdate(query, NSDictionary(dictionary: [kSecValueData: dictData]))
} else {
@hongseok
hongseok / GoogleVisionAPI.py
Last active April 2, 2016 01:08
Google Vision API Python Sample
#!/usr/bin/python
import json
import urllib2
import base64
API_KEY = "API_KEY"
API_URL = "https://vision.googleapis.com/v1/images:annotate?key=" + API_KEY
with open("faulkner.jpg", "rb") as image_file:
@hongseok
hongseok / BeaconAdvertiseViewController.m
Created April 1, 2016 07:06
iBeacon Advertisement Example
//
// ViewController.m
//
// Created by nhn on 2016. 4. 1.
// Copyright © 2016 HONGSEOK. All rights reserved.
//
#import "ViewController.h"
#import <CoreLocation/CoreLocation.h>