
swift 코드 objective c 에서 사용하기
TestService라는 swift 코드를 class, func 앞에 @objc를 붙여 작성을 한다. 해당 클래스를 사용할 objective-c 파일에서 이런식으로 -Swfit를 붙여 선언을 해주면 #import 이렇게 swfit에 존재하는 클래스,함수를 옵씨에서 사용 가능하다.
TestService라는 swift 코드를 class, func 앞에 @objc를 붙여 작성을 한다. 해당 클래스를 사용할 objective-c 파일에서 이런식으로 -Swfit를 붙여 선언을 해주면 #import 이렇게 swfit에 존재하는 클래스,함수를 옵씨에서 사용 가능하다.
Error: Cannot install under Rosetta 2 in ARM default prefix (/opt/homebrew)! To rerun under ARM use: arch -arm64 brew install ... To install under x86_64, install Homebrew into /usr/local. 라는 에러.... intel,m1 경로차이 때문에 생기는 에러인것 같습니다. 해결방법 >> arch -arm64 brew install XXXXX
guard let url = URL(string: UIApplication.openSettingsURLString) else { return } if UIApplication.shared.canOpenURL(url) { UIApplication.shared.opne(url) } https://developer.apple.com/documentation/uikit/uiapplicationopensettingsurlstring?language=objc
UserDefaults.standard.set(Date(), forKey:"creationTime1") if let date = UserDefaults.standard.object(forKey: "creationTime1") as? Date { if let diff = Calendar.current.dateComponents([.hour], from: date, to: Date()).hour, diff > 24 { keys.setNewTokenValue() } }
self.webView.uiDelegate = self uiDelegate 선언 func webView(_ webView: WKWebView, createWebViewWith configuration: WKWebViewConfiguration, for navigationAction: WKNavigationAction, windowFeatures: WKWindowFeatures) -> WKWebView? { if navigationAction.targetFrame == nil { webView.load(navigationAction.request) } return nil }
Could not find 'CFPropertyList' (>= 2.3.3, Could not find 'cocoapods' (>= 0) among N total gem(s) (Gem::LoadError) When I am trying to pod install, getting following issue: Faizs-MBP:newj faizfareed$ pod install /Library/Ruby/Site/2.0.0/rubygems/dependency.rb:315:in `to_specs': Could not find 'cocoapods' (>... stackoverflow.com sudo gem uninstall --all sudo gem install -n /usr/local/bin cocoapod..