如何UILabel
以编程方式在Swift 中将a的文本设置为粗体?我的代码到目前为止:
var label = UILabel(frame:theFrame)
label.text = "Foo"
Run Code Online (Sandbox Code Playgroud) 我刚下载了Xcode 6的GM版本,它不会编译出错:
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1
Run Code Online (Sandbox Code Playgroud)
有想法该怎么解决这个吗?
我有一个实例,UIBezierPath
我想将笔画的颜色改为黑色以外的东西.有谁知道如何在Swift中这样做?
我有两个NSTimers,我编程使屏幕上出现一个按钮,然后消失.如何满足条件,如何对其进行编程以停止添加和删除按钮?
这是我的代码:
var timerRemoveButton = NSTimer.scheduledTimerWithTimeInterval(1.0, target: self, selector: "removeButton", userInfo: nil, repeats: true)
var timerAddButton = NSTimer.scheduledTimerWithTimeInterval(1.0, target: self, selector: "addButton", userInfo: nil, repeats: true)
Run Code Online (Sandbox Code Playgroud) 所以我有我的UIScrollView
,
var myScrollView = UIScrollView(frame:theFrame)
Run Code Online (Sandbox Code Playgroud)
我想禁用垂直滚动.有谁知道如何使用Swift实现这个?
所以我想每天擦除特定记录类型的每条记录.所以基本上,我希望在凌晨12点擦除数据,以便第二天新鲜.我该怎么做呢?这是我可以在CloudKit仪表板中设置的,还是我必须以编程方式设置它?
我正在尝试使用cl在cmd上编译,它说我缺少mspdb110.dll.有人知道怎么修这个东西吗?
编辑:我将此文件路径添加到PATH C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin
,该文件是标准的hello world程序
我想设置一个MKPointAnnotation
,当它被点击时,我可以调用另一个功能.反正有没有添加手势识别器或类似的东西?
我试过这个,但什么也没发生.选择器有问题吗?
func timer() {
var timer = NSTimer(timeInterval: 2.0, target: self, selector:Selector("function"), userInfo: nil, repeats: false)
}
func function() {
println("it worked")
}
Run Code Online (Sandbox Code Playgroud) 嗨,我正在尝试制作桥接头,但我不知道在构建设置中指定路径的位置。有谁知道如何做到这一点?
如何限制UITextField
to中的字符数10
,如果用户输入的字符数超过10
,则只记录前10个字符?
swift ×10
ios ×8
nstimer ×2
cloudkit ×1
cmd ×1
mapkit ×1
objective-c ×1
uibezierpath ×1
uilabel ×1
uiscrollview ×1
uitextfield ×1
visual-c++ ×1
xcode ×1