我发现UISegmentedControl更改字体和大小如下:
UISegmentedControl.appearance().setTitleTextAttributes(myFontAttribute as [NSObject : AnyObject] , forState: .Normal)
但是UILabel没有这种方法
我想这样做
UILabel.appearance().setAttributed(myFontAttribute)
我不想在StoryBoard中更改UILabel字体
我想使用程序来执行此操作(因为我的应用程序已完成,但只有字体应更改为更大和其他字体)
我该怎么办 ?
我的故事板
如果用户没有登录,则rootViewController是 Login
用户登录完成后,rootViewController是MainTabBarController
我做到了
但是,我遇到的问题是 Logout
我的Logout是dismissViewController
如果我的rootViewController是Login,它的工作原理
它将删除当前的ViewController,因此Login出现
但是当我的rootViewController是MainTabBarController,dismiss不起作用时,我试着poptoRootViewController徒劳无功.
我该怎么办Logout?
我想这样做
dismissController(true,{
rootViewController = `Login`
})
Run Code Online (Sandbox Code Playgroud) 我看过apple开发者文档:
第一篇文章指出:复杂性:O(n),其中n是集合中元素的数量.
第二篇文章指出:复杂性:O(1),没有任何理由.
这只是一个小错误还是其他原因?
因为第二篇文章举了一个例子
let word = "Backwards"
for char in word.reversed() {
print(char, terminator: "")
}
// Prints "sdrawkcaB"
Run Code Online (Sandbox Code Playgroud)
我认为O(n)是正确答案.对?