Skip to content

Instantly share code, notes, and snippets.

View ElonPark's full-sized avatar
📱
 iOS Software Engineer

Elon Park ElonPark

📱
 iOS Software Engineer
View GitHub Profile
@ElonPark
ElonPark / reject.md
Last active May 31, 2017 07:25
애플 리젝 사항

PLA 1.2 리젝에 관하여

Apple의 메시지

  1. 10.0 Before You Submit: Program License Agreement (iOS) >
@ElonPark
ElonPark / createWebViewWith.swift
Last active November 20, 2023 09:28
WKWebView에서 자바스크립트로 window.open(), window.close() 하는 경우 처리
/** - 새창 열기, 닫기 예제 **/
///메인으로 사용중인 웹뷰
lazy var webView = WKWebView()
///window.open()으로 열리는 새창
var createWebView: WKWebView?
func webView(_ webView: WKWebView, createWebViewWith configuration: WKWebViewConfiguration, for navigationAction: WKNavigationAction, windowFeatures: WKWindowFeatures) -> WKWebView? {
@ElonPark
ElonPark / duplicate_xcode_project_target.rb
Last active February 6, 2018 09:28 — forked from ratazzi/duplicate_xcode_project_target.rb
Duplicate Xcode Project Target with Ruby
#!/usr/bin/env ruby
require 'rubygems'
require 'xcodeproj'
name = 'test_copy'
proj_path = 'test.xcodeproj'
proj = Xcodeproj::Project.open(proj_path)
src_target = proj.targets.last #find { |item| item.to_s == 'test' }
@ElonPark
ElonPark / gist:4040787393fd16db2d2c5d576e6177e1
Created March 21, 2018 09:25 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
func euckrEncoding(_ query: String) -> String { //EUC-KR 인코딩
let rawEncoding = CFStringConvertEncodingToNSStringEncoding(CFStringEncoding(CFStringEncodings.EUC_KR.rawValue))
let encoding = String.Encoding(rawValue: rawEncoding)
let eucKRStringData = query.data(using: encoding) ?? Data()
let outputQuery = eucKRStringData.map {byte->String in
if byte >= UInt8(ascii: "A") && byte <= UInt8(ascii: "Z")
|| byte >= UInt8(ascii: "a") && byte <= UInt8(ascii: "z")
|| byte >= UInt8(ascii: "0") && byte <= UInt8(ascii: "9")
@ElonPark
ElonPark / Logger.swift
Last active August 21, 2019 07:53
간단한 로그 프린트용
//
// Logger.swift
//
//
// Created by Elon on 23/01/2019.
// Copyright © 2019 Elon. All rights reserved.
//
import Foundation
@ElonPark
ElonPark / GitCommitEmoji.md
Created February 11, 2019 18:32 — forked from parmentf/GitCommitEmoji.md
Git Commit message Emoji
@ElonPark
ElonPark / ArrayTransform.swift
Created February 26, 2019 18:23
Realm, ObjectMapper 사용시 JSON Array를 Realm Object List로 변경하기 위해 사용한다.
import RealmSwift
import ObjectMapper
class ArrayTransform<T: RealmSwift.Object>: TransformType where T: Mappable {
typealias Object = List<T>
typealias JSON = Array<AnyObject>
/**
- Parameter value: JSON Value
- Returns: if value is `nil` or not Array will be return empty List<T>
@ElonPark
ElonPark / StringAttributeExtension.swift
Created March 23, 2019 20:49
어트리뷰트 스트링을 편하게 사용하기 위한 익스텐션
extension String {
/**
## bold
- Parameter size: 폰트 크기
- Parameter color: 폰트 컬러
*/
func bold(size fontSize: CGFloat, color: UIColor? = nil) -> NSMutableAttributedString {
var attributes: [NSAttributedString.Key : Any] = [
enum AppStoryboard: String {
case main = "Main"
}
extension UIViewController {
static func instantiate<T: UIViewController>(by storyboardName: AppStoryboard) -> T? {
let type = String(describing: T.Type.self)
guard let identifier = type.components(separatedBy: ".").first else { return nil }
let storyboard = UIStoryboard(name: storyboardName.rawValue, bundle: nil)