19 мар. 2015 г.

Programming iOS 8 Dive Deep into Views, View Controllers, and Frameworks

Programming iOS 8



Start building apps for iOS 8 with Apple’s Swift programming language. If you’re grounded in the basics of Xcode and the Cocoa framework, this book provides a structured explanation of all essential real-world iOS app components. Through deep exploration and copious code examples, you’ll learn how to create views, manipulate view controllers, and use iOS frameworks for adding features such as audio and video, access to user calendars and photos, and tracking the device’s location.

Example code is available on GitHub in the form of full projects that you can download, study, and run.
-Build iOS apps with Swift
-Create, arrange, draw, layer, and animate views that respond to touch
-Use view controllers to manage multiple screens in a way that’s understandable to users
-Explore UIKit interface objects, such as scroll views, table views, popovers, web views, and maps
-Work with Cocoa frameworks for sensors, location, sound, and video
-Access user libraries: music, photos, address book, and calendar
-Examine additional topics including data storage, file sharing, networking, and threading

Topics new to iOS 8 include:
-Major changes in app coordinate space and interface rotation
-Trait collections and size classes
-View margins, visual effect views, and major animation changes
-Changes to presented view controllers, popovers and split view controllers, alert and action sheet architecture
-Table view automatic variable row heights and sliding cells
-Classes for search results display, web view, video display, and audio mixing and effects
-Today extensions, Actions extensions, Photo Editing extensions
-Xcode 6 features: conditional constraints, view debugging, designable views, inspectable properties, new segue types

By: Matt Neuburg
Publisher: O'Reilly Media
Formats: Ebook (epub)
Ebook: November 2014
Pages: 1018

Анимация UITextField, проверка на число / UITextField not number animation

Проверка UITextField на числовой тип (float) и простая анимация если введенные данные не являются таковыми.




// Проверка введенных данных на числовую форму

- (void)textIsValidValue:(NSString *)text textField:(UITextField *)textField {
    
    BOOL result = NO;
    NSScanner *scanner = [NSScanner scannerWithString:text];
    
    if (!(result = [scanner scanFloat:NULL] && [scanner isAtEnd])) {
        
        _isWrongText = YES;
        [self animateTextFieldOnError:textField];
    
    } else { _isWrongText = NO; }

}


// Анимация поля и смена цвета текста если обнаружена ошибка

- (void)animateTextFieldOnError:(UITextField *)textField {
    
    CAKeyframeAnimation * anim = [CAKeyframeAnimation animationWithKeyPath:@"transform"];
    anim.values = @[[NSValue valueWithCATransform3D:CATransform3DMakeTranslation(-10.0f, 0.0f, 0.0f)],
                    [NSValue valueWithCATransform3D:CATransform3DMakeTranslation(10.0f, 0.0f, 0.0f)]];
    anim.autoreverses = YES;
    anim.repeatCount = 2.0f;
    anim.duration = 0.1f;
    
    [textField.layer addAnimation:anim forKey:nil];
    textField.textColor = [UIColor redColor];
}

18 мар. 2015 г.

Beginning iOS Media App Development

Beginning iOS Media App Development is a ground-breaking tutorial that explores the near limitless, programmable audio-visual capabilities of the iPhone, iPad and iPod touch using real-world examples and thorough explanations of the code. This book includes detailed step-by-step instructions and important background information from experienced media and utility app developer, Ahmed Bakir.

You'll learn about content creation, playback, and advanced topics, including AirPlay, AVKit, and Swift introducing. Each chapter is framed with a project that illustrates the concepts being discussed and pulls in lessons from other popular apps. You'll even learn about the latest iOS 8 and Xcode 6 media features.

Publisher: Apress
By: Ahmed Bakir
ISBN: 978-1-4302-5083-8
Year: 2014
Pages: 436
Language: English
File size: 14 MB
File format: PDF

Learn iOS 8 App Development, 2nd Edition

Learn iOS 8 App Development is both a rapid tutorial and a useful reference. You'll quickly get up to speed with Swift, Cocoa Touch, and the iOS 8 SDK. It's an all-in-one getting started guide to building useful apps. You'll learn best practices that ensure your code will be efficient and perform well, earning positive reviews on the iTunes App Store, and driving better search results and more revenue.

The iOS 8 SDK offers powerful new features, and this book is the fastest path to mastering them - and the rest of the iOS SDK - for programmers with some experience who are new to iPhone and iPad app development. Many books introduce the iOS SDK, but few explain how to develop apps optimally and soundly. This book teaches both core Swift language concepts and how to exploit design patterns and logic with the iOS SDK, based on Swift and the Cocoa Touch framework.

Publisher: Apress
By: James Bucanek
ISBN: 978-1-484202-09-8
Year: 2014
Pages: 768
Language: English
File size: 31.1 MB
File format: PDF

16 мар. 2015 г.

Swift Development with Cocoa


Ready to build apps for iPhone, iPad, and Mac now that Swift has landed? If you're an experienced programmer who's never touched Apple developer tools, this hands-on book shows you how to use the Swift language to make incredible iOS 8 and OS X apps, using Cocoa and Cocoa Touch.

Learn how to use Swift in a wide range of real-world situations, with Cocoa features such as Event Kit and Core Animation. You'll pick up Swift language features and syntax along the way, and understand why using Swift (instead of Objective-C) makes iOS and Mac app development easier, faster, and safer. You'll also work with several exercises to help you practice as you learn.

Publisher: O'Reilly Media
By: Jonathon Manning, Paris Buttfield-Addison, Tim Nugent
ISBN: 978-1-49190-894-5
Year: 2014
Pages: 474
Language: English
File size: 9.8 MB
File format: PDF

11 мар. 2015 г.

8 мар. 2015 г.

Удаление / замена ненужных символов в строке


Иногда нам нужно избавиться от ненужных символов в строке, так как они могут помешать нам что либо реализовать. Например ответ от сервера с не отформатированным JSON`ом, ключи и значения которого просто разделены запятыми. По запятым мы строку разбить можем, а дальше у нас в подстроках присутствует JSON`овский мусор ( {[ключ:значение] ).
Почистить строку довольно просто (например я использую данную функцию чтобы преобразовать запятую в точку, когда пользователь вводит число с плавающей точкой с русской раскладкой):

// Смена запятой в числе на точку

- (NSString *)replacePriceCountToDotCharacter:(NSString *)string {
    
    NSCharacterSet *charactersToRemove = [NSCharacterSet characterSetWithCharactersInString:@","];
    NSString *trimmedReplacement = [[string componentsSeparatedByCharactersInSet:charactersToRemove]
                                    componentsJoinedByString:@"."];
    
    return trimmedReplacement;

}

Вместо запятой можно прописать любые символы (не разделяя никакими пробелами или запятыми) которые нужно удалить или заменить (вместо точки) на другие. Для простого удаления достаточно убрать точку и оставить строку пустой ( @"" ).