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
// | |
// UIImage+PixelBuffer.swift | |
// CoreMLDemo | |
// | |
// Created by Alexey Solovyov on 08.06.17. | |
// Copyright © 2017 Handsome LLC. All rights reserved. | |
// | |
import UIKit | |
extension UIImage { |
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
var cstr = (str as NSString).utf8String //iOS10+ or .UTF8String otherwise | |
print(String(format: "%-15s", cstr!)) |
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
func prepareVoiceList() { | |
for voice in AVSpeechSynthesisVoice.speechVoices() { | |
let voiceLanguageCode = (voice as AVSpeechSynthesisVoice).language | |
let languageName = NSLocale.currentLocale().displayNameForKey(NSLocaleIdentifier, value: voiceLanguageCode) | |
let dictionary = ["languageName": languageName, "languageCode": voiceLanguageCode] | |
arrVoiceLanguages.append(dictionary) | |
} |
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
searchBar.setPlaceholderTextColor(to:UIColor.searchBarText) | |
searchBar.setTextColor(to: UIColor.white) | |
searchBar.placeholder = "Search this text never show" | |
// let searchField = searchBar.value(forKey: "_searchField") as? UITextField | |
setImage(#imageLiteral(resourceName: "searchBold"), for: .search, state: .normal) | |
setImage(#imageLiteral(resourceName: "closeBold"), for: .clear, state: .normal) | |
UISearchBar.appearance().setImage(UIImage(), for: UISearchBarIcon.search, state: []) | |
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
@implementation CIContext (IntermediateImage) | |
- (CIImage *)rsq_renderToIntermediateImage:(CIImage *)image { | |
CIImage *intermediateImage = nil; | |
CGSize size = image.extent.size; | |
CVPixelBufferRef pixelBuffer = NULL; | |
CVReturn status = CVPixelBufferCreate(kCFAllocatorDefault, | |
size.width, | |
size.height, | |
kCVPixelFormatType_32ARGB, |
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
// | |
// CVError.swift | |
// | |
// Created by Jun Tanaka on 2016/12/13. | |
// Copyright © 2016 Jun Tanaka. All rights reserved. | |
// | |
import CoreVideo | |
public enum CVError: Int32, Error { |
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
// | |
// UILabel+FontSize.Swift | |
// | |
// Created by Nutchaphon Rewik on 7/11/15. | |
// Copyright (c) 2015 Nutchaphon Rewik. All rights reserved. | |
// | |
import UIKit | |
extension UILabel{ |
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
extension Array where Element: Equatable { | |
mutating func delete(_ element: Element) { | |
self = self.filter { $0 != element } | |
} | |
mutating func removeObject<T>(_ element: T) where T : Equatable { | |
self = self.filter {$0 as? T != element} | |
} | |
} |
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
KEYWORDS="TODO|FIXME|\?\?\?:|\!\!\!:" | |
find "${SRCROOT}" \( -name "*.swift" \) -print0 | \ | |
xargs -0 egrep --with-filename --line-number --only-matching "($KEYWORDS).*\$" | \ | |
perl -p -e "s/($KEYWORDS)/ warning: \$1/" |
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
// | |
// FWKCIImageView.h | |
// LineEngraver | |
// | |
// Created by Viktor Goltvyanytsya on 8/8/16. | |
// | |
// | |
OlderNewer