'XCode' 카테고리의 다른 글

시뮬레이터 Document 폴더 확인  (0) 2015.11.30
XCode Version Select 및 Version Check  (0) 2015.11.25

참고 : https://tmondev.blog.me/220690677856


오토레이아웃을 쉽고 가독성있게 도와주는 snapkit

https://github.com/SnapKit/SnapKit




'Autolayout' 카테고리의 다른 글

autolayout 사용시 좌/우에 여백이 생기는 경우  (0) 2015.04.07

참고 : https://crunchybagel.com/working-with-hex-colors-in-swift-3/


RGB 헥사 값을 UIColor로 변환 사용하는 예

extension UIColor {

    convenience init(hex: String) {

        let scanner = Scanner(string: hex)

        scanner.scanLocation = 0

        var rgbValue: UInt64 = 0        

        scanner.scanHexInt64(&rgbValue)

        

        let r = (rgbValue & 0xff0000) >> 16

        let g = (rgbValue & 0xff00) >> 8

        let b = rgbValue & 0xff

        

        self.init(

            red: CGFloat(r) / 0xff,

            green: CGFloat(g) / 0xff,

            blue: CGFloat(b) / 0xff, alpha: 1

        )

    }

}

let color = UIColor(hex: "ff0000") 



유용한 정보였길 바란다.

'Swift > ' 카테고리의 다른 글

유용하게 쓰이는 랜덤 함수  (0) 2017.10.14
UserDefaults 와 Array  (0) 2017.09.22
텍스트 필드에서 숫자만 입력받기  (0) 2017.09.03
UITextView Placeholder  (0) 2017.08.19
HTTP Networking Framework - Alamofire  (0) 2016.02.03

UITextView에 입련 힌트를 보여줄 수 있는 Placeholder를 추가해줄 수 있는 클래스


간단하다.


링크로 들어가 클래스 파일만 추가하고 해당 텍스트뷰의 placeholder에 힌트만 적어주면 된다.

(ex : textview.placeholder = "힌트")


정말 편리하다.


설명이된 블로그 

https://finnwea.com/blog/adding-placeholders-to-uitextviews-in-swift


git-hub

https://gist.github.com/tijme/14ec04ef6a175a70dd5a759e7ff0b938


'Swift > ' 카테고리의 다른 글

UserDefaults 와 Array  (0) 2017.09.22
텍스트 필드에서 숫자만 입력받기  (0) 2017.09.03
HTTP Networking Framework - Alamofire  (0) 2016.02.03
StatusBar hidden 하기 (Swift)  (0) 2015.04.08
swiftdoc.org  (0) 2015.01.20

+ Recent posts