Swift-Tips
Validate target date is between start date and end date.
Example:
start: 2020.0617
end: 2020.0619
validate target date: 2020.0618
let now = Date()
let isEffective = (start...end).contains(now)
[[Swift.Date]]
import Foundation
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy/MM/dd"
let yesterDayString = "2020/06/18"
let yesterDay = dateFormatter.date(from: yesterDayString)!
let tomorrowString = "2020/06/20"
let tomorrow = dateFormatter.date(from: tomorrowString)!
let now = Date()
let isEffective = (yesterDay...tomorrow).contains(now)
print(isEffective)
William Kuo @iOSTaipei Overview Introduce VoiceOver Debug / Test VoiceOver VoiceOver basic APIs VoiceOver post changes and status VoiceOver Numbers
Sep 13, 2021主題 手把手帶你用 Clean Swift 重構 MVC, 並替核心程式碼撰寫單元測試 Massive ViewController 是所有 iOS 工程師的夢魘, 但是使用 MVVM 之後, 大家真的就過著幸福快樂的日子了嗎? 如果沒有, 其實你可以試試 Clean Swift.在 Clean Swift 當中, 所有物件都只有一個職責, 所有的資料流也只有一個流向. 這讓我們設計單元測試時, 可以一次只專注在一件事. 我們希望和你分享在中型團隊 (4-7 人) 中使用 Clean Swift 的愉快體驗, 分享 Clean Swift 如何在撰寫單元測試、可讀性和 code review 中幫助團隊有一致且清晰的程式碼撰寫風格. 這個 work shop 將帶你從一個略為混亂的 MVC 專案逐漸往 Clean Swift 重構, 讓原本複雜的資料流和畫面控制變得簡單純粹. 如果還有時間, 我們會展示核心程式碼加上單元測試的保護在 Clean Swift 中有多容易, 讓最後的程式碼不但單純也非常可靠. 自我介紹 Ting-Yen, Kuo
Sep 26, 2020Keyboard Shortcuts ⌘ + H Hide your current use app. ⌘ + Tab then select target app and H Hide your selection app. ⌘ + F3 Jump to Desktop.
Jul 31, 2020This post is for those who use code layout and feel unhappy about so many constraints and offsets/insets should define and set. It's really the time to reduce code layout process time and take more time on learning SwiftUI. Warning In this post we use UIStackView and layoutMargins for building concise custom view, that may not suitable for complex animation. 📐 Autolayout is not very easy to maintain let's not talk about frame-layout maintainability.
Jul 26, 2020or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up