Skip to content

Commit

Permalink
Merge pull request #2 from oversizedev/develop
Browse files Browse the repository at this point in the history
Clean code
  • Loading branch information
aromanov91 authored Apr 11, 2023
2 parents b8be1e7 + 7caace7 commit 051ae9a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 39 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// Copyright © 2023 Aleksandr Romanov
// File.swift, created on 02.04.2023
// Calendar+Extension.swift, created on 02.04.2023
//


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public extension Decimal {
/// - scale: How many decimal places.
/// - roundingMode: How should number be rounded. Defaults to `.plain`.
/// - Returns: The new rounded number.

func rounded(_ scale: Int, roundingMode: RoundingMode = .plain) -> Decimal {
var value = self
var result: Decimal = 0
Expand Down
6 changes: 0 additions & 6 deletions Sources/OversizeCore/Extensions/Swift/String+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,6 @@ extension String {
func width(font: UIFont) -> CGFloat {
size(font: font).width
}

// func height(width: CGFloat, withFont font: UIFont) -> CGFloat {
// let constraintRect: CGSize = .init(width: width, height: CGFloat.greatestFiniteMagnitude)
// let boundingBox = boundingRect(with: constraintRect, options: NSStringDrawingOptions.usesLineFragmentOrigin, attributes: [NSAttributedString.Key.font: font], context: nil)
// return ceil(boundingBox.height) + 1
// }
}

public extension NSAttributedString {
Expand Down
11 changes: 6 additions & 5 deletions Sources/OversizeCore/Global/Log.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ import Foundation

public func log(_ objects: Any...) {
#if DEBUG
log(objects.map { "\($0)" }.joined(separator: " "))
log(objects.map { "\($0)" }.joined(separator: ", "))
#endif
}

public func log(_ object: Any?) {
#if DEBUG
if let object {
log("⚪️ \(object)")
log(object)
} else {
log("⚪️ \(String(describing: object))")
log(String(describing: object))
}
#endif
}
Expand All @@ -27,9 +27,10 @@ public func log(_ object: Any?) {
#endif
}

public func logWithTime(_: String, terminator: String? = nil) {
public func logWithTime(_ text: String, terminator: String? = nil) {
#if DEBUG
let textWithTime: String = Date().formatted(.dateTime)
let textTime: String = Date().formatted(.dateTime)
let textWithTime = "\(textTime): \(text)"
terminator == nil ? print(textWithTime) : print(textWithTime, terminator: terminator!)
#endif
}
26 changes: 0 additions & 26 deletions Sources/OversizeCore/ViewModifier/OnFirstAppear.swift

This file was deleted.

0 comments on commit 051ae9a

Please sign in to comment.