ios8

Custom vibration in iOS 8 - Swift

旧街凉风 提交于 2020-02-23 09:37:06
问题 I'm writing a sprite kit-based app in swift and need to make a short haptic feedback using vibration so first I imported AudioToolbox and used this AudioServicesPlayAlertSound(SystemSoundID(kSystemSoundID_Vibrate)) and it worked well but it vibrates for too long and there's no way to control this duration. Then after some searching I read Kevin Cao's answer here: Are there APIs for custom vibrations in iOS? but unfortunately AudioServicesPlaySystemSoundWithVibration private function was only

Displaying NSMutableAttributedString on iOS 8

*爱你&永不变心* 提交于 2020-02-13 04:36:43
问题 Seems on iOS 8.0 (12A365) NSMutableAttributedString sometimes will not be displayed correctly. The problem obviously occurs when the range of the attribute does not start at the beginning of the text (and if there is no other attribute starting at the beginning of the text). So with 1.) the second word "green" in will not show the green background (bug!) ("cell" is a UITableViewCell with UILabel "label" as a subview): 1.) text = [[NSMutableAttributedString alloc] initWithString:@"Green is

Displaying NSMutableAttributedString on iOS 8

给你一囗甜甜゛ 提交于 2020-02-13 04:36:10
问题 Seems on iOS 8.0 (12A365) NSMutableAttributedString sometimes will not be displayed correctly. The problem obviously occurs when the range of the attribute does not start at the beginning of the text (and if there is no other attribute starting at the beginning of the text). So with 1.) the second word "green" in will not show the green background (bug!) ("cell" is a UITableViewCell with UILabel "label" as a subview): 1.) text = [[NSMutableAttributedString alloc] initWithString:@"Green is

Where are user defaults plist files stored in iOS8?

痴心易碎 提交于 2020-01-31 09:30:19
问题 I can't find preferences .plist file, because Preferences folder is empty. To get Library folder I use: println(NSSearchPathForDirectoriesInDomains(.LibraryDirectory, .UserDomainMask, true)[0]) Xcode 6 beta 5, iOS Simulator 回答1: The folder hierarchy has changed under iOS8. All preferences are now stored under the common /Library/Preferences folder. Notice, this is not the Library folder under your app's container, it's the general Library folder. For the simulator, the exact folder is: ~

Change default global tint color in swift

℡╲_俬逩灬. 提交于 2020-01-31 04:49:08
问题 I'm developing a little app and I would like to change the default global tint color from blue to orange. I've seen many ways to do it in Objective-C but I can't seem to get it to work using swift. How could I achieve this? Thanks in advance! 回答1: Couldn't that be easier? @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(application: UIApplication!, didFinishLaunchingWithOptions launchOptions: NSDictionary!) -> Bool { self.window

How to get requested image size for iOS8 PhotoKit?

强颜欢笑 提交于 2020-01-31 03:28:07
问题 I am using the code below for fetching an image: [[PHImageManager defaultManager] requestImageForAsset:asset targetSize:CGSizeMake(800, 600) contentMode:PHImageContentModeAspectFill options:options resultHandler:^(UIImage *result, NSDictionary *info) { NSLog(@"size:%@",NSStringFromCGSize(result.size)); }]; I'm requesting an image size of 800 x 600, but I'm getting an image size of 45 x 60, which is very poor-quality. How can i get the requested image size using PhotoKit ? 回答1: Your (Unnati's)

MKMapView showing blank screen in iOS 8

本小妞迷上赌 提交于 2020-01-29 07:24:04
问题 I am having an issue with displaying a MKMapView in iOS 8. It worked fine in iOS 7 and it is working fine now but only on simulator. On device it shows only annotations but no map behind. It looks like this: http://imgur.com/rBVWTeD The error that I am getting: 2014-09-24 22:07:15.349 xxx[1509:265380] Stylesheet does not include style matching tree, or includes an old version. Perhaps it was compiled by an old version of the style compiler. 2014-09-24 22:07:15.351 xxx[1509:265380] Please

Apps built with Xcode 6 don't run on iOS8

霸气de小男生 提交于 2020-01-24 22:12:30
问题 I recently updated to Xcode 6 beta 3 . When I run my app in Xcode 6 beta 2 it runs fine. When I run my app in beta 3 on an iOS7 device it runs fine. However, when I run using beta 3 and iOS8 beta 3 , it builds, claims it is running (in the toolbar feedback); and – about 5 seconds after that – it shows "finished running" in the toolbar. The app isn't installed on the phone after all this. There isn't anything logged in the console. Everything from Xcode 's side appears fine. I did manage to

Swift can't show back button after hiding it

元气小坏坏 提交于 2020-01-24 17:04:45
问题 I have a UITableViewController with static cell that has a custom back button. I hide the back button in viewDidLoad with the code: var cancelBtn = UIBarButtonItem(title: "Cancel", style: UIBarButtonItemStyle.Plain, target: self, action: "closeSettings") self.navigationItem.hidesBackButton = true self.navigationItem.leftBarButtonItem = cancelBtn If I don't have the self.navigationItem.hidesBackButton = true line in place, the back button arrow still appears. With that line in the code, the

how do i upgrade ios7 universal app to xcode 6 based universal storyboard app?

天涯浪子 提交于 2020-01-24 15:13:06
问题 i currently have a xcode 5 (ios 7) based universal app (hence two storyboards) and I am thinking of updating it to ios 8. Is there a way / best approach to migrate the two storyboards into a universal single storyboard? I cant see a convert option in xcode 6. 来源: https://stackoverflow.com/questions/26087401/how-do-i-upgrade-ios7-universal-app-to-xcode-6-based-universal-storyboard-app