Objective c 斯威夫特中的布尔指针
根据以下方法:Objective c 斯威夫特中的布尔指针,objective-c,swift,boolean,Objective C,Swift,Boolean,根据以下方法: -(void)doThingWith:(NSString*)string changeBoolean:(BOOL*)booleanPointer { //做点什么 *布尔指针=否; } 我应该如何将其转换为Swift?类似的内容是等效的,但是我不确定您打算如何使用“NSString”变量,因此我省略了“inout” func doThingWith( string : String, inout changeBool : Bool ) { //Do Something
-(void)doThingWith:(NSString*)string changeBoolean:(BOOL*)booleanPointer
{
//做点什么
*布尔指针=否;
}
我应该如何将其转换为Swift?类似的内容是等效的,但是我不确定您打算如何使用“NSString”变量,因此我省略了“inout”
func doThingWith( string : String, inout changeBool : Bool ) {
//Do Something
changeBool = false
}
这个字符串没有用。我只是把它作为方法的一部分来写。谢谢