Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
01/03/14 05:39 PM (11 years ago)

Fixed -- warnings for iOS 7 in Xcode

I downloaded an empty project for Buzztouch v3. All free plugins and all my purchased plugins were included in the prepared project. Then I set the Deployment Target for 7.0 - Click on tiny folder icon (under the big play button on upper-left) - Click on blue project icon - Click on General table in main window - Within Deployment Info section, find the Deployment Target setting - Use the pull-down to select 7.0 After compiling the empty project, there were a lot of warnings in the core of Buzztouch and in the plugins. Here is how I fixed all the deprecations (items that will be removed by Apple in the future). Please note that these fixes are backward compatible for iOS 6 and for iOS 7. -- Niraj
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
01/03/14 05:40 PM (11 years ago)
TARGET = iOS 7 (and backwards compatible to iOS 6) ====================== --- OLD --- statusBarStyle = UIStatusBarStyleBlackOpaque; --- NEW --- #if __IPHONE_OS_VERSION_MIN_REQUIRED < 70000 statusBarStyle = UIStatusBarStyleBlackOpaque; #else statusBarStyle = UIStatusBarStyleLightContent; #endif --------------------------- --- OLD --- statusBarStyle = UIStatusBarStyleBlackTranslucent; --- NEW --- #if __IPHONE_OS_VERSION_MIN_REQUIRED < 70000 statusBarStyle = UIStatusBarStyleBlackTranslucent; #else statusBarStyle = UIStatusBarStyleLightContent; #endif --------------------------- --- OLD --- [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent animated:animated]; --- NEW --- #if __IPHONE_OS_VERSION_MIN_REQUIRED < 70000 [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent animated:animated]; #else [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent animated:animated]; #endif --------------------------- --- OLD --- self.navigationController.navigationBar.titleTextAttributes = @{UITextAttributeTextColor:[BT_color getColorFromHexString:[appDelegate navBarTitleTextColor]]}; --- NEW --- #if __IPHONE_OS_VERSION_MIN_REQUIRED < 70000 self.navigationController.navigationBar.titleTextAttributes = @{UITextAttributeTextColor:[BT_color getColorFromHexString:[appDelegate navBarTitleTextColor]]}; #else self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName:[BT_color getColorFromHexString:[appDelegate navBarTitleTextColor]]}; #endif --------------------------- BT_Layout / BT_viewUtilities.m BT_Plugins / bt_screen_quiz / BT_screen_quiz.m --- OLD --- tmpBtn.segmentedControlStyle = UISegmentedControlStyleBar; --- NEW --- #if __IPHONE_OS_VERSION_MIN_REQUIRED < 70000 tmpBtn.segmentedControlStyle = UISegmentedControlStyleBar; #endif --------------------------- --- OLD --- CGSize textSize = [caption sizeWithFont:_caption.font]; --- NEW --- #if __IPHONE_OS_VERSION_MIN_REQUIRED < 70000 CGSize textSize = [caption sizeWithFont:_caption.font]; #else CGSize textSize = [caption sizeWithAttributes:@{NSFontAttributeName:_caption.font}]; #endif --------------------------- --- OLD --- CGSize size = [label sizeWithFont:self.labelFont]; --- NEW --- #if __IPHONE_OS_VERSION_MIN_REQUIRED < 70000 CGSize size = [label sizeWithFont:self.labelFont]; #else CGSize size = [label sizeWithAttributes:@{NSFontAttributeName:self.labelFont}]; #endif --------------------------- --- OLD --- CGSize size = [@"0" sizeWithFont:self.labelFont]; --- NEW --- #if __IPHONE_OS_VERSION_MIN_REQUIRED < 70000 CGSize size = [@"0" sizeWithFont:self.labelFont]; #else CGSize size = [@"0" sizeWithAttributes:@{NSFontAttributeName:self.labelFont}]; #endif --------------------------- --- OLD --- CGSize size = [label sizeWithFont:self.labelFont]; --- NEW --- #if __IPHONE_OS_VERSION_MIN_REQUIRED < 70000 CGSize size = [label sizeWithFont:self.labelFont]; #else CGSize size = [label sizeWithAttributes:@{NSFontAttributeName:self.labelFont}]; #endif ---------------------------
 
feraco
Aspiring developer
Profile
Posts: 705
Reg: Jan 23, 2012
nyc
15,050
like
01/03/14 06:10 PM (11 years ago)
Hey naraj I submitted a free app today. With BT 3.0 and when validated it failed because it said I was missing 4 diffetent Icon files. So I also downloaded a BT 2.0 project and dragged all BT art into the 3.0 project. And then it validated with no warnings. Thanks for the code!
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
01/03/14 11:47 PM (11 years ago)
Great Stuff Niraj! Thanks!! :) Cheers! -- Smug
 
Susan Metoxen
buzztouch Evangelist
Profile
Posts: 1706
Reg: May 01, 2011
Hopkins, Minnes...
26,260
like
01/04/14 01:02 AM (11 years ago)
Thank you for doing this, Niraj!!
 
EdReyes
Lost but trying
Profile
Posts: 574
Reg: Oct 21, 2013
location unknow...
17,640
like
01/04/14 02:25 AM (11 years ago)
very helpful thanks
 
guisante
Aspiring developer
Profile
Posts: 290
Reg: May 14, 2011
Spain
14,500
like
01/04/14 03:45 AM (11 years ago)
Thanks for code, very useful for me!
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.