iOS 썸네일형 리스트형 [iOS UIKit in Swift 4] imageView로 image 표현하기 (Display images with UIImageView) imageView로 image 표현하기이미지를 scale up, scale down, rotate, reverse해 보았습니다. CGAffineTransform를 사용하여 위치와 크기를 적용하였습니다. 아래 이미지와 소스코드를 비교해보시면 좀 더 이해하기 편합니다.궁금하신점은 댓글로 달아주세요. 해피코딩 :) Preview Source Githubhttps://github.com/calmone/iOS-UIKit-component ReferenceUIImageView https://developer.apple.com/reference/uikit/uiimageviewUIImage https://developer.apple.com/reference/uikit/uiimage [iOS UIKit in Swift 4] UITabBarController 사용하기 (Display tab with UITabBarController) UITabBarController 사용하기간단한 UITabBarController를 만들어 보았습니다.UITabBarController에 setViewControllers를 사용하여 UIViewController를 넣어주면 UIViewController의 개수만큼 탭이 만들어지고 각 UIViewController에서 UITabBarItem을 생성해주면 해당 내용으로 이미지와 텍스트가 노출되게 됩니다.UITabBarItem은 시스템에서 제공하는것을 사용하는 방법과 커스텀으로 텍스트와 이미지를 만드는 방법이 있습니다. Tip) UIViewController를 가지고 있는 Array를 map하여 UINavigationController의 rootViewController로 생성해주면 탭마다 UINavigati.. [iOS UIKint in Swift 4] UINavigationController 사용하기 (Display UINavigationController) UINavigationController 사용하기UINavigationController를 사용하여 ViewController를 이동해 보았습니다.pushViewController를 하게되면 ViewController stack에 추가되고popViewController를 하게되면 ViewController stack에서 사라지게 됩니다. navigationController에서 제공하는 함수를 사용하여 ViewController를 이동할 수 있습니다.1. func pushViewController(UIViewController, animated: Bool)해당 ViewController로 이동하고 stack에 추가합니다.2. func popViewController(animated: Bool) -> UI.. [iOS UIKit in Swift 4] UIPickerView 사용하기 (Select value with UIPickerView) UIPickerView 사용하기간단한 UIPickerView를 만들어 봤습니다. UIPickerViewDataSource를 통해 PickerView의 데이터를 세팅하고UIPickerViewDelegate를 통해 PickerView의 이벤트를 처리할 수 있습니다. func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) 에서 선택한 row의 값을 알 수 있습니다. 아래 이미지와 소스코드를 비교해보시면 좀 더 이해하기 편합니다.궁금하신점은 댓글로 달아주세요. 해피코딩 :) Preview Source Githubhttps://github.com/calmone/iOS-UIKit-component Re.. [iOS UIKit in Swift 4] UIAlertController 사용하기 (View alerts with UIAlertController) UIAlertController 사용하기Show UIAlert라 써져있는 버튼을 누르게되면 AppDelegate에 만들어놓은 showAlert 함수를 통해 UIAlertController를 생성합니다.AppDelegate에 만들어놓은 이유는 모든 ViewController에서 접근이 가능하기 때문입니다.Title, Message, ActionButton의 Title, ActionButton의 타입 등을 정할 수 있습니다.액션 이후의 처리가 필요하면 액션의 completion에서 처리하면 됩니다. 아래 스크린샷과 소스코드를 비교해보시면 좀 더 이해하기 편할겁니다.궁금하신점은 댓글로 달아주세요. 해피코딩 :) Preview Source Githubhttps://github.com/calmone/iOS-UIK.. 이전 1 ··· 4 5 6 7 8 9 다음