This file contains hidden or 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 Date { | |
| var startOfDay: Date { | |
| return Calendar.current.startOfDay(for: self) | |
| } | |
| var endOfDay: Date { | |
| var components = DateComponents() | |
| components.day = 1 | |
| components.second = -1 | |
| return Calendar.current.date(byAdding: components, to: startOfDay)! |
This file contains hidden or 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 min = CGFloat(-30) | |
| let max = CGFloat(30) | |
| let xMotion = UIInterpolatingMotionEffect(keyPath: "layer.transform.translation.x", type: .TiltAlongHorizontalAxis) | |
| xMotion.minimumRelativeValue = min | |
| xMotion.maximumRelativeValue = max | |
| let yMotion = UIInterpolatingMotionEffect(keyPath: "layer.transform.translation.y", type: .TiltAlongVerticalAxis) | |
| yMotion.minimumRelativeValue = min | |
| yMotion.maximumRelativeValue = max |
This file contains hidden or 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 { |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |