요즘에 거의 대부분의 앱들은 오픈소스(GitHub와 같은 곳에서 )를 이용해 개발한다.

이렇게 오픈소스를 이용해 만들어진 앱은 각각의 라이센스에 따라 표기 해줘야 하는데 대부분은 헬프나 설정화면에 오픈소스정보항목을 만들어 사용되어진 라이센스정보를 표시해준다.

그럼 라이센스정보화면을 간단히 만들어보자.


.h파일

/**

 * @brief ライセンス情報画面コントローラー

 */

@interface OpenSourceViewController : UIViewController {

    

    IBOutlet UIWebView *licenseWebview;

}


@end


 

.m파일

- (void)viewDidLoad

{

    [super viewDidLoad];

// Do any additional setup after loading the view.

    

    [self initControls];

}


- (void)initControls {

    

    NSString *path = [[NSBundle mainBundle] pathForResource:@"license" ofType:@"html"];

    [licenseWebview loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:path]]];

}


-(BOOL) webView:(UIWebView *)inWeb shouldStartLoadWithRequest:(NSURLRequest *)inRequest navigationType:(UIWebViewNavigationType)inType {

    

    if ( inType == UIWebViewNavigationTypeLinkClicked ) {

        [[UIApplication sharedApplication] openURL:[inRequest URL]];

        return NO;

    }

    

    return YES;

}



.html파일(라이센스정보)

<html>

<body>

    <H3>

        AFNetworking

    </H3>

    <p>

    Copyright (c) 2011 Gowalla (<a href="http://gowalla.com/">http://gowalla.com/</a>)<br>

    Permission is hereby granted, free of charge, to any person obtaining a copy

    of this software and associated documentation files (the "Software"), to deal

    in the Software without restriction, including without limitation the rights

    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell

    copies of the Software, and to permit persons to whom the Software is

    furnished to do so, subject to the following conditions:<br>

    <br>

    The above copyright notice and this permission notice shall be included in

    all copies or substantial portions of the Software.<br>

    <br>

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR

    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,

    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE

    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER

    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,

    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN

    THE SOFTWARE.<br>

    </p>


</body>

</html>


만들어진 화면.






Posted by 악당잰 트랙백 0 : 댓글 0

댓글을 달아 주세요