# ReflectionDemo **Repository Path**: creeve/ReflectionDemo ## Basic Information - **Project Name**: ReflectionDemo - **Description**: ReflectionDemo - **Primary Language**: Objective-C - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2016-12-12 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README #ReflectionDemo 演示反射用于服务器端控制App端代码的功能。 只要和服务器协商好数据格式,server端就可以通过推送消息让App执行指定的行为。 例如: ``` { "className" : "PlayerViewController", "properties" : { "videoTitle" : "Fast and Furious Trailer", "videoURL" : "http://media.kg-portal.ru/movies/f/furious8/trailers/furious8_trailer_1280.mp4", }, "methodName" : "play" } ``` 服务器端返回这样一个JSON,就能让客户端执行用`PlayerViewController`播放地址为http://media.kg-portal.ru/movies/f/furious8/trailers/furious8_trailer_1280.mp4,标题为Fast and Furious Trailer的视频。 这只是实现类似点击通知后跳转某个页面的功能,如果打开脑洞,甚至可以把很多代码都放在服务器端,让客户端根据服务器端返回的数据来进行页面布局,功能逻辑。