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
// | |
// RxAVSpeechSynthesizerDelegate.swift | |
// Pomodoro | |
// | |
// Created by Won on 17/12/2018. | |
// Copyright © 2018 won. All rights reserved. | |
// | |
#if os(iOS) |
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
// String to Data utf8 | |
let strData: Data = Data("String".utf8) | |
// Data to String | |
let str = String(data: strData, encoding: .utf8) |
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
struct Coordinate: Codable { | |
var latitude: Double | |
var longitude: Double | |
} | |
struct Landmark: Codable { | |
var name: String | |
var foundingYear: Int | |
var location: Coordinate |
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
override var isSelected: Bool{ | |
didSet{ | |
if self.isSelected | |
{ | |
self.transform = CGAffineTransform(scaleX: 1.1, y: 1.1) | |
self.contentView.backgroundColor = UIColor.red | |
self.tickImageView.isHidden = false | |
} | |
else | |
{ |
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
let origImage = UIImage(named: "icon") | |
let tintedImage = origImage?.withRenderingMode(.alwaysTemplate) | |
button.setImage(tintedImage, for: .normal) | |
button.tintColor = .red |
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
# AnimatedMaskLabel | |
```swift | |
// | |
// AnimatedMaskLabel.swift | |
// AnimatedMaskLabel | |
// | |
// Created by JOGENDRA on 06/04/18. | |
// |
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
// HDR | |
@IBOutlet weak var hdrButton: HDRButton! | |
var currentHDRMode: HDRMode = .auto | |
@IBAction func HDRButtonTouched(_ sender: HDRButton) { | |
toggleHDR() | |
sender.mode = currentHDRMode | |
} |
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
import UIKit | |
class TailTagView: UIView { | |
var rawText: String? { | |
didSet { | |
label.attributedText = parseText(rawText: rawText) | |
} | |
} |
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
// | |
// RxAVSpeechSynthesizerDelegate.swift | |
// Pomodoro | |
// | |
// Created by Won on 17/12/2018. | |
// Copyright © 2018 won. All rights reserved. | |
// | |
#if os(iOS) |
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
// | |
// Created by はるふ on 2017/12/11. | |
// Copyright © 2017年 ha1f. All rights reserved. | |
// | |
import Foundation | |
import CoreImage | |
import AVFoundation | |
extension CIFilter { |