05-06( )_¾ÆÀÌÆù_ÃÖÁ¾

Similar documents
iOS4_13

2ndWeek_Introduction to iPhone OS.key

Microsoft PowerPoint - 4-UI 애플리케이션

IAP-Guide

캐빈의iOS프로그램팁01

SGIS 오픈플랫폼 지도제공 API 정의 ios Version 1.0 1

Tad_가이드라인

Microsoft PowerPoint - 2-Objective-C 기초

- 목차 - - ios 개발환경및유의사항. - 플랫폼 ios Project. - Native Controller와플랫폼화면연동. - 플랫폼 Web(js)-Native 간데이터공유. - 플랫폼확장 WN Interface 함수개발. - Network Manager clas

PowerPoint 프레젠테이션

iphone 개발자의 SQLite 다루기 개발 Xcode Version : 4.5 작성 서경덕 환경 시뮬레이터 : iphone Simulator 6.0 일시 2013 년 1 월 3 일 시나리오 1. FireFox의플러그인을통해 SQLite파일을맊든다. 2. 어플에서이

텀블러514

(Xcode4.2 의 Choose a template for your new project 화면 ) 2) 라이브러리패널이조금바뀌었습니다. Stepper, Gesture Recognizer 가추가되었습니다. 외형이조금바뀌었지만, 책의내용은그대로사용할수있으므로문제없습니다.

자바 웹 프로그래밍

K&R2 Reference Manual 번역본

iOS의 MKMapView 정리하기

iOS의 GameCenter를 내어플에 붙여보자

Mobile Service > IAP > Android SDK [ ] IAP SDK TOAST SDK. IAP SDK. Android Studio IDE Android SDK Version (API Level 10). Name Reference V

(......).hwp

ch09

5장.key

3ÆÄÆ®-14

Spring Boot/JDBC JdbcTemplate/CRUD 예제

ORANGE FOR ORACLE V4.0 INSTALLATION GUIDE (Online Upgrade) ORANGE CONFIGURATION ADMIN O

신림프로그래머_클린코드.key

찾아보기 Index 기호및숫자!( 논리부정 ) 연산자 31!=( 같지않음 ) 연산자 30 #define #define과전역변수 #import #include %( 나머지연산자 ) 63 ( 토큰참고 ) 159

수업목차 1. Objective-C 기초 (1) Hello World 작성 (2) 기본클래스작성, property 변수, 메소드 (3) Wizard 게임 (4) Island Survival 게임 2. ios 앱프로그래밍기초 (1) Story Board 사용법 - Hel

01-OOPConcepts(2).PDF

untitled

슬라이드 1

05-class.key

09-interface.key

Microsoft PowerPoint - ch09 - 연결형리스트, Stack, Queue와 응용 pm0100

< B0B3C0CEC1A4BAB8BAD0C0EFC1B6C1A4BBE7B7CAC1FD2E687770>

Blog

, ( ),, ( ), 3, int kor[5]; int eng[5]; int Microsoft Windows 4 (ANSI C2 ) int kor[5] 20 # define #define SIZE 20 int a[10]; char c[10]; float

untitled

PowerPoint 프레젠테이션

C++-¿Ïº®Çؼ³10Àå

영상5월_펼침면

내지-2도뻂

DocsPin_Korean.pages

매력적인 맥/iOS 개발 환경 그림 A-1 변경 사항 확인창 Validate Setting... 항목을 고르면 된다. 프로젝트 편집기를 선택했을 때 화면 아 래쪽에 있는 동일한 Validate Settings... 버튼을 클릭해도 된다. 이슈 내비게이터 목록에서 변경할

Chapter 4. LISTS

Vertical Probe Card Technology Pin Technology 1) Probe Pin Testable Pitch:03 (Matrix) Minimum Pin Length:2.67 High Speed Test Application:Test Socket

SIGPLwinterschool2012

¼¼¿ø1024

rmi_박준용_final.PDF

C 언어 프로그래밊 과제 풀이

교육2 ? 그림

歯이시홍).PDF

untitled

3ÆÄÆ®-11

<4D F736F F F696E74202D20B8B6C0CCC5A9B7CEC7C1B7CEBCBCBCAD202834C1D6C2F7207E2038C1D6C2F729>

I T C o t e n s P r o v i d e r h t t p : / / w w w. h a n b i t b o o k. c o. k r

C# Programming Guide - Types

,,,,,, (41) ( e f f e c t ), ( c u r r e n t ) ( p o t e n t i a l difference),, ( r e s i s t a n c e ) 2,,,,,,,, (41), (42) (42) ( 41) (Ohm s law),

특허청구의 범위 청구항 1 헤드엔드로부터 복수의 단위 셀로 구성되며 각 단위 셀에 방송 프로그램 및 편성 시간정보가 상호 매칭되어 설 정된 상기 EPG(Electronic Program Guide)와, 상기 각 단위 셀에 대응하는 방송 프로그램 컨텐츠를 수신하는 통 신

untitled

PowerPoint Presentation

untitled

untitled

slide2

<30342DBCF6C3B3B8AEBDC3BCB33228C3D6C1BE292E687770>

商用

( )부록

03장

Chap 6: Graphs

PowerPoint 프레젠테이션

Sena Technologies, Inc. HelloDevice Super 1.1.0

No Slide Title

[ 융합과학 ] 과학고 R&E 결과보고서 뇌파를이용한곤충제어 연구기간 : ~ 연구책임자 : 최홍수 ( 대구경북과학기술원 ) 지도교사 : 박경희 ( 부산일과학고 ) 참여학생 : 김남호 ( 부산일과학고 ) 안진웅 ( 부산일과학고 )

프로그램을 학교 등지에서 조금이라도 배운 사람들을 위한 프로그래밍 노트 입니다. 저 역시 그 사람들 중 하나 입니다. 중고등학교 시절 학교 도서관, 새로 생긴 시립 도서관 등을 다니며 책을 보 고 정리하며 어느정도 독학으르 공부하긴 했지만, 자주 안하다 보면 금방 잊어

Interstage5 SOAP서비스 설정 가이드

슬라이드 1

Microsoft PowerPoint - 09-Object Oriented Programming-3.pptx

GNU/Linux 1, GNU/Linux MS-DOS LOADLIN DOS-MBR LILO DOS-MBR LILO... 6

(Asynchronous Mode) ( 1, 5~8, 1~2) & (Parity) 1 ; * S erial Port (BIOS INT 14H) - 1 -

10-Java Applet

OOP 소개

API 매뉴얼

History Created adstarsdk Reference Manual cadvanced Digital Chips Inc. All right reserved. No part of this document may be reproduced in a

JUNIT 실습및발표

2007

Microsoft PowerPoint - 07-Data Manipulation.pptx

< B0ADB3BBBFB52E687770>

Microsoft PowerPoint - 12-Custom Classes.pptx

1217 WebTrafMon II

iphone_최종.indb

Modern Javascript

정답-1-판매용

Microsoft PowerPoint - IP11.pptx

휠세미나3 ver0.4

03장.스택.key

PCServerMgmt7

282서비스업관리-마트

Chap04(Signals and Sessions).PDF

Dialog Box 실행파일을 Web에 포함시키는 방법

본 발명은 중공코어 프리캐스트 슬래브 및 그 시공방법에 관한 것으로, 자세하게는 중공코어로 형성된 프리캐스트 슬래브 에 온돌을 일체로 구성한 슬래브 구조 및 그 시공방법에 관한 것이다. 이를 위한 온돌 일체형 중공코어 프리캐스트 슬래브는, 공장에서 제작되는 중공코어 프

13ÀåÃß°¡ºÐ

Transcription:

6 T o u c h i n g t h e i P h o n e S D K 3. 0

6.1

01: -(void) touchesbegan:(nsset * ) touches withevent:(uievent * )event { 02: NSSet * alltouches = [event alltouches]; 03: if ([alltouches count]>1) { 04: [self.nextresponder touchesbegan:touches withevent:event]; 05: } else { 06: // : 07: } 08: } 6.2 touchesbegan:(nsset * )touches withevent:(uievent * )event;

touchesmoved:(nsset * )touches withevent:(uievent * )event

touchesended:(nsset * )touches withevent:(uievent * )event

6.3

<TouchView.h> 01: #import <UIKit/UIKit.h> 02: 03: @interface TouchView : UIView { 04: NSArray * imgviewarray; 05: UILabel * label; 06: } 07: -(void) putfingertips:(nsarray * ) touches remove:(nsset * ) removes; 08: 09: @property (nonatomic, retain) IBOutlet UILabel * label; 10: @end

<TouchView.m> 01: - (id)initwithcoder:(nscoder * )decoder { 02: if (self = [super initwithcoder:decoder]) { 03: UIImage * imgball = [[UIImage alloc] initwithcontentsoffile: [[NSBundle mainbundle] pathforresource:@ Mark oftype:@ png ]]; 04: imgviewarray = [[NSArray arraywithobjects: 05: [[UIImageView alloc] initwithimage:imgball], 06: [[UIImageView alloc] initwithimage:imgball], 07: [[UIImageView alloc] initwithimage:imgball], 08: [[UIImageView alloc] initwithimage:imgball], 09: [[UIImageView alloc] initwithimage:imgball],nil 10: ] retain]; 11: [imgball release]; 12: for (UIImageView * imgview in imgviewarray) { 13: [imgview sethidden:yes]; 14: [imgview setuserinteractionenabled:no]; 15: [self addsubview:imgview]; 16: } 17: } 18: return self; 19: } 20: - (void)touchesbegan:(nsset * )touches withevent:(uievent * )event { 21: [self putfingertips:[[event alltouches] allobjects] remove:nil]; 22: label.text = [NSString stringwithformat:@ Began:%d (total:%d touch), 23: [touches count],[[event alltouches]count]]; 24: } 25: - (void)touchescancelled:(nsset * )touches withevent:(uievent * )event { 26: [self putfingertips:nil remove:nil]; 27: label.text = [NSString stringwithformat:@ Cancelled:%d (total%d touch), 28: [touches count],[[event alltouches]count]]; 29: } 30: - (void)touchesended:(nsset * )touches withevent:(uievent * )event { 31: [self putfingertips:[[event alltouches] allobjects] remove:touches]; 32: label.text = [NSString stringwithformat:@ Ended:%d (total:%d touch), 33: [touches count],[[event alltouches]count]]; 34: } 35: - (void)touchesmoved:(nsset * )touches withevent:(uievent * )event { 36: [self putfingertips:[[event alltouches] allobjects] remove:nil]; 37: label.text = [NSString stringwithformat:@ Moved:%d (total:%d touch), 38: [touches count],[[event alltouches]count]]; 39: }

40: -(void) putfingertips:(nsarray * ) touches remove:(nsset * ) removes { 41: for (int i=0;i<[imgviewarray count];i++) { 42: [[imgviewarray objectatindex:i] sethidden:yes]; 43: if (i < [touches count]) { 44: if ([removes containsobject:[touches objectatindex:i]]) { 45: } else { 46: [[imgviewarray objectatindex:i] sethidden:no]; 47: [[imgviewarray objectatindex:i] setcenter: [[touches objectatindex:i] locationinview:self]]; 48: } 49: } 50: } 51: }

<TouchView.m> 01: - (void)touchesbegan:(nsset * )touches withevent:(uievent * )event { 02: [self putfingertips:[[event alltouches] allobjects] remove:nil]; 03: int tapcount = [[touches anyobject] tapcount]; 04: if ( tapcount > 1) { 05: labeltap.text = [NSString stringwithformat:@ Tabbed : %d,tapcount]; 06: } else { 07: labeltap.text = nil; 08: }

09: label.text = [NSString stringwithformat:@ Began:%d (total:%d touch), 10: [touches count],[[event alltouches]count]]; 11: } 12: - (void)touchesended:(nsset * )touches withevent:(uievent * )event { 13: [self putfingertips:[[event alltouches] allobjects] remove:touches]; 14: label.text = [NSString stringwithformat:@ Ended:%d (total:%d touch), 15: [touches count],[[event alltouches]count]]; 16: int tapcount = [[touches anyobject] tapcount]; 17: if ( tapcount == 2) { 18: //. 19: [self performselector:@selector(showallcircles) withobject:nil afterdelay:0.3]; 20: NSLog(@ Scheduled ); 21: } 22: }

01: - (void)touchesbegan:(nsset * )touches withevent:(uievent * )event { 02:...... 03: if (tapcount > 2) { 04: [UIView cancelpreviousperformrequestswithtarget:self]; 05: NSLog(@ Cancelled ); 06: } 07: }

6.5 <TouchView.m> 01: - (void)touchesbegan:(nsset * )touches withevent:(uievent * )event { 02:...... 03: // (.) 04: if ([[event alltouches] count]==1) { 05: startpoint = [[touches anyobject] locationinview:self]; 06: mayswiped = YES; 07: } else { 08: mayswiped = NO; 09: } 10: } 11: #define kswipe_vert_threshold 5 12: #define kswipe_horz_threshold 30 13: 14: - (void)touchesmoved:(nsset * )touches withevent:(uievent * )event { 15: 16: // ( )

17: if (mayswiped) { 18: CGPoint point = [[touches anyobject] locationinview:self]; 19: //? 20: if ( fabsf( point.x - startpoint.x ) > kswipe_horz_threshold ) { 21: //? 22: if ( fabsf( point.y - startpoint.y ) < kswipe_vert_threshold) { 23: [self performselector:@selector(showallcircles) withobject:nil afterdelay:0.3]; 24: NSLog(@ Scheduled ); 25: } 26: } 27: } 28: } 31: - (void)touchesended:(nsset * )touches withevent:(uievent * )event { 32:...... 33: // 34: mayswiped = NO; 35: }

01: - (void)touchesbegan:(nsset * )touches withevent:(uievent * )event { 02:...... 03: if ([[event alltouches] count]==2) { 04: CGPoint pta = [ [[[event alltouches] allobjects] objectatindex:0] locationinview:self]; 05: CGPoint ptb = [ [[[event alltouches] allobjects] objectatindex:1] locationinview:self]; 06: distance = [self distancetwopoint:pta to:ptb]; 07: } 08: } 10: - (void)touchesmoved:(nsset * )touches withevent:(uievent * )event { 11:...... 12: if ([[event alltouches] count]==2) { 13: CGPoint pta = [ [[[event alltouches] allobjects] objectatindex:0] locationinview:self]; 14: CGPoint ptb = [ [[[event alltouches] allobjects] objectatindex:1] locationinview:self]; 15: float newdistance = [self distancetwopoint:pta to:ptb]; 16: if (distance==0) { 17: distance = newdistance; 18: } else if ( (newdistance - distance) > kpinch_threshold ) { 19: NSLog(@ ZoomIn ); 20: } else if ( (distance - newdistance) > kpinch_threshold ) { 21: NSLog(@ ZoomOut ); 22: } 23: } 24: } 25: - (void)touchescancelled:(nsset * )touches withevent:(uievent * )event { 26:...... 27: distance = 0; 28: } 29: 30: - (void)touchesended:(nsset * )touches withevent:(uievent * )event { 31:...... 32: distance = 0; 33: }

6.6

<FrameViewController.h> 01: #import <UIKit/UIKit.h> 02: 03: @interface FrameViewController : UIViewController <UIScrollViewDelegate> { 04: NSUndoManager * undomanager; 05: float oldzoom; 06: 07: UIImageView * imgview; 08: UIScrollView * scrlview; 09: } 10: 11: -(void) updatezoom:(nsnumber * )param; 12: 13: @property (nonatomic, retain) NSUndoManager * undomanager; 14: @property (nonatomic, retain) IBOutlet UIImageView * imgview; 15: @property (nonatomic, retain) IBOutlet UIScrollView * scrlview; 16: 17: @end <FrameViewController.m> 01: -(NSUndoManager * ) undomanager { 02: if (undomanager==nil) { 03: undomanager = [[NSUndoManager alloc] init]; 04: [undomanager setlevelsofundo:3]; 05: } 06: return undomanager; 07: }

08: - (void)scrollviewdidendzooming:(uiscrollview * )scrollview withview:(uiview * )view atscale:(float)scale { 09: if (scrollview.zoomscale!= oldzoom) { 10: [self updatezoom:[nsnumber numberwithfloat:scrollview.zoomscale]]; 11: } 12: [self becomefirstresponder]; 13: } 14: - (BOOL)canBecomeFirstResponder { 15: return YES; 16: } 17: -(void) updatezoom:(nsnumber * )param { 18: 19: scrlview.zoomscale = [param floatvalue]; 20: 21: [self.undomanager registerundowithtarget:self selector: @selector(updatezoom:) object:[nsnumber numberwithfloat:oldzoom]]; 22: if (![self.undomanager isundoing]) { 23: if (oldzoom < scrlview.zoomscale) 24: [self.undomanager setactionname:@ ]; 25: else 26: [self.undomanager setactionname:@ ]; 27: } 28: oldzoom = scrlview.zoomscale; 29: }

<FrameAppDelegate.m> 01: - (void)applicationdidfinishlaunching:(uiapplication * )application { 02: 03: application.applicationsupportsshaketoedit = YES; 04: 05: // Override point for customization after app launch 06: [window addsubview:viewcontroller.view]; 07: [window makekeyandvisible]; 08: }

6.7

<MyTextField.h> 01: #import <UIKit/UIKit.h> 02: 03: @interface MyTextField : UITextField { 04: 05: } 06: @end <CopyPasteViewController.m> 01: -(IBAction) onmenu { 02: if ([text becomefirstresponder]) { 03: UIMenuController * mc = [UIMenuController sharedmenucontroller]; 04: [mc settargetrect:cgrectzero inview:text]; 05: if (!mc.menuvisible) 06: [mc setmenuvisible:yes animated:yes]; 07: } 08: }

09: -(IBAction) onwrite { 10: UIPasteboard * board = [UIPasteboard generalpasteboard]; 11: board.string = @ TEST. ; 12: } 13: 14: -(IBAction) onclear { 15: UIPasteboard * board = [UIPasteboard generalpasteboard]; 16: board.items = nil; 17: } < MyTextField.m> 01: - (BOOL)canPerformAction:(SEL)action withsender:(id)sender { 02: NSLog(@ canperformaction:%s,action); 03: return [super canperformaction:action withsender:sender]; 04: }

[Session started at 2009-05-05 01:16:26 +0900.] 2009-05-05 01:16:32.054 [22969:20b] canperformaction:cut: 2009-05-05 01:16:32.055 [22969:20b] canperformaction:copy: 2009-05-05 01:16:32.055 [22969:20b] canperformaction:select: 2009-05-05 01:16:32.056 [22969:20b] canperformaction:selectall: 2009-05-05 01:16:32.056 [22969:20b] canperformaction:paste: 2009-05-05 01:16:32.056 [22969:20b] canperformaction:_setrtoltextdirection: 2009-05-05 01:16:32.057 [22969:20b] canperformaction:_setltortextdirection: 01: - (void)select:(id)sender { 02: [super select:sender]; 03: } 04: - (void)selectall:(id)sender { 05: [super selectall:sender]; 06: } 07: - (void)cut:(id)sender { 08: [super cut:sender]; 09: UIPasteboard * board = [UIPasteboard generalpasteboard]; 10: NSLog(@ cut : %@,board.string); 11: } 12: - (void)copy:(id)sender { 13: [super copy:sender]; 14: UIPasteboard * board = [UIPasteboard generalpasteboard]; 15: NSLog(@ copied : %@,board.string); 16: } 17: - (void)paste:(id)sender { 18: UIPasteboard * board = [UIPasteboard generalpasteboard]; 19: NSLog(@ pasted : %@,board.string); 20: [super paste:sender]; 21: }

6.8