반응형

➰ 🍎🍏🍎🍏/iOS 11

[iOS] StoryBoard 없이 Xcode 프로젝트 만들기

1. 프로젝트 생성 storyBoard Interface 로 Xcode Project 를 새롭게 만들어줍니다. 2. Info.plist > Storyboard Name 제거 Project > Info.plist > Scene Configuration > Application Session Role > Item 0 으로 이동해 Storyboard Name 을 제거해줍니다. 3. UIKit Main Storyboard File Base Name 제거 Project Target > Build Setting > Info.plist Values 으로 이동해 UIKit Main Storyboard File Base Name 을 제거해줍니다. 4. Main.storyboard File 제거 File List > Ma..

[iOS] UIButton 애니메이션 효과 지우기

문제발생 도형의 위치를 반환하는 UIButton 을 만들었고 그 결과를 확인해보니 아래와 같이 애니메이션이 자동으로 적용되어 변화가 한눈에 잘 보이지 않는 문제가 발생하였습니다. 찾아보니 버튼의 애니메이션 효과는 default 로 설정되어 있어, Inspectors 창에서 변경 할 수 없고 코드로 수정해야한다고 합니다 해결 방법 우측 Inspectors 창에서 Attributes Inspector > Button > Type 을 Custom 으로 변경한 후, 아래의 코드와 같이 버튼의 layoutIfNeeded 메소드를 사용하면 애니메이션을 없앨 수 있습니다. @IBOutlet weak var XButton: UIButton! @IBOutlet weak var YButton: UIButton! overr..

[Error Solved] unrecognized selector sent to instance 0xffffff

발생한 에러 unrecognized selector sent to instance 0xfffff 원인 및 해결방법 에러가 나는 label이나 button 에서 마우스 오른쪽 버튼을 눌러 연결되어있는 변수들을 확인해보세요! 저는 중간에 IBAction 이름을 변경하면서 변수를 삭제하면 연결도 끊어지는줄 알았는데 아직 연결이 되어있어서 에러가 났었더라구요! Swift 에서는 변수를 삭제한다고 연결도 끊기지는 않으니! 항상 조심하기! 🙉

[Error Solved] The specified item could not be found in the keychain.

발생한 에러 The specified item could not be found in the keychain. 원인 및 해결방법 제가 상단의 set the active scheme 부분을 iphone 이 아니라 My Mac 으로 해서 생긴 문제였습니다. iOS 로 개발하고 있었는데 Mac 으로 실행하려니까 문제가 발생했던 걸까요..ㅠ 저는 이 부분을 iPhone 으로 변경하니까 문제가 해결되었답니다 ㅎㅎ

[Error Solved] Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<FruitCardGame.ViewController 0x123e07680> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key IBAction.' *** First throw call s..

발생한 에러 Xcode 에서 storyboard 수정 후 발생 Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key IBAction.' *** First throw call s.. 원인 및 해결방법 button > 오른쪽 마우스 클릭을 통해 현재 버튼이 Outlet 과 Action 이 중첩되서 선언되지는 않았는지 확인해보세요! 기능이 중첩되지 않도록 수정하면 위의 에러를 해결하실 수 있습니다

[Error Solved] nw_endpoint_handler_set_adaptive_read_handler [C2 127.0.0.1:57326 ready socket-flow (satisfied (Path is satisfied), viable, interface: lo0, scoped)] unregister notification for read_timeout failed

발생한 에러 2021-08-12 20:29:59.193790+0900 Day19[9959:6805055] [connection] nw_endpoint_handler_set_adaptive_read_handler [C2 127.0.0.1:57326 ready socket-flow (satisfied (Path is satisfied), viable, interface: lo0, scoped)] unregister notification for read_timeout failed 2021-08-12 20:29:59.193860+0900 Day19[9959:6805055] [connection] nw_endpoint_handler_set_adaptive_write_handler [C2 127.0.0.1:573..

[Swift] Closure와 고차함수(filter, reduce, map, sort, forEach)

Closure란? 클로저는 중괄호({})로 감싸진 실행 가능한 코드 블럭입니다. func helloGenerator(message: String) -> (String, String) -> String { return { (firstName: String, lastName: String) -> String in return lastName + firstName + message } } 함수와는 다르게 함수 이름 정의가 따로 존재하지 않습니다. 하지만 파라미터를 받을 수 있고, 반환 값이 존재할 수 있다는 점에서 함수와 동일합니다. 즉, 함수는 이름이 있는 클로저입니다. 클로저는 in 키워드를 사용해서 파라미터, 반환 타입 영역과 실제 클로저의 코드를 분리하고 있습니다. Swift 컴파일러의 타입 추론 덕분..

SwiftSoup 라이브러리 설치하기

🔥 SwiftSoup 라이브러리 설치 Cocoapods 를 사용하여 SwiftSoup를 설치할 수 있다. CocoaPods는 Xcode 를 사용하는 개발자들에게 꼭 필요한 프로젝트 매니저이다. 아래 코드를 사용하여 cocoapods 를 설치해준다. sudo gem install cocoapods 코코아팟 라이브러리를 적용하고 싶은 프로젝트 경로에 들어가서 아래의 명령어를 입력하여 podfile 을 생성해준다. 이제 podfile 을 수정하여 라이브러리를 다운 받을 수 있다. 여기서 podfile 이란 cocoapods 가 관리할 라이브러리들을 설정하기 위한 파일이다. pod init 이제 podfile을 수정하여 SwiftSoup를 설치해보자 podfile 안에 아래의 코드를 추가하고 pod 'Swift..