Вам нужно добавить идентификатор канала в этот google_api
, и вы получите всю информацию об этом канале в формате json. например, ваш заданный идентификатор канала - «UCqwUrj10mAEsqezcItqvwEw», вам необходимо добавить это в параметр «id» URL-адреса api. ; часть = фрагмент% 2CcontentDetails% 2Cstatistics & амп; ключ = AIzaSyAWpx46-G9ZByLe8Nk_wqtUekCXvTPM2oI "
Math is quite reliable :-)
yFromBottom = screenHeight - windowHeight - yFromTop
Main screen height is
[[[NSScreen screens] objectAtIndex:0] frame].size.height
I would suggest using an NSAffineTransform. If you draw with respect to the default origin and then apply a transform to the view, you can essentially flip things around in one fell swoop.
Try something like this (from here):
NSRect boundsInWindow = [myView convertRect:[myView bounds] toView:nil];
NSRect visibleRectInWindow = [myView convertRect:[myView visibleRect] toView:nil];
// Flip Y to convert NSWindow coordinates to top-left-based window coordinates.
float borderViewHeight = [[myView window] frame].size.height;
boundsInWindow.origin.y = borderViewHeight - NSMaxY(boundsInWindow);
visibleRectInWindow.origin.y = borderViewHeight - NSMaxY(visibleRectInWindow);