This repository has been archived by the owner on Sep 30, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'deploy/1.7.0' into productive
- Loading branch information
Showing
18 changed files
with
289 additions
and
14 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
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
22 changes: 22 additions & 0 deletions
22
...cbaselines/A14E0AC41E1F986A00DFC788.xcbaseline/C3ECA4DA-1F82-4ABC-A31B-85A51942BB0D.plist
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,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>classNames</key> | ||
<dict> | ||
<key>UIImageExtensionTests</key> | ||
<dict> | ||
<key>testPerformanceToGrayscale()</key> | ||
<dict> | ||
<key>com.apple.XCTPerformanceMetric_WallClockTime</key> | ||
<dict> | ||
<key>baselineAverage</key> | ||
<real>0.49576</real> | ||
<key>baselineIntegrationDisplayName</key> | ||
<string>Local Baseline</string> | ||
</dict> | ||
</dict> | ||
</dict> | ||
</dict> | ||
</dict> | ||
</plist> |
40 changes: 40 additions & 0 deletions
40
HandyUIKit.xcodeproj/xcshareddata/xcbaselines/A14E0AC41E1F986A00DFC788.xcbaseline/Info.plist
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,40 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>runDestinationsByUUID</key> | ||
<dict> | ||
<key>C3ECA4DA-1F82-4ABC-A31B-85A51942BB0D</key> | ||
<dict> | ||
<key>localComputer</key> | ||
<dict> | ||
<key>busSpeedInMHz</key> | ||
<integer>100</integer> | ||
<key>cpuCount</key> | ||
<integer>1</integer> | ||
<key>cpuKind</key> | ||
<string>Intel Core i7</string> | ||
<key>cpuSpeedInMHz</key> | ||
<integer>2900</integer> | ||
<key>logicalCPUCoresPerPackage</key> | ||
<integer>8</integer> | ||
<key>modelCode</key> | ||
<string>MacBookPro14,3</string> | ||
<key>physicalCPUCoresPerPackage</key> | ||
<integer>4</integer> | ||
<key>platformIdentifier</key> | ||
<string>com.apple.platform.macosx</string> | ||
</dict> | ||
<key>targetArchitecture</key> | ||
<string>x86_64</string> | ||
<key>targetDevice</key> | ||
<dict> | ||
<key>modelCode</key> | ||
<string>iPhone10,5</string> | ||
<key>platformIdentifier</key> | ||
<string>com.apple.platform.iphonesimulator</string> | ||
</dict> | ||
</dict> | ||
</dict> | ||
</dict> | ||
</plist> |
2 changes: 1 addition & 1 deletion
2
HandyUIKit.xcodeproj/xcshareddata/xcschemes/HandyUIKit-iOS.xcscheme
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
2 changes: 1 addition & 1 deletion
2
HandyUIKit.xcodeproj/xcshareddata/xcschemes/HandyUIKit-tvOS.xcscheme
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>IDEDidComputeMac32BitWarning</key> | ||
<true/> | ||
</dict> | ||
</plist> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// UIImageExtension.swift | ||
// HandyUIKit | ||
// | ||
// Created by Cihat Gündüz on 07.04.18. | ||
// Copyright © 2018 Flinesoft. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
extension UIImage { | ||
/// Creates a grayscale version of the image. | ||
/// | ||
/// - Returns: The grayscale image. | ||
public func toGrayscale() -> UIImage? { | ||
let imageRect = CGRect(size: size) | ||
let colorSpace = CGColorSpaceCreateDeviceGray() | ||
let bitmapInfo = CGBitmapInfo(rawValue: CGImageAlphaInfo.none.rawValue) | ||
let contextOptional = CGContext( | ||
data: nil, | ||
width: Int(size.width), | ||
height: Int(size.height), | ||
bitsPerComponent: 8, | ||
bytesPerRow: 0, | ||
space: colorSpace, | ||
bitmapInfo: bitmapInfo.rawValue | ||
) | ||
|
||
guard let context = contextOptional else { return nil } | ||
context.draw(cgImage!, in: imageRect) | ||
|
||
guard let grayscaleCgImage = context.makeImage() else { return nil } | ||
return UIImage(cgImage: grayscaleCgImage) | ||
} | ||
} |
Oops, something went wrong.