xcode9

How to prevent app from overlapping status bar in ios-11, iPhone-X, Xcode-9

拈花ヽ惹草 提交于 2019-11-29 14:54:28
I want to stop overlapping of my View with statusbar Use Auto Layout and pin your view to Top Layout Guide, or use the new Safe Area Layout Guides. To enable it, in your storyboard's File inspector tick the following option. As an example I have used gray image view: As you can see below, it does not overlap status bar: 来源: https://stackoverflow.com/questions/46275652/how-to-prevent-app-from-overlapping-status-bar-in-ios-11-iphone-x-xcode-9

How to connect Xcode 9 and GitHub?

ⅰ亾dé卋堺 提交于 2019-11-29 14:49:26
I am part of a group of computer science students building their first project in Swift. We have attempted to connect GitHub with the XCode git configurations so we can all edit one project through pushing and pulling commits. We have little to no prior experience implementing GitHub with native applications such as XCode and online articles have not explained how we can create a project in XCode and connect it to GitHub so we can push and pull to Github and edit a 'master project' that we all have access to. The closest we have gotten is doing XCode -> Preferences -> Accounts and adding new

How to change home indicator background color on iPhone X?

删除回忆录丶 提交于 2019-11-29 13:25:55
I would like to change the background color of the view that appears on the bottom of the new iPhone X with a home indicator inside. Is it possible? The home indicator color is determined automatically based on the color of the content below it. Most of the time, this means you should not worry about its color since it is out of your control, and will always be clearly visible to users. However, you can place a colored view in the area behind the home indicator to manipulate its color. Examples (Please note that these examples were taken on the iOS simulator, and behavior on a real device is

Swift 4 - Notification Center addObserver issue

大兔子大兔子 提交于 2019-11-29 12:27:19
问题 I'm crashing and getting an unrecognized selector error every time a Notification arrives and the App tries to execute its associated method. Here's my code - which is in viewDidLoad : let notificationCenter = NotificationCenter.default notificationCenter.addObserver(self, selector: Selector(("sayHello")), name:NSNotification.Name(rawValue: "dataDownloadCompleted"), object: nil) The sayHello() method is quite simple - looks like this: func sayHello() { print("Hello") } I've verified that the

Swift 4 Cannot convert value of type '[String : AnyObject]?' to expected argument type '[NSAttributedStringKey : Any]?'

流过昼夜 提交于 2019-11-29 10:52:03
I have just updated to Xcode 9 and converted my app from swift 3 to swift 4. I have graphs which use strings to label the axes and other variables. So I have a moneyAxisString = "Money". Previously I was able to draw them using this code: moneyAxisString.draw(in: CGRect(x: CGFloat(coordinateXOriginLT + axisLength/3), y: CGFloat(coordinateYOriginRT + axisLength + 5 * unitDim), width: CGFloat(300 * unitDim), height: CGFloat(100 * unitDim)), withAttributes: attributes as? [String : AnyObject]) Where attributes is a dictionary defined as follows attributes = [ NSAttributedStringKey.foregroundColor

Xcode 9 custom fonts not working

落花浮王杯 提交于 2019-11-29 09:28:52
Custom fonts not working in Xcode 9. However if I open the same project in Xcode 8, the custom fonts work as expected I've ran this piece of code to ensure the fonts show up: NSArray *fontFamilies = [UIFont familyNames]; for (int i = 0; i < [fontFamilies count]; i++) { NSString *fontFamily = [fontFamilies objectAtIndex:i]; NSArray *fontNames = [UIFont fontNamesForFamilyName:[fontFamilies objectAtIndex:i]]; NSLog (@"%@: %@", fontFamily, fontNames); } I've ensured the fonts are in the plist, checked target membership, and in the copy bundle resource section. Is this an Xcode bug? I have this

App Icon missing iOS 11

两盒软妹~` 提交于 2019-11-29 04:54:44
After updating to Xcode 9 (9A235), app icon was missing after running on iOS 11. It was working fine in previous version. This issue is caused by CocoaPods . I have tried this solution but this is giving me error. An error occurred while processing the post-install hook of the Podfile. Try adding this script in your podfile. post_install do |installer| installer.aggregate_targets.each do |target| copy_pods_resources_path = "Pods/Target Support Files/#{target.name}/#{target.name}-resources.sh" string_to_replace = '--compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"' assets

Unable to install app in simulator xcode 9 beta

梦想的初衷 提交于 2019-11-29 03:09:40
I downloaded Xcode 9 beta recently, and when I tried to run my app in the simulator it is not getting installed. I am getting this error in my Xcode every time I try to run the app. Any help provided will be appreciated. Thanks in advance. P.S: Application used to work in Xcode 8.3.3 Unfortunately, the error message doesn’t explain why the install failed. You can take a look at ~/Library/Logs/CoreSimulator/CoreSimulator.log to see if the rest of the error message is there with more info. If not, you should check out the sim device’s system log: sudo xcode-select -s /Applications/Xcode-beta.app

What does the dark triangle, located on the folder icons in Xcode 9, mean?

徘徊边缘 提交于 2019-11-29 02:12:21
问题 I use Xcode 9.0. Some folders icons in my Xcode project have dark triangles in bottom left corner - for example, "0. Login", "Frameworks", "Products", "Pods". What does this mean? 回答1: Folders without dark triangles exist as a group in your project and also (what is new in Xcode 9) exist as a folder in file structure. Example: After double-click in your project navigator you can see menu: For New Group Xcode create group in project navigator and create folder in file structure (in finder) and

How can I get full-resolution screenshots when the Simulator's “Pixel Accurate” option is disabled?

。_饼干妹妹 提交于 2019-11-29 02:08:51
问题 On Xcode 9.1 the Pixel Accurate option is disabled and grayed out under the Window menu. How can I take App Store screenshots without this option? 回答1: The original answer is wrong! Russ from the Apple Simulator team says: To take app store screenshots uncheck the "Optimize rendering for Window Scale" option in the Debug menu. I recommend turning this back on normally as it improves rendering performance. Double-clicking does not make the device use native resolution, that's just an accident