iOS
-
class CustomView: UIView{ @IBInspectable var borderWidth: CGFloat { get{ return layer.borderWidth } set{ layer.borderWidth = newValue } } @IBInspectable var borderColor: UIColor?{ get{ return UIColor(cgColor: layer.borderColor!) } set{ layer.borderColor = newValue?.cgColor } } } Storyboard로 이동해서 UIView 생성 합니다. 출처 iOS ) 왕초보를 위한 IBInspectable / IBDesignable 사용해보기 안녕하세요 :) Zedd입니다.쓰려고 한 글들은 많지만...저..
[iOS] @IBInspectableclass CustomView: UIView{ @IBInspectable var borderWidth: CGFloat { get{ return layer.borderWidth } set{ layer.borderWidth = newValue } } @IBInspectable var borderColor: UIColor?{ get{ return UIColor(cgColor: layer.borderColor!) } set{ layer.borderColor = newValue?.cgColor } } } Storyboard로 이동해서 UIView 생성 합니다. 출처 iOS ) 왕초보를 위한 IBInspectable / IBDesignable 사용해보기 안녕하세요 :) Zedd입니다.쓰려고 한 글들은 많지만...저..
2024.01.06 -
LocalAuthentication 생체인식이나 이미 알고 있는 암호를 사용하여 사용자 인증 LocalAuthentication을 import 하고, LAcontext를 선언 import LocalAuthentication private var context = LAContext() 인증 시도 함수 var error: NSError? if context.canEvaluatePolicy(.deviceOwnerAuthentication, error: &error) { let reason = "Log in to your account" context.evaluatePolicy(.deviceOwnerAuthentication, localizedReason: reason) { [weak self] isSucces..
[iOS] LocalAuthenticationLocalAuthentication 생체인식이나 이미 알고 있는 암호를 사용하여 사용자 인증 LocalAuthentication을 import 하고, LAcontext를 선언 import LocalAuthentication private var context = LAContext() 인증 시도 함수 var error: NSError? if context.canEvaluatePolicy(.deviceOwnerAuthentication, error: &error) { let reason = "Log in to your account" context.evaluatePolicy(.deviceOwnerAuthentication, localizedReason: reason) { [weak self] isSucces..
2024.01.06 -
URL let urlString = "https://ios-development.tistory.com/search/users?id=123&age=20" let url = URL(string: urlString) /// 주소 전체 "https://ios-development.tistory.com/search/users?id=123&age=20" print(url?.absoluteURL) /// 어떤식으로 네트워킹 하는지 "https" print(url?.scheme) /// baseURL과 같이 메인 주소 "ios-development.tistory.com" print(url?.host) /// host뒤에 query parameter를 제외한 주소 "/search/users" print(url?.path..
[Swift] URL, URLComponentsURL let urlString = "https://ios-development.tistory.com/search/users?id=123&age=20" let url = URL(string: urlString) /// 주소 전체 "https://ios-development.tistory.com/search/users?id=123&age=20" print(url?.absoluteURL) /// 어떤식으로 네트워킹 하는지 "https" print(url?.scheme) /// baseURL과 같이 메인 주소 "ios-development.tistory.com" print(url?.host) /// host뒤에 query parameter를 제외한 주소 "/search/users" print(url?.path..
2023.12.30 -
1. UIResponder 추가 // 현재 응답받는 UI를 알아내기 위해 사용 (textfield, textview 등) extension UIResponder { private struct Static { static weak var responder: UIResponder? } static var currentResponder: UIResponder? { Static.responder = nil UIApplication.shared.sendAction(#selector(UIResponder._trap), to: nil, from: nil, for: nil) return Static.responder } @objc private func _trap() { Static.responder = self } ..
[iOS] 키보드 처리1. UIResponder 추가 // 현재 응답받는 UI를 알아내기 위해 사용 (textfield, textview 등) extension UIResponder { private struct Static { static weak var responder: UIResponder? } static var currentResponder: UIResponder? { Static.responder = nil UIApplication.shared.sendAction(#selector(UIResponder._trap), to: nil, from: nil, for: nil) return Static.responder } @objc private func _trap() { Static.responder = self } ..
2023.12.30 -
두 개의 Storyboard 생성합니다. SceneDelegate.swift에서 코드 추가 func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { guard let windowScene = (scene as? UIWindowScene) else { return } var initialViewController = UIViewController() var storyboard = UIStoryboard() if UIDevice.current.userInterfaceIdiom == .pad{ storyboard = UIStoryboard(name..
[iOS] 기종별로(iPhone, iPad) StoryBoard 구분하기두 개의 Storyboard 생성합니다. SceneDelegate.swift에서 코드 추가 func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { guard let windowScene = (scene as? UIWindowScene) else { return } var initialViewController = UIViewController() var storyboard = UIStoryboard() if UIDevice.current.userInterfaceIdiom == .pad{ storyboard = UIStoryboard(name..
2023.12.30 -
Dispatch (Framework) 시스템에서 관리하는 Dispatch 대기열에 작업을 제출하여 Multi Core 하드웨어에서 코드를 동시에 실행 GCD(Grand Central Dispatch)라고 알려진 Dispatch에서는 macOS, iOS, watchOS 및 tvOS의 멀티코어 하드웨어에서 동시 코드 실행 지원에 대한 체계적이고 포괄적인 개선사항을 제공하는 언어 기능 Runtime 라이브러리 및 시스템 개선사항이 포함되어 있음 Dispatch | Apple Developer Documentation Execute code concurrently on multicore hardware by submitting work to dispatch queues managed by the system. ..
[Swift] Dispatch (1)Dispatch (Framework) 시스템에서 관리하는 Dispatch 대기열에 작업을 제출하여 Multi Core 하드웨어에서 코드를 동시에 실행 GCD(Grand Central Dispatch)라고 알려진 Dispatch에서는 macOS, iOS, watchOS 및 tvOS의 멀티코어 하드웨어에서 동시 코드 실행 지원에 대한 체계적이고 포괄적인 개선사항을 제공하는 언어 기능 Runtime 라이브러리 및 시스템 개선사항이 포함되어 있음 Dispatch | Apple Developer Documentation Execute code concurrently on multicore hardware by submitting work to dispatch queues managed by the system. ..
2023.11.23