일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
- MS-SQL
- 날짜
- PyQt
- swift
- 유니티
- pandas
- mssql
- Linux
- ASP
- ubuntu
- 리눅스
- flutter
- Unity
- PER
- port
- 맛집
- 함수
- GIT
- PyQt5
- urllib
- Excel
- sqlite
- node.js
- tensorflow
- IOS
- MySQL
- javascript
- python
- 다이어트
- 라즈베리파이
목록랭귀지 (557)
아미(아름다운미소)
TableView cell 클릭 이벤트 작동안할 때 (tableview(didSelectRowAt) not called)tableView cell을 클릭 시 페이지 전환을 구현하려 하는데 계속해서 tableView(didSelectRowAt) 함수가 실행되지않는다면storyboard에서 tableview의 속성을 살펴시면 Selection항목이 No Selection으로 되어있을겁니다^^ 이걸 Single Selction으로 바꿔주면 됩니다. 해결법은 매우 간단합니다 storyboard에서 속성을 살펴보세요
UserDefaults 값 모두 초기화 하기 간혹 테스트 및 초기 값 상태에서 작업할 시 Userdefault 값을 다 날려야할 경우가 있는데 이를 수행하는 Code 입니다. import UIKit for key in UserDefaults.standard.dictionaryRepresentation().keys { UserDefaults.standard.removeObject(forKey: key.description) }
UserDefaults는 Swift에서 작은 데이터를 저장시 검색하기에 간편하고 편리합니다.iOS 응용 프로그램 에서 작은 데이터를 간단히 저장하고 불러오는데 UserDefaults를 자주 사용는데요. UserDefaults를 사용하는 이유는 설정, 상태 또는 기록과 같이 소량의 데이터를 간단히 저장하고자 할때 Core Data대신 사용하면 유리합니다 . UserDefaults는 Bool , Dictionary , Int , String , Data , Array 와 같은 데이터 유형을 지원합니다 . 문자열 저장UserDefaults.standard.set( "AGROUP", forKey : "name") 문자열 검색let = UserDefaults.standard.string(forKey : "name..
iOS / Swift Status Bar Background Color 변경 - .plist 에 추가 - 소스에 추가 UIApplication.shared.statusBarStyle = .lightContent UINavigationBar.appearance().clipsToBounds = true let statusBar: UIView = UIApplication.shared.value(forKey: "statusBar") as! UIView statusBar.backgroundColor = UIColor(red: 0.0/255.0, green: 152.0/255.0, blue: 186.0/255.0, alpha: 1.0)
UITableViewCell 선택 스타일을 사용하지 않도록 설정 ... //테이블 셀 객체를 직접 생성하는 대신 큐로부터 가져옴 let cell = tableView.dequeueReusableCell(withIdentifier: "ListCell") as! ContractCell // UITableViewCell 선택 스타일을 사용하지 않도록 설정 cell.selectionStyle = UITableViewCellSelectionStyle.none }
UITextField또는 UITextView에 사용자가 특정 글자 수보다 더를 입력되는것을 방지하려면 shouldChangeCharactersIn(텍스트 필드) 또는 shouldChangeTextIn(텍스트 뷰) 를 사용하시면 됩니다.UITextField (한 줄)로 작업하는지 또는 UITextView (여러 줄)로 작업하는지에 따라서 두 가지 방법 중 하나를 사용 하시면 됩니다. - textField func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { let currentText = textField.text ?? "" guard ..
UITableViewCell의 ImageView를 고정 func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { ... cell.imageView?.image = myImage let itemSize = CGSize(width:42.0, height:42.0) UIGraphicsBeginImageContextWithOptions(itemSize, false, 0.0) let imageRect = CGRect(x:0.0, y:0.0, width:itemSize.width, height:itemSize.height) cell.imageView?.image!.draw(in:imageRect) c..
일반적으로 UIColor를 사용할 때 다음과 같이 rgba값을 많이 사용합니다. 하지만 UI 작업을 하다 보면 UIColor 클래스 메소드에 답답함을 느낄 때가 있는데 대표적으로 RGB 값의 입력입니다. - 일반 passwordTextField.textColor = UIColor(red:54.0/255.0, green:54.0/255.0, blue:54.0/255.0, alpha:1.0) - extension extension UIColor { convenience init(r: CGFloat, g: CGFloat, b: CGFloat) { self.init(red: r/255, green: g/255, blue: b/255, alpha: 1) } } - 적용 //let color = UIColor(re..
리눅스에서 swap 메모리를 초기화하는 것은 아주 간단합니다. 일시적 메모리 사용의 증가로 swap을 사용하게될 경우 메모리에 여유가 생겨도 swap 메모리는 자동으로 초기화되지 않습니다. 이것을 수동으로 초기화하려면 아래의 명령을 입력하면 됩니다. 당연히 root 권한에서 실행해야 합니다. swapoff -a && swapon -a swapoff 처리에 시간이 조금 오래 걸릴 수 있는데 서버가 멈춘 것이아니고 swap 메모리에서 필요한 부분을 물리 메모리로 옮기는 처리중인 것이니 걱정하지 않으셔두 됩니다^^.
라즈베리파이 Node.js 최신버전 설치 라즈베리파이에는 기본적으로 Node.js (현재 4.3) 가 깔려있습니다. 현재깔려있는 버전확인하기 pi@raspberrypi:~$ node -v Node.js 삭제 pi@raspberrypi:~$ sudo apt-get remove nodered -y pi@raspberrypi:~$ sudo apt-get remove nodejs nodejs-legacy -y pi@raspberrypi:~$ sudo apt-get remove npm -y 원하는 버전의 설치 8.x 버전을 설치하기 pi@raspberrypi:~$ curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - pi@raspberrypi:~$ sud..