Skip to content

Instantly share code, notes, and snippets.

@nakiwo
nakiwo / MyButton.swift
Created October 6, 2017 14:10
関連づけられたラベルの色をステートに合わせて変えるUIButton。ハイライト時のフェードアニメーション付き
import UIKit
class MyButton: UIButton {
@IBOutlet weak var associatedLabel: UILabel? {
didSet {
associatedLabel?.textColor = currentTitleColor
}
}
@nakiwo
nakiwo / podcast_to_csv.rb
Created January 19, 2020 11:48
podcast_to_csv.rb
require 'rss'
require "csv"
rss_source = File.new('feed.xml')
rss = RSS::Parser.parse(rss_source, false)
CSV.open('test.csv','w') do |csv|
rss.items.each do |item|
title = item.title
date = item.pubDate.localtime.strftime('%Y/%m/%d')
@nakiwo
nakiwo / combine_retry.swift
Created August 27, 2020 13:51
combine_retry
import Combine
import Foundation
enum CustomError: Error {
case retryError
case otherError
}
var count = 0