我想要一些意见/帮助创建一个相当简单的功能,这里有要求:
我需要确定当前时间是白天还是晚上(白天是早上6点到下午6点).例如,这里有一些伪代码:
if(currentTime < 6pm && currentTime > 6am){
return timeIsDay
}
else{
return timeIsNight
}
Run Code Online (Sandbox Code Playgroud)
这是针对Objective C中的IOS应用程序,必须与IOS 8.0兼容.