SlideShare a Scribd company logo
1 of 30
StoryBoard 구현실습
    Develop By S.O.Lab
Lecture Flow URL
http://bit.ly/SE3PWS
StoryBoard Based Project 생성
* Use Storyboards check!!!!!
* Use Automatic Reference Counting check!!!!!
StoryBoard 구조 분석
main page 구현
네비게이션 컨트롤뷰 구조
1. TableViewController 삭제후 View Controller 추가
2. Ctl+드레그 ViewController 위치후 relationship 선택
main page 버튼구현
네비게이션 바 제목추가




           1단계 완료
       - 구글docs 1단계 “OK”
소개 page 삽입
소개 page 구현
소개 page 구현




                2단계완료
             -Docs 2단계 “OK”
메뉴 page 삽입
메뉴 page 구현
메뉴상세 page 구현
메뉴상세 page 구현




                            3단계완료
* 각각의 메뉴 page 를 구현후 완료   -Docs 3단계 “OK”
위치 page 삽입
위치 page 구현




    * 컴파일후 실행시 ERROR !!
위치 page 구현
위치 page 구현
위치 page 구현

- (void)viewDidLoad
{
    [super viewDidLoad];
! // Do any additional setup after loading the view.
    MKMapView *gmap = [[MKMapView alloc] initWithFrame:self.view.bounds];
    // 지도뷰를 만듭니다. 아래 코드없이 바로 추가하면 미국지도가 보이네요.

    gmap.showsUserLocation = TRUE;        // 내위치 표시. 시뮬에이터는 항상 애플본사가 현재 위치로 나옵니다

    // gmap.mapType = MKMapTypeHybrid;      // 지도인지 위성 사진에 하이브리드로 할지 결정~


    MKCoordinateRegion region;
    MKCoordinateSpan span;    // 보여줄 지도가 처리하는 넓이를 정의합니다. 문서 읽어 보시길..
    span.latitudeDelta=0.02; // 숫자가 작으면 좁은 영역, 즉 우리동네 자세히~보임
    span.longitudeDelta=0.02;

    CLLocationCoordinate2D location=gmap.userLocation.coordinate;

    //그래도 블로깅하려고, 우리나라 위도,경도 찾아서 넣었습니다.
    location.latitude=37.514849;
    location.longitude=126.954063;

    region.span=span;   //위에서 정한 크기 설정하고
    region.center=location; // 위치 설정하고

    [gmap setRegion:region    animated: TRUE];    // 지도 뷰에 지역을 설정하고
    [gmap regionThatFits:region];


    [self.view addSubview:gmap];     //    서브 뷰로 지도를 추가해야 보이겠지요!!
}
위치 page 구현
위치 page 구현
- (void)viewDidLoad
{
    [super viewDidLoad];
    MKMapView *gmap = [[MKMapView alloc] initWithFrame:self.view.bounds];

    gmap.showsUserLocation = TRUE;        // 내위치 표시. 시뮬에이터는 항상 애플본사가 현재 위치로 나옵니다


    MKCoordinateRegion region;
    MKCoordinateSpan span;    // 보여줄 지도가 처리하는 넓이를 정의합니다. 문서 읽어 보시길..
    span.latitudeDelta=0.02; // 숫자가 작으면 좁은 영역, 즉 우리동네 자세히~보임
    span.longitudeDelta=0.02;

    CLLocationCoordinate2D location=gmap.userLocation.coordinate;

    //그래도 블로깅하려고, 우리나라 위도,경도 찾아서 넣었습니다.
    //location.latitude=37.514849;
    //location.longitude=126.954063;

    location.latitude=35.1655253;
    location.longitude=129.0721951;

        //http://map.naver.com/?
    dlevel=12&lat=35.1655253&lng=129.0721951&searchCoord=129.0721951%3B35.1655253
    &type=COORD&tab=1&query=67aA7IKw6rSR7Jet7IucIOu2gOyCsOynhOq1rCDsoITtj6zrj5kgMTItMTY3D&
    menu=location&mapMode=0&enc=b64

    region.span=span;   //위에서 정한 크기 설정하고
    region.center=location; // 위치 설정하고



    [gmap setRegion:region    animated: TRUE];    // 지도 뷰에 지역을 설정하고
    [gmap regionThatFits:region];


    [self.view addSubview:gmap];     //    서브 뷰로 지도를 추가해야 보이겠지요!!
}
사진 page 삽입
사진 page 구현
사진 page 구현
사진 page 구현
사진 page 구현


#import <UIKit/UIKit.h>

@interface FictureViewController : UIViewController
{

       UIButton *nextBt,*preBt;
       UIImageView *iV;

}

@property(strong, nonatomic) UIButton *nextBt,*preBt;
@property(strong, nonatomic) UIImageView *iV;


@end
사진 page 구현
@implementation FictureViewController

@synthesize nextBt,preBt,iV;

int imagecount;



- (void)viewDidLoad
{
    [super viewDidLoad];
! // Do any additional setup after loading the view.
    iV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"1.png"]];
    iV.frame = CGRectMake(0, 0, 320, 300);
    [self.view addSubview:iV];

    nextBt = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    nextBt.frame =CGRectMake(180, 350, 100, 30);
    [nextBt setTitle:@"다음사진" forState:UIControlStateNormal];
    [nextBt addTarget:self action:@selector(nextBtAction)
forControlEvents:UIControlEventTouchUpInside ];
    [self.view addSubview:nextBt];

    preBt = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    preBt.frame =CGRectMake(50, 350, 100, 30);
    [preBt setTitle:@"이전사진" forState:UIControlStateNormal];
    [preBt addTarget:self action:@selector(preBtAction)
forControlEvents:UIControlEventTouchUpInside ];
    [self.view addSubview:preBt];

    imagecount = 1;

}
사진 page 구현
-(void) nextBtAction
{
    if(imagecount == 5)
    {
        imagecount =0;
    }
    imagecount++;
    NSLog(@"imagecount ==> %d",imagecount);
    [iV setImage:[UIImage imageNamed:[NSString stringWithFormat:@"%d.png",imagecount]]];
}
-(void) preBtAction
{
    if(imagecount == 1)
    {
        imagecount = 6;
    }
    imagecount--;
    NSLog(@"imagecount ==> %d",imagecount);
    [iV setImage:[UIImage imageNamed:[NSString stringWithFormat:@"%d.png",imagecount]]];
}

More Related Content

Viewers also liked

Intervención con menores infractores
Intervención con menores infractoresIntervención con menores infractores
Intervención con menores infractoresEmagister
 
Social media, Web 2.0 & language teaching (Foresite, Sèvres, July 2011)
Social media, Web 2.0 & language teaching (Foresite, Sèvres, July 2011)Social media, Web 2.0 & language teaching (Foresite, Sèvres, July 2011)
Social media, Web 2.0 & language teaching (Foresite, Sèvres, July 2011)Claudia Warth
 
New rules of_marketing_part01
New rules of_marketing_part01New rules of_marketing_part01
New rules of_marketing_part01Co3
 
Alimentacao Saudavel 19 01 10
Alimentacao Saudavel 19 01 10Alimentacao Saudavel 19 01 10
Alimentacao Saudavel 19 01 10Augusto Mota
 
Knocking out Poverty with Peer-to-Peer Lending
Knocking out Poverty with Peer-to-Peer LendingKnocking out Poverty with Peer-to-Peer Lending
Knocking out Poverty with Peer-to-Peer LendingThoughtBerg FSP
 
Power Point presentacion
Power Point presentacionPower Point presentacion
Power Point presentacionfcacasas
 
Mobile Marketing - Sosyal akademi
Mobile Marketing - Sosyal akademiMobile Marketing - Sosyal akademi
Mobile Marketing - Sosyal akademiYagmur Anish
 
Andbank logra sus primeros beneficios en españa
Andbank logra sus primeros beneficios en españaAndbank logra sus primeros beneficios en españa
Andbank logra sus primeros beneficios en españaAndbank
 
Web 2.0 and Social Media in the Language and Literature Classroom
Web 2.0 and Social Media in the Language and Literature ClassroomWeb 2.0 and Social Media in the Language and Literature Classroom
Web 2.0 and Social Media in the Language and Literature ClassroomClaudia Warth
 
L'Observatoire +Simple des Indépendants et des TPE / janvier 2016
L'Observatoire +Simple des Indépendants et des TPE  / janvier 2016L'Observatoire +Simple des Indépendants et des TPE  / janvier 2016
L'Observatoire +Simple des Indépendants et des TPE / janvier 2016contactOpinionWay
 
A Learning Environment for a Sustainable Future
A Learning Environment for a Sustainable FutureA Learning Environment for a Sustainable Future
A Learning Environment for a Sustainable FutureLynne Vey
 
Opinion Way pour Délits d'Opinion - Baromètre Les Français et les sondages - ...
Opinion Way pour Délits d'Opinion - Baromètre Les Français et les sondages - ...Opinion Way pour Délits d'Opinion - Baromètre Les Français et les sondages - ...
Opinion Way pour Délits d'Opinion - Baromètre Les Français et les sondages - ...contactOpinionWay
 

Viewers also liked (17)

Intervención con menores infractores
Intervención con menores infractoresIntervención con menores infractores
Intervención con menores infractores
 
Social media, Web 2.0 & language teaching (Foresite, Sèvres, July 2011)
Social media, Web 2.0 & language teaching (Foresite, Sèvres, July 2011)Social media, Web 2.0 & language teaching (Foresite, Sèvres, July 2011)
Social media, Web 2.0 & language teaching (Foresite, Sèvres, July 2011)
 
New rules of_marketing_part01
New rules of_marketing_part01New rules of_marketing_part01
New rules of_marketing_part01
 
Alimentacao Saudavel 19 01 10
Alimentacao Saudavel 19 01 10Alimentacao Saudavel 19 01 10
Alimentacao Saudavel 19 01 10
 
Knocking out Poverty with Peer-to-Peer Lending
Knocking out Poverty with Peer-to-Peer LendingKnocking out Poverty with Peer-to-Peer Lending
Knocking out Poverty with Peer-to-Peer Lending
 
Exposicion proexport
Exposicion proexportExposicion proexport
Exposicion proexport
 
Power Point presentacion
Power Point presentacionPower Point presentacion
Power Point presentacion
 
Areas
AreasAreas
Areas
 
Mobile Marketing - Sosyal akademi
Mobile Marketing - Sosyal akademiMobile Marketing - Sosyal akademi
Mobile Marketing - Sosyal akademi
 
Andbank logra sus primeros beneficios en españa
Andbank logra sus primeros beneficios en españaAndbank logra sus primeros beneficios en españa
Andbank logra sus primeros beneficios en españa
 
Web 2.0 and Social Media in the Language and Literature Classroom
Web 2.0 and Social Media in the Language and Literature ClassroomWeb 2.0 and Social Media in the Language and Literature Classroom
Web 2.0 and Social Media in the Language and Literature Classroom
 
L'Observatoire +Simple des Indépendants et des TPE / janvier 2016
L'Observatoire +Simple des Indépendants et des TPE  / janvier 2016L'Observatoire +Simple des Indépendants et des TPE  / janvier 2016
L'Observatoire +Simple des Indépendants et des TPE / janvier 2016
 
The Pitch
The PitchThe Pitch
The Pitch
 
A Learning Environment for a Sustainable Future
A Learning Environment for a Sustainable FutureA Learning Environment for a Sustainable Future
A Learning Environment for a Sustainable Future
 
Farmacocinética
Farmacocinética Farmacocinética
Farmacocinética
 
Hdbs2 thiết kế-và_chi_phí_đầu_tư_cho_kho_bảo_quản
Hdbs2 thiết kế-và_chi_phí_đầu_tư_cho_kho_bảo_quảnHdbs2 thiết kế-và_chi_phí_đầu_tư_cho_kho_bảo_quản
Hdbs2 thiết kế-và_chi_phí_đầu_tư_cho_kho_bảo_quản
 
Opinion Way pour Délits d'Opinion - Baromètre Les Français et les sondages - ...
Opinion Way pour Délits d'Opinion - Baromètre Les Français et les sondages - ...Opinion Way pour Délits d'Opinion - Baromètre Les Français et les sondages - ...
Opinion Way pour Délits d'Opinion - Baromètre Les Français et les sondages - ...
 

Similar to Storyboard iOS 개발실습예제

3D 모델러 ADDIN 개발과정 요약
3D 모델러 ADDIN 개발과정 요약3D 모델러 ADDIN 개발과정 요약
3D 모델러 ADDIN 개발과정 요약Tae wook kang
 
Meteor React Tutorial 따라하기
Meteor React Tutorial 따라하기Meteor React Tutorial 따라하기
Meteor React Tutorial 따라하기Jiam Seo
 
우리가 몰랐던 크롬 개발자 도구
우리가 몰랐던 크롬 개발자 도구우리가 몰랐던 크롬 개발자 도구
우리가 몰랐던 크롬 개발자 도구Jae Sung Park
 
Jenkins를 활용한 javascript 개발
Jenkins를 활용한 javascript 개발Jenkins를 활용한 javascript 개발
Jenkins를 활용한 javascript 개발지수 윤
 
[웹기반시스템 3조]e govframe 중간고사 제출 정리
[웹기반시스템 3조]e govframe 중간고사 제출 정리[웹기반시스템 3조]e govframe 중간고사 제출 정리
[웹기반시스템 3조]e govframe 중간고사 제출 정리구 봉
 
조은 - AMP PWA 101 [WSConf.Seoul.2017. Vol.2]
조은 - AMP PWA 101 [WSConf.Seoul.2017. Vol.2]조은 - AMP PWA 101 [WSConf.Seoul.2017. Vol.2]
조은 - AMP PWA 101 [WSConf.Seoul.2017. Vol.2]WSConf.
 
Data-binding AngularJS
Data-binding AngularJSData-binding AngularJS
Data-binding AngularJSEunYoung Kim
 
H3 2011 ios5 새로운 기능들의 프로젝트 적용 사례_ios팀_김윤봉
H3 2011 ios5 새로운 기능들의 프로젝트 적용 사례_ios팀_김윤봉H3 2011 ios5 새로운 기능들의 프로젝트 적용 사례_ios팀_김윤봉
H3 2011 ios5 새로운 기능들의 프로젝트 적용 사례_ios팀_김윤봉KTH, 케이티하이텔
 
H3 2011 iOS5 새로운 기능들의 프로젝트 적용 사례
H3 2011 iOS5 새로운 기능들의 프로젝트 적용 사례H3 2011 iOS5 새로운 기능들의 프로젝트 적용 사례
H3 2011 iOS5 새로운 기능들의 프로젝트 적용 사례KTH
 
(자마린안드로이드예제실습)현재 위치를 얻은 후 지도에 표시하기, GPS다루기, 마시멜로이후 권한 획득방법 구현_추천자마린학원/자마린교육
(자마린안드로이드예제실습)현재 위치를 얻은 후 지도에 표시하기, GPS다루기, 마시멜로이후 권한 획득방법 구현_추천자마린학원/자마린교육(자마린안드로이드예제실습)현재 위치를 얻은 후 지도에 표시하기, GPS다루기, 마시멜로이후 권한 획득방법 구현_추천자마린학원/자마린교육
(자마린안드로이드예제실습)현재 위치를 얻은 후 지도에 표시하기, GPS다루기, 마시멜로이후 권한 획득방법 구현_추천자마린학원/자마린교육탑크리에듀(구로디지털단지역3번출구 2분거리)
 
[IOS말고 Android] Inflation을 이용하여 부분 Activity 띄우기
[IOS말고 Android] Inflation을 이용하여 부분 Activity 띄우기[IOS말고 Android] Inflation을 이용하여 부분 Activity 띄우기
[IOS말고 Android] Inflation을 이용하여 부분 Activity 띄우기SangHun Lee
 
Vue.js 기초 실습.pptx
Vue.js 기초 실습.pptxVue.js 기초 실습.pptx
Vue.js 기초 실습.pptxwonyong hwang
 
React Hooks 마법. 그리고 깔끔한 사용기
React Hooks 마법. 그리고 깔끔한 사용기React Hooks 마법. 그리고 깔끔한 사용기
React Hooks 마법. 그리고 깔끔한 사용기NAVER SHOPPING
 
React Native를 사용한
 초간단 커뮤니티 앱 제작
React Native를 사용한
 초간단 커뮤니티 앱 제작React Native를 사용한
 초간단 커뮤니티 앱 제작
React Native를 사용한
 초간단 커뮤니티 앱 제작Taegon Kim
 

Similar to Storyboard iOS 개발실습예제 (20)

3D 모델러 ADDIN 개발과정 요약
3D 모델러 ADDIN 개발과정 요약3D 모델러 ADDIN 개발과정 요약
3D 모델러 ADDIN 개발과정 요약
 
(닷넷,자마린,아이폰실습)Xamarin.iOS HelloWorld 실습_멀티화면,화면전환_Xamarin교육/Xamarin강좌
(닷넷,자마린,아이폰실습)Xamarin.iOS HelloWorld 실습_멀티화면,화면전환_Xamarin교육/Xamarin강좌(닷넷,자마린,아이폰실습)Xamarin.iOS HelloWorld 실습_멀티화면,화면전환_Xamarin교육/Xamarin강좌
(닷넷,자마린,아이폰실습)Xamarin.iOS HelloWorld 실습_멀티화면,화면전환_Xamarin교육/Xamarin강좌
 
Meteor React Tutorial 따라하기
Meteor React Tutorial 따라하기Meteor React Tutorial 따라하기
Meteor React Tutorial 따라하기
 
우리가 몰랐던 크롬 개발자 도구
우리가 몰랐던 크롬 개발자 도구우리가 몰랐던 크롬 개발자 도구
우리가 몰랐던 크롬 개발자 도구
 
Show2003
Show2003Show2003
Show2003
 
Jenkins를 활용한 javascript 개발
Jenkins를 활용한 javascript 개발Jenkins를 활용한 javascript 개발
Jenkins를 활용한 javascript 개발
 
[웹기반시스템 3조]e govframe 중간고사 제출 정리
[웹기반시스템 3조]e govframe 중간고사 제출 정리[웹기반시스템 3조]e govframe 중간고사 제출 정리
[웹기반시스템 3조]e govframe 중간고사 제출 정리
 
iOS9 소개
iOS9 소개iOS9 소개
iOS9 소개
 
Sw설계
Sw설계Sw설계
Sw설계
 
조은 - AMP PWA 101 [WSConf.Seoul.2017. Vol.2]
조은 - AMP PWA 101 [WSConf.Seoul.2017. Vol.2]조은 - AMP PWA 101 [WSConf.Seoul.2017. Vol.2]
조은 - AMP PWA 101 [WSConf.Seoul.2017. Vol.2]
 
자마린 iOS 멀티화면 컨트롤러_네비게이션 컨트롤러, 루트 뷰 컨트롤러
자마린 iOS 멀티화면 컨트롤러_네비게이션 컨트롤러, 루트 뷰 컨트롤러자마린 iOS 멀티화면 컨트롤러_네비게이션 컨트롤러, 루트 뷰 컨트롤러
자마린 iOS 멀티화면 컨트롤러_네비게이션 컨트롤러, 루트 뷰 컨트롤러
 
Nest js 101
Nest js 101Nest js 101
Nest js 101
 
Data-binding AngularJS
Data-binding AngularJSData-binding AngularJS
Data-binding AngularJS
 
H3 2011 ios5 새로운 기능들의 프로젝트 적용 사례_ios팀_김윤봉
H3 2011 ios5 새로운 기능들의 프로젝트 적용 사례_ios팀_김윤봉H3 2011 ios5 새로운 기능들의 프로젝트 적용 사례_ios팀_김윤봉
H3 2011 ios5 새로운 기능들의 프로젝트 적용 사례_ios팀_김윤봉
 
H3 2011 iOS5 새로운 기능들의 프로젝트 적용 사례
H3 2011 iOS5 새로운 기능들의 프로젝트 적용 사례H3 2011 iOS5 새로운 기능들의 프로젝트 적용 사례
H3 2011 iOS5 새로운 기능들의 프로젝트 적용 사례
 
(자마린안드로이드예제실습)현재 위치를 얻은 후 지도에 표시하기, GPS다루기, 마시멜로이후 권한 획득방법 구현_추천자마린학원/자마린교육
(자마린안드로이드예제실습)현재 위치를 얻은 후 지도에 표시하기, GPS다루기, 마시멜로이후 권한 획득방법 구현_추천자마린학원/자마린교육(자마린안드로이드예제실습)현재 위치를 얻은 후 지도에 표시하기, GPS다루기, 마시멜로이후 권한 획득방법 구현_추천자마린학원/자마린교육
(자마린안드로이드예제실습)현재 위치를 얻은 후 지도에 표시하기, GPS다루기, 마시멜로이후 권한 획득방법 구현_추천자마린학원/자마린교육
 
[IOS말고 Android] Inflation을 이용하여 부분 Activity 띄우기
[IOS말고 Android] Inflation을 이용하여 부분 Activity 띄우기[IOS말고 Android] Inflation을 이용하여 부분 Activity 띄우기
[IOS말고 Android] Inflation을 이용하여 부분 Activity 띄우기
 
Vue.js 기초 실습.pptx
Vue.js 기초 실습.pptxVue.js 기초 실습.pptx
Vue.js 기초 실습.pptx
 
React Hooks 마법. 그리고 깔끔한 사용기
React Hooks 마법. 그리고 깔끔한 사용기React Hooks 마법. 그리고 깔끔한 사용기
React Hooks 마법. 그리고 깔끔한 사용기
 
React Native를 사용한
 초간단 커뮤니티 앱 제작
React Native를 사용한
 초간단 커뮤니티 앱 제작React Native를 사용한
 초간단 커뮤니티 앱 제작
React Native를 사용한
 초간단 커뮤니티 앱 제작
 

More from Sangon Lee

NoSQL Guide & Sample
NoSQL Guide &  SampleNoSQL Guide &  Sample
NoSQL Guide & SampleSangon Lee
 
Android ndk jni 설치및 연동
Android ndk jni 설치및 연동Android ndk jni 설치및 연동
Android ndk jni 설치및 연동Sangon Lee
 
Android xml parsing
Android xml parsingAndroid xml parsing
Android xml parsingSangon Lee
 
Naver api for android
Naver api for androidNaver api for android
Naver api for androidSangon Lee
 
Android 기초강좌 애플리캐이션 구조
Android 기초강좌 애플리캐이션 구조Android 기초강좌 애플리캐이션 구조
Android 기초강좌 애플리캐이션 구조Sangon Lee
 
번역돋보기 기획서
번역돋보기 기획서번역돋보기 기획서
번역돋보기 기획서Sangon Lee
 
17. cocos2d 기초
17. cocos2d  기초17. cocos2d  기초
17. cocos2d 기초Sangon Lee
 

More from Sangon Lee (10)

NoSQL Guide & Sample
NoSQL Guide &  SampleNoSQL Guide &  Sample
NoSQL Guide & Sample
 
Gcd ppt
Gcd pptGcd ppt
Gcd ppt
 
Android ndk jni 설치및 연동
Android ndk jni 설치및 연동Android ndk jni 설치및 연동
Android ndk jni 설치및 연동
 
Android xml parsing
Android xml parsingAndroid xml parsing
Android xml parsing
 
Naver api for android
Naver api for androidNaver api for android
Naver api for android
 
Android 기초강좌 애플리캐이션 구조
Android 기초강좌 애플리캐이션 구조Android 기초강좌 애플리캐이션 구조
Android 기초강좌 애플리캐이션 구조
 
Facebook api
Facebook apiFacebook api
Facebook api
 
번역돋보기 기획서
번역돋보기 기획서번역돋보기 기획서
번역돋보기 기획서
 
StudyShare
StudyShareStudyShare
StudyShare
 
17. cocos2d 기초
17. cocos2d  기초17. cocos2d  기초
17. cocos2d 기초
 

Storyboard iOS 개발실습예제

  • 1. StoryBoard 구현실습 Develop By S.O.Lab
  • 4. * Use Storyboards check!!!!! * Use Automatic Reference Counting check!!!!!
  • 7. 네비게이션 컨트롤뷰 구조 1. TableViewController 삭제후 View Controller 추가 2. Ctl+드레그 ViewController 위치후 relationship 선택
  • 9. 네비게이션 바 제목추가 1단계 완료 - 구글docs 1단계 “OK”
  • 12. 소개 page 구현 2단계완료 -Docs 2단계 “OK”
  • 16. 메뉴상세 page 구현 3단계완료 * 각각의 메뉴 page 를 구현후 완료 -Docs 3단계 “OK”
  • 18. 위치 page 구현 * 컴파일후 실행시 ERROR !!
  • 21. 위치 page 구현 - (void)viewDidLoad { [super viewDidLoad]; ! // Do any additional setup after loading the view. MKMapView *gmap = [[MKMapView alloc] initWithFrame:self.view.bounds]; // 지도뷰를 만듭니다. 아래 코드없이 바로 추가하면 미국지도가 보이네요. gmap.showsUserLocation = TRUE; // 내위치 표시. 시뮬에이터는 항상 애플본사가 현재 위치로 나옵니다 // gmap.mapType = MKMapTypeHybrid; // 지도인지 위성 사진에 하이브리드로 할지 결정~ MKCoordinateRegion region; MKCoordinateSpan span; // 보여줄 지도가 처리하는 넓이를 정의합니다. 문서 읽어 보시길.. span.latitudeDelta=0.02; // 숫자가 작으면 좁은 영역, 즉 우리동네 자세히~보임 span.longitudeDelta=0.02; CLLocationCoordinate2D location=gmap.userLocation.coordinate; //그래도 블로깅하려고, 우리나라 위도,경도 찾아서 넣었습니다. location.latitude=37.514849; location.longitude=126.954063; region.span=span; //위에서 정한 크기 설정하고 region.center=location; // 위치 설정하고 [gmap setRegion:region animated: TRUE]; // 지도 뷰에 지역을 설정하고 [gmap regionThatFits:region]; [self.view addSubview:gmap]; // 서브 뷰로 지도를 추가해야 보이겠지요!! }
  • 23. 위치 page 구현 - (void)viewDidLoad { [super viewDidLoad]; MKMapView *gmap = [[MKMapView alloc] initWithFrame:self.view.bounds]; gmap.showsUserLocation = TRUE; // 내위치 표시. 시뮬에이터는 항상 애플본사가 현재 위치로 나옵니다 MKCoordinateRegion region; MKCoordinateSpan span; // 보여줄 지도가 처리하는 넓이를 정의합니다. 문서 읽어 보시길.. span.latitudeDelta=0.02; // 숫자가 작으면 좁은 영역, 즉 우리동네 자세히~보임 span.longitudeDelta=0.02; CLLocationCoordinate2D location=gmap.userLocation.coordinate; //그래도 블로깅하려고, 우리나라 위도,경도 찾아서 넣었습니다. //location.latitude=37.514849; //location.longitude=126.954063; location.latitude=35.1655253; location.longitude=129.0721951; //http://map.naver.com/? dlevel=12&lat=35.1655253&lng=129.0721951&searchCoord=129.0721951%3B35.1655253 &type=COORD&tab=1&query=67aA7IKw6rSR7Jet7IucIOu2gOyCsOynhOq1rCDsoITtj6zrj5kgMTItMTY3D& menu=location&mapMode=0&enc=b64 region.span=span; //위에서 정한 크기 설정하고 region.center=location; // 위치 설정하고 [gmap setRegion:region animated: TRUE]; // 지도 뷰에 지역을 설정하고 [gmap regionThatFits:region]; [self.view addSubview:gmap]; // 서브 뷰로 지도를 추가해야 보이겠지요!! }
  • 28. 사진 page 구현 #import <UIKit/UIKit.h> @interface FictureViewController : UIViewController { UIButton *nextBt,*preBt; UIImageView *iV; } @property(strong, nonatomic) UIButton *nextBt,*preBt; @property(strong, nonatomic) UIImageView *iV; @end
  • 29. 사진 page 구현 @implementation FictureViewController @synthesize nextBt,preBt,iV; int imagecount; - (void)viewDidLoad { [super viewDidLoad]; ! // Do any additional setup after loading the view. iV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"1.png"]]; iV.frame = CGRectMake(0, 0, 320, 300); [self.view addSubview:iV]; nextBt = [UIButton buttonWithType:UIButtonTypeRoundedRect]; nextBt.frame =CGRectMake(180, 350, 100, 30); [nextBt setTitle:@"다음사진" forState:UIControlStateNormal]; [nextBt addTarget:self action:@selector(nextBtAction) forControlEvents:UIControlEventTouchUpInside ]; [self.view addSubview:nextBt]; preBt = [UIButton buttonWithType:UIButtonTypeRoundedRect]; preBt.frame =CGRectMake(50, 350, 100, 30); [preBt setTitle:@"이전사진" forState:UIControlStateNormal]; [preBt addTarget:self action:@selector(preBtAction) forControlEvents:UIControlEventTouchUpInside ]; [self.view addSubview:preBt]; imagecount = 1; }
  • 30. 사진 page 구현 -(void) nextBtAction { if(imagecount == 5) { imagecount =0; } imagecount++; NSLog(@"imagecount ==> %d",imagecount); [iV setImage:[UIImage imageNamed:[NSString stringWithFormat:@"%d.png",imagecount]]]; } -(void) preBtAction { if(imagecount == 1) { imagecount = 6; } imagecount--; NSLog(@"imagecount ==> %d",imagecount); [iV setImage:[UIImage imageNamed:[NSString stringWithFormat:@"%d.png",imagecount]]]; }

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n