Skip to content

Instantly share code, notes, and snippets.

@adib
Created June 13, 2014 13:08

Revisions

  1. adib created this gist Jun 13, 2014.
    14 changes: 14 additions & 0 deletions BSGLView.h
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    //
    // BSGLView.h
    // AirKill
    //
    // Created by Sasmito Adibowo on 07-06-14.
    // Basil Salad Software, http://basilsalad.com
    //
    // This code is in the public domain.

    #import "CCGLView.h"

    @interface BSGLView : CCGLView

    @end
    28 changes: 28 additions & 0 deletions BSGLView.m
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    //
    // BSGLView.m
    // AirKill
    //
    // Created by Sasmito Adibowo on 07-06-14.
    // Basil Salad Software, http://basilsalad.com
    //
    // This code is in the public domain.
    //

    #import <objc/message.h>
    #import "BSGLView.h"

    @implementation BSGLView


    -(void)layoutSubviews
    {
    // We need this because CCGLView doesn't call UIView layoutSubviews and we need to add subviews

    Class granny = [[self superclass] superclass];
    struct objc_super theSuper = {self, granny};
    objc_msgSendSuper(&theSuper,_cmd);

    [super layoutSubviews];
    }

    @end