Open system wifi settings
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"App-Prefs:root=WIFI"]];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"App-Prefs:root=WIFI"]];
正式版:sudo gem install cocoapods
开发版:sudo gem install cocoapods --pre
安装:brew install carthage
添加:Cartfile
运行:carthage update
添加:Carthage/Build/.framework
通过 Carthage 安装,在 Cartfile 中添加github "facebook/ComponentKit" ~> 0.20
,然后运行carthage update
,编译完成后,在 Embedded Binaries 添加Carthage/Build/iOS/ComponentKit.framework
。所有需要使用ComponentKit的源文件需要修改后缀为 .mm。
Doing so this reverses the traditional approach for a UICollectionViewDataSource
. Usually the controller layer will tell the UICollectionView
to update and then the UICollectionView
ask the datasource for the data. Here the model is more Reactive, from an external prospective, the datasource is told what changes to apply and then tell the collection view to apply the corresponding changes.
flex container:容器。
main axis:main start, main end。
cross axis:cross start, cross end。
flex item:成员。
main size。
cross size。
A component is an immutable object that specifies how to configure a view, loosely inspired by React.
1 2 |
|
Example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
Components are immutable objects that specify how to configure views.
Declarative : You declare the subcomponents of your component.
Functional : Data flows in one direction.
Composable : Reusing it is a one-liner.
Value types are created on the stack, Reference types are created on the heap.
Stack is attached to a thread, and Heap is attached to the application.
Stack is faster than Heap.
NSURL -> NSString:NSString *path = [url path];
NSString -> NSURL:NSURL *url = [NSURL fileURLWithPath:path];
UIImage -> NSData:NSData *data = UIImagePNGRepresentation(image);
NSData -> UIImage:UIImage *image = [UIImage imageWithData:data];