Skip to content

Commit

Permalink
Merge pull request #392 from DeveloperAcademy-POSTECH/release/v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MMMIIIN committed Jun 4, 2023
2 parents 2b2008e + 1755769 commit d672efa
Show file tree
Hide file tree
Showing 116 changed files with 3,918 additions and 1,380 deletions.
8 changes: 4 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
<!-- 해당 PR을 작성하게 된 이유를 적어주세요. -->


## 📱 Screenshot
<!-- 스크린샷이나 동영상을 첨부해주세요. -->


## 👩‍💻 Contents
<!-- 작업 내용을 적어주세요 -->

Expand All @@ -10,10 +14,6 @@
<!-- 테스트 방법을 적어주세요 -->


## 📱 Screenshot
<!-- 스크린샷이나 동영상을 첨부해주세요. -->


## 📝 Review Note
<!-- PR과정에서 든 생각이나 개선할 내용이 있다면 적어주세요. -->

Expand Down
275 changes: 216 additions & 59 deletions Maddori.Apple/Maddori.Apple.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//
// NotificationName.swift
// Maddori.Apple
//
// Created by 이성호 on 2023/03/31.
//

import Foundation

extension Notification.Name {
static let changeTeamNotification = Notification.Name("changeTeamNotification")
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,27 @@ extension String {

return dateToStringFormatter.string(from: date)
}

func formatStringToDate() -> Date {
let stringToDateFormatter = DateFormatter()
stringToDateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
stringToDateFormatter.locale = Locale(identifier: "ko_KR")
return stringToDateFormatter.date(from: self) ?? Date()
}

func hasSpecialCharacters() -> Bool {
if let regex = try? NSRegularExpression(pattern: "[0-9a-zA-Zㄱ-ㅎㅏ-ㅣ가-힣\\s]", options: .caseInsensitive) {
let numOfString = regex.numberOfMatches(in: self, options: [], range: NSMakeRange(0, self.count))
if numOfString == self.count {
return false
} else {
return true
}
}
return false
}

func utf8Encode() -> Data? {
return data(using: .utf8)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,14 @@ extension UIButton {

self.setBackgroundImage(backgroundImage, for: state)
}

func setUnderline() {
guard let title = title(for: .normal) else { return }
let attributedString = NSMutableAttributedString(string: title)
attributedString.addAttribute(.underlineStyle,
value: NSUnderlineStyle.single.rawValue,
range: NSRange(location: 0, length: title.count)
)
setAttributedTitle(attributedString, for: .normal)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ extension UIFont {
}

static var title: UIFont {
return font(.bold, ofSize: 28)
return font(.bold, ofSize: 26)
}

static var title2: UIFont {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// UIImage+Extension.swift
// Maddori.Apple
//
// Created by 김유나 on 2023/03/29.
//

import UIKit

extension UIImage {
func fixOrientation() -> UIImage {
if (self.imageOrientation == .up) {
return self
}
UIGraphicsBeginImageContextWithOptions(self.size, false, self.scale)

let rect = CGRect(x: 0, y: 0, width: self.size.width, height: self.size.height)
self.draw(in: rect)

let normalizedImage = UIGraphicsGetImageFromCurrentImageContext()!
UIGraphicsEndImageContext()

return normalizedImage
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//
// UIImageView+Extension.swift
// Maddori.Apple
//
// Created by 이성민 on 2023/03/06.
//

import Foundation
import UIKit

extension UIImageView {
func load(from url: String) {

let cacheKey = NSString(string: url)
if let cachedImage = ImageCacheManager.shared.object(forKey: cacheKey) {
self.image = cachedImage
return
}

DispatchQueue.global().async { [weak self] in
if let imageUrl = URL(string: url),
let data = try? Data(contentsOf: imageUrl) {
if let image = UIImage(data: data) {
DispatchQueue.main.async {
ImageCacheManager.shared.setObject(image, forKey: cacheKey)
self?.image = image
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,21 @@ extension UILabel {
attributedText = attributeString
}

func setLineSpacingWithColorApplied(amount: CGFloat, colorTo targetString: String, with color: UIColor) {
guard let text = text else { return }
let attributedString = NSMutableAttributedString(string: text)
attributedString.addAttribute(.foregroundColor,
value: color,
range: (text as NSString).range(of: targetString))

let style = NSMutableParagraphStyle()
style.lineSpacing = amount
attributedString.addAttribute(.paragraphStyle,
value: style,
range: NSRange(location: 0, length: attributedString.length))
attributedText = attributedString
}

func setTitleFont(text: String) {
self.text = text
self.font = .title
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import UIKit
extension UIView {
func setGradient(colorTop: UIColor, colorBottom: UIColor) {
let gradient: CAGradientLayer = CAGradientLayer()
gradient.name = "gradientLayer"
gradient.colors = [colorTop.cgColor, colorBottom.cgColor]
gradient.locations = [0.0, 1,0]
gradient.startPoint = CGPoint(x: 0.0, y: 0.0)
Expand All @@ -18,6 +19,15 @@ extension UIView {
layer.addSublayer(gradient)
}

func removeGradient() {
guard let sublayers = self.layer.sublayers else { return }
for sublayer in sublayers {
if sublayer.name == "gradientLayer" {
sublayer.removeFromSuperlayer()
}
}
}

@discardableResult
func makeShadow(color: UIColor,
opacity: Float,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
import UIKit

extension UIViewController {
var statusBarHeight: CGFloat {
if #available(iOS 13.0, *) {
return UIApplication.shared.windows.first?.windowScene?.statusBarManager?.statusBarFrame.height ?? 0
} else {
return UIApplication.shared.statusBarFrame.height
}
}

func makeAlert(title: String,
message: String? = nil,
okAction: ((UIAlertAction) -> Void)? = nil,
Expand Down
6 changes: 6 additions & 0 deletions Maddori.Apple/Maddori.Apple/Global/Literal/ImageLiteral.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ enum ImageLiterals {
static var icEllipsis: UIImage { .load(systemName: "ellipsis") }
static var icBottom: UIImage { .load(systemName: "chevron.down") }
static var icPersonCircle: UIImage { .load(systemName: "person.crop.circle") }
static var icChevronDown: UIImage { .load(systemName: "chevron.down") }
static var icTeamMananage: UIImage { .load(systemName: "person.2.circle") }
static var icPlus: UIImage { .load(name: "plus") }

// MARK: - image

Expand All @@ -38,6 +41,9 @@ enum ImageLiterals {
static var imgProgress3: UIImage { .load(name: "ProgressBar3") }
static var imgProgress4: UIImage { .load(name: "ProgressBar4") }
static var imgProgress5: UIImage { .load(name: "ProgressBar5") }
static var imgDefaultProfile: UIImage { .load(name: "DefaultProfile") }
static var imgProfileNone: UIImage { .load(name: "profileNone") }
static var imgEmptyTeam: UIImage { .load(name: "team") }
}

extension UIImage {
Expand Down
3 changes: 2 additions & 1 deletion Maddori.Apple/Maddori.Apple/Global/Literal/SizeLiteral.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ enum SizeLiteral {
// MARK: - common

static let leadingTrailingPadding: CGFloat = 24
static let buttonLeadingTrailingPadding: CGFloat = 20
static let topPadding: CGFloat = 12
static let bottomPadding: CGFloat = 2
static let bottomTabBarPadding: CGFloat = 12
Expand All @@ -20,5 +21,5 @@ enum SizeLiteral {
static let labelComponentPadding: CGFloat = 10
static let componentIntervalPadding: CGFloat = 36
static let componentCornerRadius: CGFloat = 10
static let titleSubtitleSpacing: CGFloat = 5
static let titleSubtitleSpacing: CGFloat = 10
}

0 comments on commit d672efa

Please sign in to comment.