-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from RakuyoKit/feature/epoxy-row-optimization
feat: Added method to set Epoxy custom Row size
- Loading branch information
Showing
5 changed files
with
110 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// | ||
// Size.swift | ||
// RakuyoKit | ||
// | ||
// Created by Rakuyo on 2024/5/21. | ||
// Copyright © 2024 RakuyoKit. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
// MARK: - Size | ||
|
||
public struct Size { | ||
public var width: Float | ||
|
||
public var height: Float | ||
|
||
public init(width: Float, height: Float) { | ||
self.width = width | ||
self.height = height | ||
} | ||
} | ||
|
||
// MARK: - Logic | ||
|
||
extension Size { | ||
public static var zero: Self { | ||
.init(width: 0, height: 0) | ||
} | ||
|
||
public static var greatestFiniteMagnitude: Self { | ||
.init(width: .greatestFiniteMagnitude, height: .greatestFiniteMagnitude) | ||
} | ||
|
||
public var cgSize: CGSize { | ||
.init(width: CGFloat(width), height: CGFloat(height)) | ||
} | ||
} | ||
|
||
// MARK: Hashable | ||
|
||
extension Size: Hashable { } | ||
|
||
// MARK: Equatable | ||
|
||
extension Size: Equatable { } | ||
|
||
// MARK: CustomStringConvertible | ||
|
||
extension Size: CustomStringConvertible { | ||
public var description: String { | ||
"{ height:\(height), width:\(width) }" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters