10/12 study

[患者版]加号选择页:

这是四个TableView放在Scrollview上


上面是个xib封装的view
整体就是个scrollView,用xib摆上去的控件:
 
上面加了黄条,旧的控件统一修改y坐标:
 
 
这个浮层是一个控制器:
HDFSeeDoctorPopupViewController.h
点击立即就诊push下个页面,将这个浮层隐藏,但是并不remove, 从下一个页面返回的时候,判断如果这个view是隐藏的,那么将它显示出来
在viewWillApperar方法中:
 
 
使用了运行时的关联对象,此处是getAssociatedObject
点击立即就诊的时候,只是将view隐藏了:
 
点击X的时候删掉view, 调用remove不调用hide了
dissmiss给释放了设置为nil
setAssociatedObject
取消所有请求:  cancelOperationsWithURL
 
关于运行时的关联对象,查询苹果文档,一共就三个方法:
func objc_setAssociatedObject(Any!, UnsafeRawPointer!, Any!, objc_AssociationPolicy)

Sets an associated value for a given object using a given key and association policy. 

func objc_getAssociatedObject(Any!, UnsafeRawPointer!)

Returns the value associated with a given object for a given key. 

func objc_removeAssociatedObjects(Any!)
 
Removes all associations for a given object.
 
我们的这个页面是如何运用的呢?
在哪里set关联对象?
 
在哪里get关联对象?

posted on 2016-10-13 10:22  土匪7  阅读(99)  评论(0编辑  收藏  举报