Swift学习之与OC的不同之处

1.选项集的不同:

OC中用“|”:


self.addressLabel.autoresizingMask=UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;

Swift中用[ ]:


addressLabel.autoresizingMask = [.flexibleHeight, .flexibleWidth]

2.析构函数的不同

OC中用dealloc:


- (void)dealloc {

}

Swift中用deinit:


deinit {

}

你可能感兴趣的:(Swift学习之与OC的不同之处)