Skip to content

Commit

Permalink
Merge pull request #146 from TeamBeMe/feature/#107
Browse files Browse the repository at this point in the history
Feature/#107
  • Loading branch information
samsung-ga authored Jan 15, 2021
2 parents ff4861e + 4deed2a commit cf5f978
Show file tree
Hide file tree
Showing 6 changed files with 266 additions and 46 deletions.
4 changes: 4 additions & 0 deletions BeMe/BeMe.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
D4C5874425AF86900089BD18 /* SettingTVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4C5874325AF86900089BD18 /* SettingTVC.swift */; };
D4C5875F25B0165A0089BD18 /* ExploreWrite.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4C5875E25B0165A0089BD18 /* ExploreWrite.swift */; };
D4C5876225B016DE0089BD18 /* ExploreWriteService.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4C5876125B016DE0089BD18 /* ExploreWriteService.swift */; };
D4D94CEF25B1BDF300202506 /* CALayer+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4D94CEE25B1BDF300202506 /* CALayer+Extensions.swift */; };
D4E07CB9259F22C10075E616 /* Explore.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D4E07CB2259F22C10075E616 /* Explore.storyboard */; };
D4E07CBA259F22C10075E616 /* MoreTVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4E07CB4259F22C10075E616 /* MoreTVC.swift */; };
D4E07CBC259F22C10075E616 /* DiffThoughtCVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4E07CB6259F22C10075E616 /* DiffThoughtCVC.swift */; };
Expand Down Expand Up @@ -306,6 +307,7 @@
D4C5874325AF86900089BD18 /* SettingTVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingTVC.swift; sourceTree = "<group>"; };
D4C5875E25B0165A0089BD18 /* ExploreWrite.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExploreWrite.swift; sourceTree = "<group>"; };
D4C5876125B016DE0089BD18 /* ExploreWriteService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExploreWriteService.swift; sourceTree = "<group>"; };
D4D94CEE25B1BDF300202506 /* CALayer+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CALayer+Extensions.swift"; sourceTree = "<group>"; };
D4E07CB2259F22C10075E616 /* Explore.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Explore.storyboard; sourceTree = "<group>"; };
D4E07CB4259F22C10075E616 /* MoreTVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MoreTVC.swift; sourceTree = "<group>"; };
D4E07CB6259F22C10075E616 /* DiffThoughtCVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DiffThoughtCVC.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1250,6 +1252,7 @@
EC5C1FF525A433EE008EE335 /* String+Extensions.swift */,
EC75A25D25A8B28000F4E160 /* UIImageView+Extensions.swift */,
EC7C88E425AF6989000C71D9 /* UILabel+extensions.swift */,
D4D94CEE25B1BDF300202506 /* CALayer+Extensions.swift */,
);
path = Extensions;
sourceTree = "<group>";
Expand Down Expand Up @@ -1748,6 +1751,7 @@
ECC6310D25A9B27E009E4FD4 /* AnswerDataForFollowing.swift in Sources */,
EC89E309259C1CC700DBAFE5 /* FollowSearchVC.swift in Sources */,
A53C28B625B00EB50054DA7E /* CustomActionSheetFilterVC.swift in Sources */,
D4D94CEF25B1BDF300202506 /* CALayer+Extensions.swift in Sources */,
EC89E328259C378300DBAFE5 /* FollowHeaderCVC.swift in Sources */,
EC813F262599A15100BBCE25 /* SceneDelegate.swift in Sources */,
EC89E30F259C274200DBAFE5 /* FollowerSearchVC.swift in Sources */,
Expand Down
27 changes: 0 additions & 27 deletions BeMe/BeMe/CustomActionSheet/VC/CustomActionSheetVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -99,30 +99,3 @@ class CustomActionSheetVC: UIViewController {





extension CALayer {
func addBorder(_ arr_edge: [UIRectEdge], color: UIColor, width: CGFloat) {
for edge in arr_edge {
let border = CALayer()
switch edge {
case UIRectEdge.top:
border.frame = CGRect.init(x: 0, y: 0, width: frame.width, height: width)
break
case UIRectEdge.bottom:
border.frame = CGRect.init(x: 0, y: frame.height - width, width: frame.width, height: width)
break
case UIRectEdge.left:
border.frame = CGRect.init(x: 0, y: 0, width: width, height: frame.height)
break
case UIRectEdge.right:
border.frame = CGRect.init(x: frame.width - width, y: 0, width: width, height: frame.height)
break
default:
break
}
border.backgroundColor = color.cgColor;
self.addSublayer(border)
}
}
}
35 changes: 35 additions & 0 deletions BeMe/BeMe/Extensions/CALayer+Extensions.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//
// CALayer+Extensions.swift
// BeMe
//
// Created by ์ด์žฌ์šฉ on 2021/01/15.
//

import UIKit


extension CALayer {
func addBorder(_ arr_edge: [UIRectEdge], color: UIColor, width: CGFloat) {
for edge in arr_edge {
let border = CALayer()
switch edge {
case UIRectEdge.top:
border.frame = CGRect.init(x: 0, y: 0, width: frame.width, height: width)
break
case UIRectEdge.bottom:
border.frame = CGRect.init(x: 0, y: frame.height - width, width: frame.width, height: width)
break
case UIRectEdge.left:
border.frame = CGRect.init(x: 0, y: 0, width: width, height: frame.height)
break
case UIRectEdge.right:
border.frame = CGRect.init(x: frame.width - width, y: 0, width: width, height: frame.height)
break
default:
break
}
border.backgroundColor = color.cgColor;
self.addSublayer(border)
}
}
}
3 changes: 1 addition & 2 deletions BeMe/BeMe/Extensions/UIViewController+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import UIKit


extension UIViewController {


// ํ† ์ŠคํŠธ ๋ฉ”์„ธ์ง€
func showToast(text: String, completion: @escaping ()->()) {
let toast = ToastView(frame: CGRect(x: 0, y: 0, width: 343, height: 84))
toast.setLabel(text: text)
Expand Down
2 changes: 1 addition & 1 deletion BeMe/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: e92005c7e2a5150ca84ffcc2935827fc104eb626

COCOAPODS: 1.10.0
COCOAPODS: 1.9.1
241 changes: 225 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,242 @@
# BeMeiOS

<img src="https://user-images.githubusercontent.com/56102421/104687678-04ce8200-5743-11eb-8a17-ef279aa8f47f.png" width="40%" />

### BeMe
> ๋‚˜์— ๋Œ€ํ•ด ์•Œ์•„๊ฐ€๋Š” ์งˆ๋ฌธ ๋‹ค์ด์–ด๋ฆฌ , BeMe.
## ๐Ÿ“Œ ํ”„๋กœ์ ํŠธ ์†Œ๊ฐœ

- SOPT 27th ์žฅ๊ธฐ ํ•ด์ปคํ†ค APPJAM
- ๊ธฐ๊ฐ„: 2020.12.26 ~ 2021.1.16

> ๋งค์ผ ์งˆ๋ฌธ์— ๋‹ต์„ ํ•˜๋ฉฐ ๋‚˜๋ฅผ ์•Œ์•„๊ฐ€๋Š” ์งˆ๋ฌธ๋‹ค์ด์–ด๋ฆฌ BeMe ์ž…๋‹ˆ๋‹ค.
>
> 24์‹œ๊ฐ„๋งˆ๋‹ค ์ƒˆ๋กœ์šด ์งˆ๋ฌธ ์ œ๊ณต, ์ƒˆ๋กœ์šด ์งˆ๋ฌธ ๋ฐ›๊ธฐ๋ฅผ ํ†ตํ•ด ์งˆ๋ฌธ์— ๋‹ต์„ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
> ์ž์‹ ์˜ ๊ธ€์„ ์ „์ฒด ๊ณต๊ฐœํ•˜์—ฌ ์‚ฌ๋žŒ๋“ค๊ณผ ์†Œํ†ตํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
> ๋งˆ์ง€๋ง‰์œผ๋กœ ๋งˆ์ดํŽ˜์ด์ง€์—์„œ ๋‚ด๊ฐ€ ์ง€๊ธˆ๊นŒ์ง€ ๋‹ตํ•œ ์งˆ๋ฌธ์„ ์‰ฝ๊ฒŒ ๋ณผ ์ˆ˜ ์žˆ์œผ๋ฉฐ, ๋‚ด ์ƒ๊ฐ์ด ์–ด๋–ป๊ฒŒ ๋ณ€ํ–ˆ๋Š”์ง€ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
### Notion Link

- [Notion](https://www.notion.so/iOS-688f11e27af9495faac336794ccac4fa)

## ๐Ÿ“Œ ๊ฐœ๋ฐœ ํ™˜๊ฒฝ ๋ฐ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ

### ๋ชฉ์ฐจ
### ๊ฐœ๋ฐœ ํ™˜๊ฒฝ

[![Swift 4](https://img.shields.io/badge/BeMe-iOS-black.svg?style=flat)](https://swift.org) ![Xcode](https://img.shields.io/badge/Xcode-12.3-blue) ![swift](https://img.shields.io/badge/swift-5.0-green) ![iOS](https://img.shields.io/badge/iOS-13.5-yellow) ![COCOAPODS](https://img.shields.io/badge/COCOAPODS-1.9.1-blue)

### ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ

| ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ(Library) | ๋ชฉ์ (Purpose) | ๋ฒ„์ „(VersionA |
| ------------------- | ------------------------ | ------------------------------------------------------------ |
| Alamofire | ์„œ๋ฒ„ ํ†ต์‹  | ![Alamofire](https://img.shields.io/badge/Alamofire-5.4.1-orange) |
| Kingfisher | ์ด๋ฏธ์ง€ ์ฒ˜๋ฆฌ | ![Kingfisher](https://img.shields.io/badge/Kingfisher-6.0.1-yellow) |
| SnapKit | ์˜คํ† ๋ ˆ์ด์•„์›ƒ | ![Kingfisher](https://img.shields.io/badge/SnapKit-5.0.1-black) |
| Then | ์งง์€ ์ฝ”๋“œ ์ฒ˜๋ฆฌ | ![Kingfisher](https://img.shields.io/badge/Then-2.7.0-white) |
| lottie-ios | ๋กœํ‹ฐ ์• ๋‹ˆ๋ฉ”์ด์…˜ ์ฒ˜๋ฆฌ | ![lottie-ios](https://img.shields.io/badge/lottieios-3.1.9-green) |
| Firebase/Messaging | Firebase Cloud Messaging | ![Kingfisher](https://img.shields.io/badge/Firebase/Messaging-yellow) |
| SwiftLint | ๊น”๋”ํ•œ ์ฝ”๋”ฉ ์ปจ๋ฒค์…˜ | ![Kingfisher](https://img.shields.io/badge/SwiftLint-red) |

### AutoLayout ์ ์šฉ ์—ฌ๋ถ€

**1. iPhone 12 Pro ์ ์šฉ**

**2. iPhone 12 mini ์ ์šฉ**

**3. iPhone SE2 ์ ์šฉ**



## ๐Ÿ“Œ ์„œ๋น„์Šค workflow

<img src="https://user-images.githubusercontent.com/56102421/104720646-69ec9c80-5770-11eb-9504-a90ff517bb9c.png" width="50%" height="50%"/>



## ๐Ÿ“Œ ํ˜‘์—… ๋ฐฉ์‹

- [Coding-Convention](https://www.notion.so/Naming-Rule-d1ad0ee6a8754d3d98d48a605139b4b2)

- [Git-Management](/GitManage.md)

- [Kanban Board](https://github.com/TeamBeMe/BeMeiOS/projects/1)
- [Foldering](https://github.com/TeamBeMe/BeMeiOS/wiki/Foldering)

### ํ˜„์žฌ ์ง„ํ–‰์‚ฌํ•ญ

#### ์œค์žฌ
- ํ™ˆ,ํŒ”๋กœ์ž‰,์•„์ด๋”” ๊ฒ€์ƒ‰ ํ›„ ํŒ”๋กœ์ž‰, ํšŒ์›๊ฐ€์ž…, ๋กœ๊ทธ์ธ ๋ทฐ ์™„์„ฑ
- ํšŒ์›๊ฐ€์ž…, ๋กœ๊ทธ์ธ ์„œ๋ฒ„์™„๋ฃŒ

#### ์žฌ์šฉ
- ํƒ์ƒ‰ ๋ทฐ ๊ตฌํ˜„ ์™„๋ฃŒ, ๋Œ“๊ธ€ ๋ทฐ ๊ตฌํ˜„์ค‘
## ๐Ÿ“Œ ๊ธฐ๋Šฅ๋ณ„ ๊ฐœ๋ฐœ ์—ฌ๋ถ€

| Category | ๊ธฐ๋Šฅ | ๊ฐœ๋ฐœ | ๋‹ด๋‹น์ž |
| ---------------- | -------------------------------------------------- | ---- | -------- |
| ์Šคํ”Œ๋ž˜์‹œ | | ๐Ÿ…พ๏ธ | [์œค์žฌ]() |
| Auth | ๋กœ๊ทธ์ธ | โญ•๏ธ | [์œค์žฌ]() |
| | ํšŒ์›๊ฐ€์ž… | โญ•๏ธ | [์œค์žฌ]() |
| ๋ฉ”์ธ ํ™”๋ฉด | ์˜ค๋Š˜์˜ ์งˆ๋ฌธ ์ž‘์„ฑํ•˜๊ธฐ ๋ฐ ์ˆ˜์ •ํ•˜๊ธฐ | โญ•๏ธ | [์œค์žฌ]() |
| | ๊ณผ๊ฑฐ์˜ ์งˆ๋ฌธ ์ˆ˜์ •ํ•˜๊ธฐ | โญ•๏ธ | [์œค์žฌ]() |
| | ๊ณต๊ฐœ๋ฒ”์œ„ ์„ค์ •ํ•˜๊ธฐ | โญ•๏ธ | [์œค์žฌ]() |
| | ๋Œ“๊ธ€ ๊ธฐ๋Šฅ ํ•ด์ œํ•˜๊ธฐ | โญ•๏ธ | [์œค์žฌ]() |
| | ์ƒˆ๋กœ์šด ์งˆ๋ฌธ ๋ฐ›๊ธฐ | โญ•๏ธ | [์œค์žฌ]() |
| | ์งˆ๋ฌธ์— ๋Œ€ํ•œ ์• ๋‹ˆ๋ฉ”์ด์…˜ ๊ตฌํ˜„ | โญ•๏ธ | [์œค์žฌ]() |
| ํƒ์ƒ‰ ํ™”๋ฉด | ๋‚˜์™€ ๋‹ค๋ฅธ ์ƒ๊ฐ๋“ค ๋‹ต๋ณ€ ๊ฐ€์ ธ์˜ค๊ธฐ | โญ•๏ธ | [์žฌ์šฉ]() |
| | ๋‹ค๋ฅธ ๊ธ€ ๋‘˜๋Ÿฌ๋ณด๊ธฐ ๋‹ต๋ณ€ ๊ฐ€์ ธ์˜ค๊ธฐ | โญ•๏ธ | [์žฌ์šฉ]() |
| | ์นดํ…Œ๊ณ ๋ฆฌ ํ•„ํ„ฐ ๊ธฐ๋Šฅ (์ตœ์‹  / ํฅ๋ฏธ) | โญ•๏ธ | [์žฌ์šฉ]() |
| | ์นดํ…Œ๊ณ ๋ฆฌ ํ•„ํ„ฐ ๊ธฐ๋Šฅ (์งˆ๋ฌธ ์ข…๋ฅ˜) | โญ•๏ธ | [์žฌ์šฉ]() |
| | ๋ฆฌ์ŠคํŠธ ์• ๋‹ˆ๋ฉ”์ด์…˜ ๊ตฌํ˜„ | โญ•๏ธ | [์žฌ์šฉ]() |
| | ๋‹ต๋ณ€ ์Šคํฌ๋žฉํ•˜๊ธฐ | โญ•๏ธ | [์žฌ์šฉ]() |
| | ์˜ค๋Š˜ ์งˆ๋ฌธ ๋‹ต๋ณ€ ํ•˜๋Ÿฌ๊ฐ€๊ธฐ | โญ•๏ธ | [์žฌ์šฉ]() |
| ํŒ”๋กœ์šฐ ํ™”๋ฉด | ํŒ”๋กœ์ž‰ ํŒ”๋กœ์›Œ ํ•„ํ„ฐ ๊ธฐ๋Šฅ | โญ•๏ธ | [์œค์žฌ]() |
| | ํŒ”๋กœ์ž‰์— ๋Œ€ํ•œ ๋‹ต๋ณ€ ๊ฐ€์ ธ์˜ค๊ธฐ | โญ•๏ธ | [์œค์žฌ]() |
| | ๋‹ต๋ณ€ ์•ˆ ํ•œ ๋‹ต๋ณ€ ํ•˜๋Ÿฌ๊ฐ€๊ธฐ | โญ•๏ธ | [์œค์žฌ]() |
| | ํŒ”๋กœ์ž‰ ํŒ”๋กœ์›Œ ๊ฒ€์ƒ‰ํ•˜๊ธฐ | โญ•๏ธ | [์œค์žฌ]() |
| | ํŒ”๋กœ์ž‰ ํŒ”๋กœ์›Œ ํ•ด์ œ | โญ•๏ธ | [์œค์žฌ]() |
| ๋Œ“๊ธ€ ํ™”๋ฉด | ํŠน์ • ๋‹ต๋ณ€ ๊ฐ€์ ธ์˜ค๊ธฐ | โญ•๏ธ | [์žฌ์šฉ]() |
| | ๋Œ“๊ธ€, ๋Œ€๋Œ“๊ธ€ ์ž‘์„ฑ, ์ˆ˜์ •, ์‚ญ์ œํ•˜๊ธฐ | โญ•๏ธ | [์žฌ์šฉ]() |
| | ๋‹ต๋ณ€ ๋ฐ ๋Œ“๊ธ€ ์‹ ๊ณ ํ•˜๊ธฐ | โญ•๏ธ | [์žฌ์šฉ]() |
| | ๋Œ“๊ธ€, ๋Œ€๋Œ“๊ธ€ ๊ณต๊ฐœ๋ฒ”์œ„ ์„ค์ •ํ•˜๊ธฐ | โญ•๏ธ | [์žฌ์šฉ]() |
| ๋งˆ์ดํŽ˜์ด์ง€ ํ™”๋ฉด | ๋‚ด ํ”„๋กœํ•„์— ๋Œ€ํ•œ ์ •๋ณด ๊ฐ€์ ธ์˜ค๊ธฐ | โญ•๏ธ | [์„ธ๋ž€]() |
| | ์งˆ๋ฌธ์— ๋Œ€ํ•œ ๋‹ต๋ณ€ ๊ฐ€์ ธ์˜ค๊ธฐ | โญ•๏ธ | [์„ธ๋ž€]() |
| | ์Šคํฌ๋žฉํ•œ ๋‹ต๋ณ€ ๊ฐ€์ ธ์˜ค๊ธฐ | โญ•๏ธ | [์„ธ๋ž€]() |
| | ๋‹ตํ•œ ์งˆ๋ฌธ์— ๋Œ€ํ•œ ๊ธ€ ๊ณต๊ฐœ๋ฒ”์œ„ ์„ค์ •ํ•˜๊ธฐ | โญ•๏ธ | [์„ธ๋ž€]() |
| | ํ”„๋กœํ•„ ํŽธ์ง‘ํ•˜๊ธฐ | โญ•๏ธ | [์„ธ๋ž€]() |
| | ๋‚ด ๋‹ต๋ณ€๋“ค ํ•„ํ„ฐ(๊ณต๊ฐœ๋ฒ”์œ„, ์นดํ…Œ๊ณ ๋ฆฌ)๋ฅผ ํ†ตํ•ด ๊ฒ€์ƒ‰ํ•˜๊ธฐ | โญ•๏ธ | [์„ธ๋ž€]() |
| ํƒ€์ธ ํ”„๋กœํ•„ ํ™”๋ฉด | ํƒ€์ธ ํ”„๋กœํ•„์— ๋Œ€ํ•œ ์ •๋ณด ๊ฐ€์ ธ์˜ค๊ธฐ | โญ•๏ธ | [์„ธ๋ž€]() |
| | ํƒ€์ธ์ด ๋‹ตํ•œ ๋‹ต๋ณ€ ๊ฐ€์ ธ์˜ค๊ธฐ | โญ•๏ธ | [์„ธ๋ž€]() |
| | ํŒ”๋กœ์šฐํ•˜๊ธฐ ๋ฐ ์ทจ์†Œํ•˜๊ธฐ | โญ•๏ธ | [์„ธ๋ž€]() |
| | ํƒ€์ธ์˜ ๋‹ต๋ณ€ ์Šคํฌ๋žฉํ•˜๊ธฐ | โญ•๏ธ | [์„ธ๋ž€]() |
| ๊ธ€์“ฐ๊ธฐ | | | |

๐Ÿ‘‰ API ๋‹จ์œ„๋กœ ์ˆ˜์ • ์˜ˆ์ •



## ๐Ÿ“Œ ํ•ต์‹ฌ ๊ธฐ๋Šฅ ๊ตฌํ˜„ ๋ฐฉ๋ฒ•

- ๊ธ€์“ฐ๊ธฐ

```swift

```

- ํƒ€์ธ์ด ์“ด ๊ธ€ ๋ณด๊ธฐ

```swift

```



## ๐Ÿ“Œ Extension์„ ํ†ตํ•œ ๋ฉ”์†Œ๋“œ ์„ค๋ช…

<img src="https://user-images.githubusercontent.com/56102421/104726128-6b20c800-5776-11eb-9f2b-a9191bcce21d.png" width="30%"/>

- UIView Extension

```swift
extension UIView {
// Set Rounded View
func makeRounded(cornerRadius : CGFloat?){

// UIView ์˜ ๋ชจ์„œ๋ฆฌ๊ฐ€ ๋‘ฅ๊ทผ ์ •๋„๋ฅผ ์„ค์ •
if let cornerRadius_ = cornerRadius {
self.layer.cornerRadius = cornerRadius_
} else {
// cornerRadius ๊ฐ€ nil ์ผ ๊ฒฝ์šฐ์˜ default
self.layer.cornerRadius = self.layer.frame.height / 2
}

self.layer.masksToBounds = true
}

// Set UIView's Shadow
func dropShadow(color: UIColor, offSet: CGSize, opacity: Float, radius: CGFloat) {

// ๊ทธ๋ฆผ์ž ์ƒ‰์ƒ ์„ค์ •
layer.shadowColor = color.cgColor
// ๊ทธ๋ฆผ์ž ํฌ๊ธฐ ์„ค์ •
layer.shadowOffset = offSet
// ๊ทธ๋ฆผ์ž ํˆฌ๋ช…๋„ ์„ค์ •
layer.shadowOpacity = opacity
// ๊ทธ๋ฆผ์ž์˜ blur ์„ค์ •
layer.shadowRadius = radius
// ๊ตฌ๊ธ€๋ง ํ•ด๋ณด์„ธ์š”!
layer.masksToBounds = false

}

// Set UIView's Border
func setBorder(borderColor : UIColor?, borderWidth : CGFloat?) {

// UIView ์˜ ํ…Œ๋‘๋ฆฌ ์ƒ‰์ƒ ์„ค์ •
if let borderColor_ = borderColor {
self.layer.borderColor = borderColor_.cgColor
} else {
// borderColor ๋ณ€์ˆ˜๊ฐ€ nil ์ผ ๊ฒฝ์šฐ์˜ default
self.layer.borderColor = UIColor(red: 205/255, green: 209/255, blue: 208/255, alpha: 1.0).cgColor
}

// UIView ์˜ ํ…Œ๋‘๋ฆฌ ๋‘๊ป˜ ์„ค์ •
if let borderWidth_ = borderWidth {
self.layer.borderWidth = borderWidth_
} else {
// borderWidth ๋ณ€์ˆ˜๊ฐ€ nil ์ผ ๊ฒฝ์šฐ์˜ default
self.layer.borderWidth = 1.0
}
}
}
```

- UIViewController

```swift
extension UIViewController {
// ํ† ์ŠคํŠธ ๋ฉ”์„ธ์ง€
func showToast(text: String, completion: @escaping ()->()) {
let toast = ToastView(frame: CGRect(x: 0, y: 0, width: 343, height: 84))
toast.setLabel(text: text)
toast.alpha = 0
self.view.addSubview(toast)
toast.snp.makeConstraints {
$0.leading.equalToSuperview().offset(16)
$0.trailing.equalToSuperview().offset(-16)
$0.bottom.equalToSuperview().offset(-101)
}
UIView.animate(withDuration: 0.3, animations: {
toast.alpha = 1

},completion: { finish in
UIView.animate(withDuration: 0.3, delay: 0.7, animations: {
toast.alpha = 0

}, completion: { finish in
if finish {
toast.removeFromSuperview()
completion()
}
})
})
}
}
```

- UIImageView

```swift
// Kingfisher๋ฅผ ์ด์šฉํ•˜์—ฌ url๋กœ๋ถ€ํ„ฐ ์ด๋ฏธ์ง€๋ฅผ ๊ฐ€์ ธ์˜ค๋Š” extension
extension UIImageView {

public func imageFromUrl(_ urlString: String?) {
if let url = urlString {
self.kf.setImage(with: URL(string: url), options: [.transition(ImageTransition.fade(0.5))])
}
}
}
```





## ๐Ÿ“Œ ํŒ€์› ์†Œ๊ฐœ

| **์œค์žฌ** | **์„ธ๋ž€** | **์žฌ์šฉ** |
| :----------------------------------------------------------: | :------------------------: | :----------------------------------------------------------: |
| <img src="https://user-images.githubusercontent.com/56102421/104729189-6f031900-577b-11eb-84f6-fa082870caf6.jpeg" width="60%"/> | <img src="" width="50% "/> | <img src="https://user-images.githubusercontent.com/56102421/104729197-70ccdc80-577b-11eb-98fc-aa5902113cd6.jpeg" width="60%"/> |
| ๋„ค์ด์Šค | | |


### ๋ชฉ์ฐจ

#### ์„ธ๋ž€
- ๊ธ€์“ฐ๊ธฐ ๋ทฐ ๊ตฌํ˜„ ์™„๋ฃŒ
- ๋งˆ์ดํŽ˜์ด์ง€ ๋ทฐ ๊ตฌํ˜„์ค‘

0 comments on commit cf5f978

Please sign in to comment.