SlideShare une entreprise Scribd logo
1  sur  26
iOS                                    DIY
         shaokun@kudelabs.com
      http://t.sina.com.cn/shaokunwu
•                Three20


    • Facebook      iPhone


    •
    • Facebook, Flickr, Tweetie, Gowalla...
    • https://github.com/facebook/three20
•
•
•
• DIY
•
•
•
•
UIImagePickerControllerDelegate
• Camera
 •   UIImagePickerControllerSourceTypeCamera




• Photo Library
• UIImagePickerControllerDelegate
“In software engineering, the delegation pattern is a design pattern in object-oriented
programming where an object, instead of performing one of its stated tasks, delegates
that task to an associated helper object.” -- wikipedia



      •    - imagePickerController:didFinishPickingMediaWithInfo:

      •    - imagePickerControllerDidCancel:

      •    - imagePickerController:didFinishPickingImage:editingInfo:
           Deprecated in iOS 3.0
YourController.h
YourController.m
Original, Large, Medium, Small, Thumbnail...
Why?
•                       1600 * 1200
                                        Type        RAM
•   32-bit
                                        iPhone     128 MB
    •   width * height * (32 / 8) =
                                      iPhone 3G    128 MB
    •   1600 * 1200 * 4 =
                                      iPhone 3GS   256 MB
        7,680,000 = ~8 MB

•         Application
                                       iPhone 4    512 MB
             (10~20 MB?)
•           Categories                UIImage

    •   @Interface UIImage (Resize)



•   by Trevor Harmon

•   http://vocaro.com/trevor/blog/2009/10/12/resize-a-uiimage-
    the-right-way/
UIImage converted to NSData, Documents Directory
• UIImage                              NSData

    •   NSData *imageData = UIImagePNGRepresentation(image);


    •   NSData *imageData = UIImageJPEGRepresentation(image);



•                Application            Documents

    •          iOS 3.1.3   build               Documents
(void)saveImageToFile
•   SaveImageToFile


•
    •   NSInvocationOperation

    •   NSOperationQueue

    •   [NSOperationQueue sharedOperationQueue];
@interface NSOperationQueue (SharedQueue)
Grid View & Browser
GridView.h



GridView.m
•   GridView *gridView = [[GridView new] initWithCols:4 size:75 margin:4];


•   [gridView addSubView:imageView];
•
    •   UIScrollView           UIImageView


    •            UIImageView     x
•
    •   UIScrollView                UIImageView


    •        UIScrollView


        •   maximumZoomScale, minimumZoomScale, zoomScale


    •   Implement UIScrollViewDelegate         UIImageView


        •   - (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView
UIScrollView inside UIScrollView
Thank You!

Contenu connexe

Similaire à iOS 图片浏览器 DIY

HTML5 로 iPhone App 만들기
HTML5 로 iPhone App 만들기HTML5 로 iPhone App 만들기
HTML5 로 iPhone App 만들기JungHyuk Kwon
 
Xcodeを用いた iPhone/iPadアプリ開発
Xcodeを用いた iPhone/iPadアプリ開発Xcodeを用いた iPhone/iPadアプリ開発
Xcodeを用いた iPhone/iPadアプリ開発一樹 濱崎
 
Xcodeを用いたiPhone/iPadアプリ開発
Xcodeを用いたiPhone/iPadアプリ開発Xcodeを用いたiPhone/iPadアプリ開発
Xcodeを用いたiPhone/iPadアプリ開発ashphy
 
WP7, Droid, iPhone, Oh my!
WP7, Droid, iPhone, Oh my!WP7, Droid, iPhone, Oh my!
WP7, Droid, iPhone, Oh my!Chris Hardy
 
みゆっき☆Think#4 「こんどはiPhoneに触ってみるよ!」
みゆっき☆Think#4 「こんどはiPhoneに触ってみるよ!」みゆっき☆Think#4 「こんどはiPhoneに触ってみるよ!」
みゆっき☆Think#4 「こんどはiPhoneに触ってみるよ!」techtalkdwango
 
Building VR Applications For Google Cardboard
Building VR Applications For Google CardboardBuilding VR Applications For Google Cardboard
Building VR Applications For Google CardboardMark Billinghurst
 
打造你的第一個iPhone APP
打造你的第一個iPhone APP打造你的第一個iPhone APP
打造你的第一個iPhone APP彼得潘 Pan
 
Luke Wroblewski: Mobile First
Luke Wroblewski: Mobile FirstLuke Wroblewski: Mobile First
Luke Wroblewski: Mobile FirstWebExpo
 
Building the windows 8 community app
Building the windows 8 community appBuilding the windows 8 community app
Building the windows 8 community appbartlannoeye
 
iOS Game Development With UIKit
iOS Game Development With UIKitiOS Game Development With UIKit
iOS Game Development With UIKitMartin Grider
 
Mono for .NET Developers
Mono for .NET DevelopersMono for .NET Developers
Mono for .NET Developersjeffz
 
俺的Objective-C勉強法
俺的Objective-C勉強法俺的Objective-C勉強法
俺的Objective-C勉強法Naoya Sangu
 
“JavaScriptだけで作れる”からこそTitanium Moduleで Tiを256倍活用する!
“JavaScriptだけで作れる”からこそTitanium Moduleで Tiを256倍活用する!“JavaScriptだけで作れる”からこそTitanium Moduleで Tiを256倍活用する!
“JavaScriptだけで作れる”からこそTitanium Moduleで Tiを256倍活用する!Masato Kitao
 
Hacking and Securing iOS Apps : Part 1
Hacking and Securing iOS Apps : Part 1Hacking and Securing iOS Apps : Part 1
Hacking and Securing iOS Apps : Part 1Subhransu Behera
 
スマートフォンサイトの作成術 - 大川洋一
スマートフォンサイトの作成術 - 大川洋一スマートフォンサイトの作成術 - 大川洋一
スマートフォンサイトの作成術 - 大川洋一okyawa
 
Appcelerator Titanium Intro
Appcelerator Titanium IntroAppcelerator Titanium Intro
Appcelerator Titanium IntroNicholas Jansma
 

Similaire à iOS 图片浏览器 DIY (20)

HTML5 로 iPhone App 만들기
HTML5 로 iPhone App 만들기HTML5 로 iPhone App 만들기
HTML5 로 iPhone App 만들기
 
Xcodeを用いた iPhone/iPadアプリ開発
Xcodeを用いた iPhone/iPadアプリ開発Xcodeを用いた iPhone/iPadアプリ開発
Xcodeを用いた iPhone/iPadアプリ開発
 
Applebu
ApplebuApplebu
Applebu
 
Applebu
ApplebuApplebu
Applebu
 
Xcodeを用いたiPhone/iPadアプリ開発
Xcodeを用いたiPhone/iPadアプリ開発Xcodeを用いたiPhone/iPadアプリ開発
Xcodeを用いたiPhone/iPadアプリ開発
 
WP7, Droid, iPhone, Oh my!
WP7, Droid, iPhone, Oh my!WP7, Droid, iPhone, Oh my!
WP7, Droid, iPhone, Oh my!
 
みゆっき☆Think#4 「こんどはiPhoneに触ってみるよ!」
みゆっき☆Think#4 「こんどはiPhoneに触ってみるよ!」みゆっき☆Think#4 「こんどはiPhoneに触ってみるよ!」
みゆっき☆Think#4 「こんどはiPhoneに触ってみるよ!」
 
Building VR Applications For Google Cardboard
Building VR Applications For Google CardboardBuilding VR Applications For Google Cardboard
Building VR Applications For Google Cardboard
 
打造你的第一個iPhone APP
打造你的第一個iPhone APP打造你的第一個iPhone APP
打造你的第一個iPhone APP
 
Luke Wroblewski: Mobile First
Luke Wroblewski: Mobile FirstLuke Wroblewski: Mobile First
Luke Wroblewski: Mobile First
 
Web app
Web appWeb app
Web app
 
Web app
Web appWeb app
Web app
 
Building the windows 8 community app
Building the windows 8 community appBuilding the windows 8 community app
Building the windows 8 community app
 
iOS Game Development With UIKit
iOS Game Development With UIKitiOS Game Development With UIKit
iOS Game Development With UIKit
 
Mono for .NET Developers
Mono for .NET DevelopersMono for .NET Developers
Mono for .NET Developers
 
俺的Objective-C勉強法
俺的Objective-C勉強法俺的Objective-C勉強法
俺的Objective-C勉強法
 
“JavaScriptだけで作れる”からこそTitanium Moduleで Tiを256倍活用する!
“JavaScriptだけで作れる”からこそTitanium Moduleで Tiを256倍活用する!“JavaScriptだけで作れる”からこそTitanium Moduleで Tiを256倍活用する!
“JavaScriptだけで作れる”からこそTitanium Moduleで Tiを256倍活用する!
 
Hacking and Securing iOS Apps : Part 1
Hacking and Securing iOS Apps : Part 1Hacking and Securing iOS Apps : Part 1
Hacking and Securing iOS Apps : Part 1
 
スマートフォンサイトの作成術 - 大川洋一
スマートフォンサイトの作成術 - 大川洋一スマートフォンサイトの作成術 - 大川洋一
スマートフォンサイトの作成術 - 大川洋一
 
Appcelerator Titanium Intro
Appcelerator Titanium IntroAppcelerator Titanium Intro
Appcelerator Titanium Intro
 

Dernier

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 

Dernier (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 

iOS 图片浏览器 DIY

  • 1. iOS DIY shaokun@kudelabs.com http://t.sina.com.cn/shaokunwu
  • 2. Three20 • Facebook iPhone • • Facebook, Flickr, Tweetie, Gowalla... • https://github.com/facebook/three20
  • 3.
  • 7. • Camera • UIImagePickerControllerSourceTypeCamera • Photo Library
  • 8. • UIImagePickerControllerDelegate “In software engineering, the delegation pattern is a design pattern in object-oriented programming where an object, instead of performing one of its stated tasks, delegates that task to an associated helper object.” -- wikipedia • - imagePickerController:didFinishPickingMediaWithInfo: • - imagePickerControllerDidCancel: • - imagePickerController:didFinishPickingImage:editingInfo: Deprecated in iOS 3.0
  • 11. Original, Large, Medium, Small, Thumbnail...
  • 12. Why? • 1600 * 1200 Type RAM • 32-bit iPhone 128 MB • width * height * (32 / 8) = iPhone 3G 128 MB • 1600 * 1200 * 4 = iPhone 3GS 256 MB 7,680,000 = ~8 MB • Application iPhone 4 512 MB (10~20 MB?)
  • 13. Categories UIImage • @Interface UIImage (Resize) • by Trevor Harmon • http://vocaro.com/trevor/blog/2009/10/12/resize-a-uiimage- the-right-way/
  • 14. UIImage converted to NSData, Documents Directory
  • 15. • UIImage NSData • NSData *imageData = UIImagePNGRepresentation(image); • NSData *imageData = UIImageJPEGRepresentation(image); • Application Documents • iOS 3.1.3 build Documents
  • 17. SaveImageToFile • • NSInvocationOperation • NSOperationQueue • [NSOperationQueue sharedOperationQueue];
  • 19. Grid View & Browser
  • 21. GridView *gridView = [[GridView new] initWithCols:4 size:75 margin:4]; • [gridView addSubView:imageView];
  • 22. • UIScrollView UIImageView • UIImageView x
  • 23. • UIScrollView UIImageView • UIScrollView • maximumZoomScale, minimumZoomScale, zoomScale • Implement UIScrollViewDelegate UIImageView • - (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView
  • 25.

Notes de l'éditeur

  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