본문 바로가기

분류 전체보기

Swift error: missing argument label 'name:' in call 왜 argument label을 앞에 붙여야 하는가? Swift error: missing argument label 'name:' in call Swift requires argument labels by default, because it supports classes with multiple initializers. The benefit of argument labels comes from the ability of Swift to infer which initializer to use; not only by argument type, but argument name as well.struct Celsius { var temperatureInCelsius: Double = 0.0 init(fromF.. 더보기
using c++ in Mac OS create a new Xcode project macOS - Command Line Tool Language - c++ 더보기
selection algorithm // main.cpp // SelectSort // // Created by drake on 2020/05/24. // Copyright © 2020 drake. All rights reserved. // #include int main(int argc, const char * argv[]) { // insert code here... int temp, i, j, index, min; int arr[10] = {5, 10, 1, 8, 7, 6, 4, 3, 2, 9}; index = 0; for (i=0; i 더보기
git diff config p4merge in Mac Install p4merge from perforce.com Put the following bits in your ~/.gitconfig, and then you can do $ git mergetool and $ git difftool to use p4merge Note that $ git diff will still just use the default inline diff viewer :) [merge] keepBackup = false tool = p4merge [mergetool "p4merge"] cmd = /Applications/p4merge.app/Contents/Resources/launchp4merge "\"$PWD/$BASE\"" "\"$PWD/$REMOTE\"" "\"$PWD/$.. 더보기
my gitlab gitlab.com/nextzame 더보기
[swift] ViewController간 이동 class ViewController : UIViewController { func moveToSignIn(_ sender: Any) { let signInVC = UIStoryboard(name: "SignInVC", bundle: nil).instantiateViewController(withIdentifier: "signInVC") self.present(signInVC, animated: true, completion: nil) } } class SignInViewController: UIViewController { dismissVC(_ sender: Any) { self.dismiss(animated: true, completion: nil) } } buttonSignIn.layer.corne.. 더보기
네트워크 let loginURLString = "http://localhost:3000/loginUsers" let param = [ "userName" : userNameTextField.text ?? "", "password" : passwordTextField.text ?? "" ] var urlComponents = URLComponents(string: loginURLString) urlComponeents?.query = param.queryString guard let hasURL= urlComponents?.url else { return } URLSession.shared.dataTask(with: hasURL) { (data, response, error) in } extension Dictio.. 더보기
xcode에서 iPhone연결하기 1. 선을 통해서 iPhone을 연결 2. iPhone 신뢰를 선택 3. Connect via network를 선택 4. ip를 입력하라는 창이 나오면 iPhone에서 ip를 확인하고 입력함 더보기

]