High Performance IOS Apps : Optimize Your Code for Better Apps
معرفی کتاب «High Performance IOS Apps : Optimize Your Code for Better Apps» نوشتهٔ Vaish, Gaurav، منتشرشده توسط نشر O'Reilly Media در سال 2016. این کتاب در 4 صفحه، فرمت pdf، زبان انگلیسی ارائه شده است. «High Performance IOS Apps : Optimize Your Code for Better Apps» در دستهٔ بدون دستهبندی قرار دارد.
You may already have an amazing iOS app, or be developing one. Everything looks great except for some kinks that prohibit users from giving the app that final fifth star or prevent you from releasing it. Issues like a jitter when the user goes to the nth item in table view or the app hogging the network or consuming a lot battery are some of the visible symptoms that the user will be aware of. Howrever, the problems lie somewhere deeper. Tuning an app for performance is a never-ending task, especially with new app features, OS versions, third-party libraries, and device configurations. These are only some of the things that keep developers on their toes about app performance. According to a study, about a quarter of users abandon an app if it does not load within 3 seconds, and about a third of users will tell others about their poor experience. Users want apps that are fast, responsive, and do not hog resources. This book takes a look at various aspects that negatively impact use and outlines how you can tune your app for performance. Copyright 4 Table of Contents 7 Preface 15 Who Should Read This Book 15 Why I Wrote This Book 16 Navigating This Book 16 Online Resources 17 Conventions Used in This Book 17 Using Code Examples 18 Safari® Books Online 19 How to Contact Us 19 Acknowledgments 20 Part I. Getting Started 21 Chapter 1. Performance in Mobile Apps 23 Defining Performance 23 Performance Metrics 24 Memory 24 Power Consumption 24 Initialization Time 24 Execution Speed 25 Responsiveness 25 Local Storage 26 Interoperability 27 Network Condition 28 Bandwidth 29 Data Refresh 29 Multiuser Support 29 Single Sign-on 31 Security 31 Crashes 31 App Profiling 32 Sampling 32 Instrumentation 32 Measurement 32 Project and Code Setup 33 Crash Reporting Setup 34 Instrumenting Your App 35 Logging 40 Summary 43 Part II. Core Optimizations 45 Chapter 2. Memory Management 47 Memory Consumption 48 Stack Size 48 Heap Size 49 Memory Management Model 52 Autoreleasing Objects 54 Autorelease Pool Blocks 55 Automatic Reference Counting 59 Rules of ARC 61 Reference Types 62 Variable Qualifiers 63 Property Qualifiers 64 Getting Your Hands Dirty 65 Photo Model 65 Storyboard Update 66 Method Implementations 67 Output Analysis 69 Zombies 70 Rules of Memory Management 71 Retain Cycles 72 Rules to Avoid Retain Cycles 73 Common Scenarios for Retain Cycles 74 Observers 87 Returning Errors 90 Weak Type: id 91 Solution to the Problem 92 Object Longevity and Leaks 94 Singletons 94 Finding Mystery Retains 97 Best Practices 98 Memory Usage in Production 99 Summary 100 Chapter 3. Energy 101 CPU 101 Network 103 Location Manager and GPS 107 Optimal Initialization 109 Turn Off Inessential Features 110 Use Network Only If Essential 112 Background Location Services 112 NSTimers, NSThreads, and Location Services 113 Restart After App Kill 113 Screen 114 Animation 114 Video Play 114 Multiple Screens 114 Other Hardware 119 Battery Level and State-Aware Code 120 Profiling for Energy Use 122 Best Practices 123 Summary 126 Chapter 4. Concurrent Programming 127 Threads 127 The Cost of Threads 128 Kernel Data Structures 128 Stack Size 128 Creation Time 129 GCD 129 Operations and Queues 130 Thread-Safe Code 132 Atomic Properties 132 Synchronized Blocks 133 Locks 135 Use Reader–Writer Locks for Concurrent Reads and Writes 141 Use Immutable Entities 143 Have a Central State Updater Service 148 State Observers and Notifications 154 Prefer Async over Sync 159 Summary 161 Part III. iOS Performance 163 Chapter 5. Application Lifecycle 165 App Delegate 165 Application Launch 167 First Launch 170 Cold Start 178 Warm Launch 186 Launch After Upgrade 189 Push Notifications 189 Remote Notifications 189 Local Notifications 193 Background Fetch 194 Summary 197 Chapter 6. User Interface 199 View Controller 201 View Load 203 View Hierarchy 204 View Visibility 207 View 209 UILabel 211 UIButton 212 UIImageView 214 UITableView 215 UIWebView 219 Custom Views 223 Auto Layout 230 Size Classes 232 New Interaction Features in iOS 8 237 Interactive Notifications 237 App Extensions 238 Summary 242 Chapter 7. Network 243 Metrics and Measurement 243 DNS Lookup Time 244 SSL Handshake Time 246 Network Type 247 Latency 254 Networking API 257 App Deployment 258 Servers 258 Request 259 Data Format 260 Tools 261 Network Link Conditioner 261 AT&T Application Resource Optimizer 263 Charles 265 Summary 268 Chapter 8. Data Sharing 271 Deep Linking 272 Pasteboards 278 Sharing Content 281 Document Interaction 282 Activities 291 iOS 8 Extensions 294 Configuration for Action and Share Extensions 296 Action Extensions 297 Share Extensions 298 Document Provider Extension 301 App Groups 307 Summary 309 Chapter 9. Security 311 App Access 312 Anonymous Access 312 Authenticated Access 314 Network Security 319 Use HTTPS 319 Use Certificate Pinning 320 Local Storage 325 Data Sharing 332 Security and App Performance 332 Checklist 333 Summary 335 Part IV. Beyond Code 337 Chapter 10. Testing and Release 339 Test Types 339 Definitions 340 Unit Testing 341 Setup 341 Writing Unit Tests 343 Code Coverage 345 Asynchronous Operations 350 Xcode 6 Bonus: Performance Unit Tests 351 Dependency Mocking 353 Other Frameworks 357 Functional Testing 358 Setup 359 Writing Functional Tests 361 Project Structure 364 Dependency Isolation 365 Testing and Component Design 367 Continuous Integration and Automation 369 Best Practices 371 Performance Testing 372 Summary 375 Chapter 11. Tools 377 Accessibility Inspector 378 Xcode Accessibility Inspector 379 iOS Accessibility Inspector 380 Instruments 383 Using Instruments 384 Activity Monitor 387 Allocations 389 Leaks 392 Network 394 Time Profiler 394 Xcode View Debugger 395 PonyDebugger 397 Charles 402 Summary 408 Chapter 12. Instrumentation and Analytics 409 Vocabulary 410 Instrumentation 411 Planning 412 Implementation 415 Deployment 418 Analytics 418 Real User Monitoring 419 Analytics Versus Real User Monitoring 419 Using RUM 419 Summary 420 Part V. iOS 9 421 Chapter 13. iOS 9 423 Application Lifecycle 423 Universal Links 424 Search 427 Search Best Practices 432 User Interface 434 UIKit Framework 434 Safari Services Framework 438 Extensions 441 Content Blocker Extension 442 Spotlight Index Extension 446 App Thinning 446 Slicing 447 On Demand Resources 447 Bitcode 451 Summary 452 Index 453 About the Author 463 Colophon 463 Ready to build mobile apps that out-perform the rest? If you're an iOS developer with app-building experience, this practical guide provides tips and best practices to help you solve many common performance issues. You'll learn how to design and optimize iOS apps that deliver a smooth experience even when the network is poor and memory is low. Today's picky users want fast and responsive apps that don't hog resources. In this book, author Gaurav Vaish demonstrates methods for writing optimal code from an engineering perspective, using reusable Objective-C code that you can use right away. Up your game and create high-performance native iOS apps that truly stand out from the crowd. Measure key performance indicators—attributes that constitute and affect app performance Write efficient apps by minimizing memory and power consumption, and explore options for using available CPU cores Optimize your app's lifecycle and UI, as well as its networking, data sharing, and security features Learn about application testing, debugging and analysis tools, and monitoring your app in the wild Collect data from real users to analyze app usage, identify bottlenecks, and provide fixes Use iOS 9 upgrades to improve your app's performance Now that more people spend more time interacting with mobile apps than with their desktop counterparts, you need to think about your iOS app's performance the moment you write your first line of code. This practical hands-on guide shows you how. Through specific and concise tips for designing and optimizing your apps, author Gaurav Vaish provides solutions to many common performance scenarios, including reusable code that you can put to work right away
دانلود کتاب High Performance IOS Apps : Optimize Your Code for Better Apps