2020. 7. 3.How to show code info in Xcode (like vscode)
option + click
2020. 6. 30.Create a chrome shorcut to a bookmarklet
2020. 6. 30.Header vs Heading
Header: "The upper portion of a page (or other) layout."
Heading: "The title or topic of a document, article, chapter, or of a section thereof."
2020. 6. 30.Xcode 터미널에서 실행하기
$ xed .
$ xed .
2020. 6. 29.IB?
Interface Builder
2020. 6. 29.UIImagePickerControllerOriginalImage
FoodTracker 예제 중 Work with View Controllers 튜토리얼에 버그... 는 아니고 옛날 자료라서 지금 안돌아가는 게 있었다.
요 링크를 찾아 아래와 같이 해결
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {
// The info dictionary may contain multiple representations of the image. You want to use the original.
- guard let selectedImage = info[UIImagePickerControllerOriginalImage] as? UIImage else {
+ guard let selectedImage = info[.originalImage] as? UIImage else {
fatalError("Expected a dictionary containing as image, but was provided the following: \(info)")
}
// Set photoImageView to display the selected image.
photoImageView.image = selectedImage
// Dismiss the picker.
dismiss(animated: true, completion: nil)
}
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) {
// The info dictionary may contain multiple representations of the image. You want to use the original.
- guard let selectedImage = info[UIImagePickerControllerOriginalImage] as? UIImage else {
+ guard let selectedImage = info[.originalImage] as? UIImage else {
fatalError("Expected a dictionary containing as image, but was provided the following: \(info)")
}
// Set photoImageView to display the selected image.
photoImageView.image = selectedImage
// Dismiss the picker.
dismiss(animated: true, completion: nil)
}
2020. 6. 28.vscode가 포맷팅 하면서 자꾸 jsx에 빈칸을 넣으면
원인
.jsx
파일의 File Association
이 Babel JavaScript
로 되어있어서 생기는 문제.
해결 1
화면 하단의 language mode 영역을 클릭 -> JavaScript React
로 바꾸면 해결
해결 2
물론 settings.json
에서 바꿀수도 있다.
"files.associations": {
"*.jsx": "javascriptreact"
}
"files.associations": {
"*.jsx": "javascriptreact"
}
2020. 6. 28.vscode에서 swift language server 돌리기
xcode에선 vim key 바인딩, hover action 등등이 간단하게 안되는 것 같아 vscode에 개발 환경 꾸미는 게 가능할까 알아보았다.
- 원하는 위치에
sourcekit-lsp
를 클론 받는다. $ cd sourcekit-lst/Editors/vscode
$ npm run createDevPackage
$ code --install-extension out/sourcekit-lsp-vscode-dev.vsix
- 공식엔 여기까지 하면 된다고 나와있긴 한데, vscode에서
Starting client failed Launching server using command sourcekit-lsp failed.
라며 에러가 발생했다. $ xcrun -f sourcekit-lsp
로sourcekit-lsp
가 설치된 경로를 알아내서 복사한다.- vscode
settings.json
에 아래를 추가한다. -
"sourcekit-lsp.serverPath": "<경로>"
"sourcekit-lsp.serverPath": "<경로>"
- vscode를 reload 한다.
- 굳
- https://marketplace.visualstudio.com/items?itemName=vknabel.vscode-swiftlint 도 설치하면 좋다 카더라.
2020. 6. 27.rebase를 하다가 이건 아니다 싶으면
git rebase --abort
를 하면 된다.
2020. 6. 27.히스토리가 다른 git repo를 합치려면
merge
하면서 --allow-unrelated-histories
를 사용한다.