UserDefaults.standard.set(Date(), forKey:"creationTime1") if let date = UserDefaults.standard.object(forKey: "creationTime1") as? Date { if let diff = Calendar.current.dateComponents([.hour], from: date, to: Date()).hour, diff > 24 { keys.setNewTokenValue() } }
Could not find 'CFPropertyList' (>= 2.3.3, Could not find 'cocoapods' (>= 0) among N total gem(s) (Gem::LoadError) When I am trying to pod install, getting following issue: Faizs-MBP:newj faizfareed$ pod install /Library/Ruby/Site/2.0.0/rubygems/dependency.rb:315:in `to_specs': Could not find 'cocoapods' (>... stackoverflow.com sudo gem uninstall --all sudo gem install -n /usr/local/bin cocoapod..
위 사진처럼 이미지, 텍스트, 뷰로 이루어진 내용이 있다. 서로 정보는 다르지만 레이아웃이 같기 때문에 하나의 뷰를 만들어 재사용이 가능하다. class ContentsView: UIView { init(title: String, subTitle: String, img: String) { super.init(frame: CGRect.zero) self.titleLabel.text = title self.subTitleLabel.text = subTitle self.iconImageView.image = UIImage(named: img) setupViews() } required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) } } 위 처럼 ..