{"action":"created","issue":{"url":"https://api.github.com/repos/lyb5834/YBPopupMenu/issues/2","repository_url":"https://api.github.com/repos/lyb5834/YBPopupMenu","labels_url":"https://api.github.com/repos/lyb5834/YBPopupMenu/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/lyb5834/YBPopupMenu/issues/2/comments","events_url":"https://api.github.com/repos/lyb5834/YBPopupMenu/issues/2/events","html_url":"https://github.com/lyb5834/YBPopupMenu/issues/2","id":192770046,"number":2,"title":"实例化方法","user":{"login":"KaWaDaTa","id":19743675,"avatar_url":"https://avatars.githubusercontent.com/u/19743675?v=3","gravatar_id":"","url":"https://api.github.com/users/KaWaDaTa","html_url":"https://github.com/KaWaDaTa","followers_url":"https://api.github.com/users/KaWaDaTa/followers","following_url":"https://api.github.com/users/KaWaDaTa/following{/other_user}","gists_url":"https://api.github.com/users/KaWaDaTa/gists{/gist_id}","starred_url":"https://api.github.com/users/KaWaDaTa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KaWaDaTa/subscriptions","organizations_url":"https://api.github.com/users/KaWaDaTa/orgs","repos_url":"https://api.github.com/users/KaWaDaTa/repos","events_url":"https://api.github.com/users/KaWaDaTa/events{/privacy}","received_events_url":"https://api.github.com/users/KaWaDaTa/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-01T07:08:13Z","updated_at":"2016-12-01T07:42:05Z","closed_at":null,"body":"因为坐标计算的关系，不能用属性变量存储，也就是每次show就必须实例化一个，否则会出现显示错误\r\n<img width=\"472\" alt=\"2016-12-01 3 05 00\" src=\"https://cloud.githubusercontent.com/assets/19743675/20784799/9602e73a-b7d7-11e6-90b8-77ad46b94817.png\">\r\n\r\n```\r\n- (void)viewDidLoad {\r\n    [super viewDidLoad];\r\n    // Do any additional setup after loading the view, typically from a nib.\r\n    \r\n    _addBtn = ({\r\n        UIButton *addBtn = [UIButton buttonWithType:UIButtonTypeCustom];\r\n        addBtn.frame = CGRectMake(0, 0, 60, 40);\r\n        addBtn.backgroundColor = [UIColor redColor];\r\n        \r\n        addBtn;\r\n    });\r\n    [_addBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];\r\n    \r\n    UIBarButtonItem *rightItem = [[UIBarButtonItem alloc] initWithCustomView:_addBtn];\r\n    self.navigationItem.rightBarButtonItem = rightItem;\r\n\r\n    _addMenu = ({\r\n        YBPopupMenu *menu = [[YBPopupMenu alloc] initWithTitles:@[@\"1\",@\"2\",@\"3\"] icons:nil menuWidth:100 delegate:self];\r\n        \r\n        menu;\r\n    });\r\n}\r\n\r\n- (void)btnClick:(UIButton *)sender\r\n{\r\n//    _addMenu = ({\r\n//        YBPopupMenu *menu = [[YBPopupMenu alloc] initWithTitles:@[@\"1\",@\"2\",@\"3\"] icons:nil menuWidth:100 delegate:self];\r\n//        \r\n//        menu;\r\n//    });\r\n    \r\n    [_addMenu showRelyOnView:_addBtn];\r\n    \r\n//    [YBPopupMenu showRelyOnView:_addBtn titles:@[@\"1\",@\"2\",@\"3\"] icons:nil menuWidth:100 delegate:self];\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/lyb5834/YBPopupMenu/issues/comments/264100208","html_url":"https://github.com/lyb5834/YBPopupMenu/issues/2#issuecomment-264100208","issue_url":"https://api.github.com/repos/lyb5834/YBPopupMenu/issues/2","id":264100208,"user":{"login":"KaWaDaTa","id":19743675,"avatar_url":"https://avatars.githubusercontent.com/u/19743675?v=3","gravatar_id":"","url":"https://api.github.com/users/KaWaDaTa","html_url":"https://github.com/KaWaDaTa","followers_url":"https://api.github.com/users/KaWaDaTa/followers","following_url":"https://api.github.com/users/KaWaDaTa/following{/other_user}","gists_url":"https://api.github.com/users/KaWaDaTa/gists{/gist_id}","starred_url":"https://api.github.com/users/KaWaDaTa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KaWaDaTa/subscriptions","organizations_url":"https://api.github.com/users/KaWaDaTa/orgs","repos_url":"https://api.github.com/users/KaWaDaTa/repos","events_url":"https://api.github.com/users/KaWaDaTa/events{/privacy}","received_events_url":"https://api.github.com/users/KaWaDaTa/received_events","type":"User","site_admin":false},"created_at":"2016-12-01T07:42:05Z","updated_at":"2016-12-01T07:42:05Z","body":"了解，我也只是跟你提一下而已。顺便说一句，代码写的很好！"}}
{"actor":{"display_login":"KaWaDaTa"}}