-
Remote > Data & Image
- URLSession delegate 의 receiveData 로부터 받은 data 를 모은 다음, UIImage(data: scale:) method 사용
-
Data > toDisk
- data 의 header 를 읽어서 타입(PNG, JPG, GIF)을 판별
- 위에서 만든 이미지를 다시 타입에 따라 데이터로 또 만들어 줌 (?)
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 | |
extension UIView { | |
var allSubviews: [UIView] { | |
subviews + subviews.flatMap { $0.allSubviews } | |
} | |
func firstSubview<T: UIView>(of type: T.Type) -> T? { | |
allSubviews.first { $0 is T } as? T |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
#!/bin/bash | |
# This will forch push current branch to origin | |
# This is just a short version of devxoul's `git pushme` script | |
# https://gist.githubusercontent.com/devxoul/a972ba0db2a25b989887/raw/f62353501becb274eb63c76b83fbcc01250a 286d/git-pushme | |
# | |
# 1. Move this file to ~/.gitsh/ | |
# 2. Add directory path($YOUR_HOME_PATH/.gitsh) to environment variable file | |
# (like ~/.bash_profile or ~/.zshrc) | |
# (This would be like 'export PATH=${PATH}:/Users/YOUR_HOME_PATH/.gitsh') | |
# 3. chmod 0755 git-pmf |
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
#oclint xcode include cocoapod project | |
OCLINT_HOME=/usr/local/Cellar/oclint/0.13 | |
export PATH=$OCLINT_HOME/bin:$PATH | |
hash oclint &> /dev/null | |
if [ $? -eq 1 ]; then | |
echo >&2 "oclint not found, analyzing stopped" | |
exit 1 |
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
/** - 새창 열기, 닫기 예제 **/ | |
///메인으로 사용중인 웹뷰 | |
lazy var webView = WKWebView() | |
///window.open()으로 열리는 새창 | |
var createWebView: WKWebView? | |
func webView(_ webView: WKWebView, createWebViewWith configuration: WKWebViewConfiguration, for navigationAction: WKNavigationAction, windowFeatures: WKWindowFeatures) -> WKWebView? { | |
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
// This is 4 year old code, and I have long since switched to PolarSSL | |
// But I have no reason to believe it is not still valid and functional | |
#include <openssl/rand.h> | |
#include <openssl/ecdsa.h> | |
#include <openssl/obj_mac.h> | |
#include <openssl/err.h> | |
#include <openssl/pem.h> | |
#include <openssl/evp.h> |
NewerOlder