fileprivate:文件内私有
private:真正的私有,类和结构体内部以外都无法访问
-----------------------------------------
"??"
双问号操作符
对于不期望某个optional值为nil的func返回nil或者其值为nil而停止后续业务的情况下,我们用“??”在optionalvalue为nil的时候赋值保险操作("??" 操作后放回值为非nil)
如 let demoStr: String = optionalValue ?? ""
这里如果optionValue 为nil,那么demoStr等于""
-------------------------------------------
有关设置tabbarItem的图片 设置图片的imageWithRenderingMode方法可以指定图片是否使用tabbar的主题颜色,枚举值为:
typedef NS_ENUM(NSInteger, UIImageRenderingMode) {
// 使用图像的上下文中使用的默认渲染模式,使用默认的蓝色
UIImageRenderingModeAutomatic, // Use the default rendering mode for the context where the image is used
// 总是画出原始图像,使用图片自带的颜色
UIImageRenderingModeAlwaysOriginal, // Always draw the original image, without treating it as a template
// 总是把图像作为模板图像,忽略了它的颜色信息
UIImageRenderingModeAlwaysTemplate, // Always draw the image as a template image, ignoring its color information
} NS_ENUM_AVAILABLE_IOS(7_0);