[Add] HyphenateChat_test1 1.0.1
[CocoaPods.git] / Specs / 1 / a / 8 / ProtocolOrientedViewModel / 0.0.1 / ProtocolOrientedViewModel.podspec.json
blob79dc5a3e74b4752a1ad9f97c65ce1ea6cf0b9b2c
2   "name": "ProtocolOrientedViewModel",
3   "version": "0.0.1",
4   "summary": "Create universal view's with different layouts for each platform and share the view logic between them.",
5   "description": "ProtocolOrientedViewModel\n===\n\nCreate universal view's with different layouts for each platform and share the view logic between them.\n\nRequirements\n----\n\n- Swift 3.0+\n- iOS 8.0+\n- tvOS 9.0+\n- macOS 10.10+\n\nInstall\n----\n\n```\npod 'ProtocolOrientedViewModel'\n```\n\nUsage\n----\n\nThis is most useful for universal ios/tvos/mac projects.\nCreate `Layout`s for your view. For example, portrait and landscape.\nCreate xib's for each layout of each platform or just create them programmaitaclly.\n\n```\nenum HomeScreenLayout: Layout {\ncase portrait\ncase landscape\n\n// Define the type of view\ntypealias View = HomeScreenView\nvar view: HomeScreenView? {\nreturn from xib or create and return them here for each layout.\n}\n}\n```\n\nCreate your view and its delegate with actions.\n\n```\nprotocol HomeScreenViewDelegate: class {\nfunc homeScreenViewDidPressSomething(_ homeScreenView: HomeScreenView)\n...\n}\n\nclass HomeScreenView: POView { // POView is a typealias of NSView and UIView for sharing view.\nweak var delegate: HomeScreenViewDelegate?\n@IBOutlet var someLabel: UILabel?\n\n@IBAction func somethingDidPress() {\ndelegate?.homeScreenViewDidPressSomething(self)\n}\n\n...\n}\n```\n\nAnd create your view model\n\n```\nclass HomeScreenViewModel: ViewModel, HomeScreenViewDelegate {\n\n// MARK: ViewModel\n// define the type of view\ntypealias View = HomeScerenView\nvar view: HomeScrenView?\n\n// Make your updates for your view.\nfunc render() {\nview?.someLabel?.text = dataSource.someValue\nview?...\n}\n\n// MARK: HomeScreenViewDelegate\nfunc homeScreenViewDidPressSomething(_ homeScreenView: HomeScreenView) {\ndataSource.someValue = \"new value\"\nrender()\n}\n\n...\n}\n```\n\nCall `updateLayoutFor:InView:` function on the view model to update layout of your view.\nAlso see the example project for universal usage with multiple layouts with xibs in multiple platforms.",
6   "homepage": "https://github.com/cemolcay/ProtocolOrientedViewModel",
7   "license": "MIT",
8   "authors": {
9     "cemolcay": "ccemolcay@gmail.com"
10   },
11   "social_media_url": "http://twitter.com/cemolcay",
12   "platforms": {
13     "ios": "8.0",
14     "osx": "10.10",
15     "tvos": "9.0"
16   },
17   "source": {
18     "git": "https://github.com/cemolcay/ProtocolOrientedViewModel.git",
19     "tag": "0.0.1"
20   },
21   "source_files": "Source/*.swift",
22   "requires_arc": true,
23   "pushed_with_swift_version": "3.0"