{"id":18696092,"url":"https://github.com/jacobkosmart/ledborad-ios-practice","last_synced_at":"2025-11-08T14:30:32.319Z","repository":{"id":140609186,"uuid":"431783260","full_name":"jacobkosmart/ledBorad-ios-practice","owner":"jacobkosmart","description":"To Practice UINavigationController, transition, ViewController Life Cycle, send data to different page, asset catalogs","archived":false,"fork":false,"pushed_at":"2021-11-25T09:21:25.000Z","size":56,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-28T03:27:53.475Z","etag":null,"topics":["swift","uinavigationcontroller","viewcontro"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jacobkosmart.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-25T09:19:45.000Z","updated_at":"2021-12-05T10:03:06.000Z","dependencies_parsed_at":"2023-03-27T10:57:01.321Z","dependency_job_id":null,"html_url":"https://github.com/jacobkosmart/ledBorad-ios-practice","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobkosmart%2FledBorad-ios-practice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobkosmart%2FledBorad-ios-practice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobkosmart%2FledBorad-ios-practice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobkosmart%2FledBorad-ios-practice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jacobkosmart","download_url":"https://codeload.github.com/jacobkosmart/ledBorad-ios-practice/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239558911,"owners_count":19658927,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["swift","uinavigationcontroller","viewcontro"],"created_at":"2024-11-07T11:17:11.895Z","updated_at":"2025-11-08T14:30:32.272Z","avatar_url":"https://github.com/jacobkosmart.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LED Board\n\n![Kapture 2021-11-25 at 18 15 10](https://user-images.githubusercontent.com/28912774/143413457-cea812b2-d509-40cc-847c-dcabcc3eb4ac.gif)\n\n## Check Point !\n\n### StackView\n\n- 여러개의 view 를 set 으로 만들어 주는 역활을 함\n\n- 일정한 규칙에 따라서 stack view 안에 움직이는것임\n\n### 이미지 넣기\n\n- 프로젝트 내에 Assets 폴더 내에 Image Set 을 추가하여 1x, 2x, 3x 의 크기의 맞게 해당 이미지를 넣어 줍니다 (24px, 48px, 72px 사이즈의 이미지를 추가함) -\u003e 다양한 크기의 image 를 추가하는것은 iphone, ipad 등 다양한 해상도에서 이미지가 깨지지 않게 하기 위함임\n\n## 주요 코드\n\n![image](https://user-images.githubusercontent.com/28912774/143413082-70bc8417-e3d0-4938-8c98-8f66353d65f8.png)\n\n```swift\n// viewController.swift\n\nclass ViewController: UIViewController, LEDBoardSettingDelegate {\n\t@IBOutlet weak var contentsLabel: UILabel!\n\n\toverride func viewDidLoad() {\n\t\tsuper.viewDidLoad()\n\t\tself.contentsLabel.textColor = .yellow\n\t}\n\n\t// delegate 된 data 받기(segueway 를 통해서)\n\toverride func prepare(for segue: UIStoryboardSegue, sender: Any?) {\n\t\tif let settingViewController = segue.destination as? SettingViewController {\n\t\t\tsettingViewController.delegate = self\n\n\t\t\t// setting 페이지에 다시 값 넘겨 주기\n\t\t\tsettingViewController.ledText = self.contentsLabel.text\n\t\t\tsettingViewController.textColor = self.contentsLabel.textColor\n\t\t\tsettingViewController.backgroundColor = self.view.backgroundColor ?? .black // optional 값이면 .black 으로 설정\n\t\t}\n\t}\n\n\t// setting 에서 받은 data 로 view 에 초기화 하기\n\tfunc changedSetting(text: String?, textColor: UIColor, backgroundColor: UIColor) {\n\t\tif let text = text {\n\t\t\tself.contentsLabel.text = text\n\t\t}\n\t\tself.contentsLabel.textColor = textColor\n\t\tself.view.backgroundColor = backgroundColor\n\t}\n}\n```\n\n```swift\n// settingViewController.swift\n\n// delegate pattern : 이전화면에서 설정된 값들을 앞 페이지로 전달하기\nprotocol LEDBoardSettingDelegate: AnyObject {\n\tfunc changedSetting(text: String?, textColor: UIColor, backgroundColor: UIColor)\n}\n\nclass SettingViewController: UIViewController {\n\n\t// TextFiled 연결\n\t@IBOutlet weak var textField: UITextField!\n\n\t// Text Colors 연결\n\t@IBOutlet weak var yellowBtn: UIButton!\n\t@IBOutlet weak var purpleBtn: UIButton!\n\t@IBOutlet weak var greenBtn: UIButton!\n\n\t// Background Colors 연결\n\t@IBOutlet weak var blackBtn: UIButton!\n\t@IBOutlet weak var blueBtn: UIButton!\n\t@IBOutlet weak var orangeBtn: UIButton!\n\n\t// delegate 변수\n\tweak var delegate: LEDBoardSettingDelegate?\n\n\t// 저장되고 앞에서 다시 설정할때 앞페이지에서 값을 받을 수 있게 변수 설정\n\tvar ledText: String?\n\n\t// 초기화 값 설정\n\tvar textColor: UIColor = .yellow\n\tvar backgroundColor: UIColor = .black\n\n\toverride func viewDidLoad() {\n\t\tsuper.viewDidLoad()\n\t\t// led 화면에서 받은값이 페이지 로드 될때 불러오기\n\t\tself.configureView()\n\t}\n\n\t// 앞에서 전달 받은 데이터들로 view 를 초기화 하기\n\tprivate func configureView() {\n\t\tif let ledText = self.ledText {\n\t\t\tself.textField.text = ledText\n\t\t}\n\t\tself.changeTextColor(color: self.textColor)\n\t\tself.changeBackgroundColor(color: self.backgroundColor)\n\t}\n\n\t@IBAction func tabTextColorBtn(_ sender: UIButton) {\n\t\tif sender == self.yellowBtn {\n\t\t\tself.changeTextColor(color: .yellow)\n\t\t\tself.textColor = .yellow\n\t\t} else if sender == self.purpleBtn {\n\t\t\tself.changeTextColor(color: .purple)\n\t\t\tself.textColor = .purple\n\t\t} else {\n\t\t\tself.changeTextColor(color: .green)\n\t\t\tself.textColor = .green\n\t\t}\n\t}\n\n\t@IBAction func tabBackgroundColorBtn(_ sender: UIButton) {\n\t\tif sender == self.blackBtn {\n\t\t\tself.changeBackgroundColor(color: .black)\n\t\t\tself.backgroundColor = .black\n\t\t} else if sender == self.blueBtn {\n\t\t\tself.changeBackgroundColor(color: .blue)\n\t\t\tself.backgroundColor = .blue\n\t\t} else {\n\t\t\tself.changeBackgroundColor(color: .orange)\n\t\t\tself.backgroundColor = .orange\n\t\t}\n\t}\n\n\t// 설정 된 delegate 값을 Save 버튼 누르면 보내는 logic\n\t@IBAction func tabSaveButton(_ sender: UIButton) {\n\t\tself.delegate?.changedSetting(\n\t\t\ttext: self.textField.text,\n\t\t\ttextColor: self.textColor,\n\t\t\tbackgroundColor: self.backgroundColor\n\t\t)\n\t\t// 이전화면으로 이동\n\t\tself.navigationController?.popViewController(animated: true)\n\t}\n\n\t// 선택된 color는 alpha 값을 1로 하고 선택되지 않은 color 는 alpha 를 0.2로 설정\n\tprivate func changeTextColor(color: UIColor) {\n\t\tself.yellowBtn.alpha = color == UIColor.yellow ? 1 : 0.2\n\t\tself.purpleBtn.alpha = color == UIColor.purple ? 1 : 0.2\n\t\tself.greenBtn.alpha = color == UIColor.green ? 1 : 0.2\n\t}\n\tprivate func changeBackgroundColor(color: UIColor) {\n\t\tself.blackBtn.alpha = color == UIColor.black ? 1 : 0.2\n\t\tself.blueBtn.alpha = color == UIColor.blue ? 1 : 0.2\n\t\tself.orangeBtn.alpha = color == UIColor.orange ? 1 : 0.2\n\t}\n}\n\n```\n\n## reference\n\nJacob's DevLog - [https://jacobko.info/ios/ios-03/](https://jacobko.info/ios/ios-03/)\n\nOn the swift - [https://ontheswift.tistory.com/8](https://ontheswift.tistory.com/8)\n\n농부와 코드 - [https://tono18.tistory.com/11](https://tono18.tistory.com/11)\n\nfastcampus - [https://fastcampus.co.kr/dev_online_iosappfinal](https://fastcampus.co.kr/dev_online_iosappfinal)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacobkosmart%2Fledborad-ios-practice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacobkosmart%2Fledborad-ios-practice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacobkosmart%2Fledborad-ios-practice/lists"}