xcode

UIWebView show overlapping status bar in ios-11, iPhone-X, Xcode-9

扶醉桌前 提交于 2021-01-29 10:55:06
问题 I'm loading a web with UIWebView, everything works fine except that the iphoneX is cut off the bar where I put an "OK" button and a label with a title. // webView var webView: WKWebView! override func viewDidLoad() { super.viewDidLoad() let myURL = URL(string: "https://google.com") let myRequest = URLRequest(url: myURL!) webView = WKWebView(frame: CGRect( x: 0, y: 60, width: self.view.frame.width, height: self.view.frame.height - 60 ), configuration: WKWebViewConfiguration() ) //webView

How to link my static .a library to a c Xcode(10.2.1) project

六眼飞鱼酱① 提交于 2021-01-29 10:53:58
问题 I have my own static c library eg. mylibrary.a , I have used it on a bunch of school projects from the terminal but I want to now use it with an Xcode(10.2.1) command line project for testing other projects. I have tried putting the header file and .a file in the projects directory, adding the .a in the build phase menu under "link binary with libraries". I also tried linking it under "Other linker flags" by typing out my library's directory path. Thank you for your time. 回答1: It's old but

Command PhaseScriptExecution failed with a nonzero exit code

青春壹個敷衍的年華 提交于 2021-01-29 10:53:15
问题 Now I am developing iphone app. I created xcodescript.sh. But build failed. Error message is: xcodescript.sh: line 2: : command not found xcodescript.sh: line 31: syntax error: unexpected end of file Command PhaseScriptExecution failed with a nonzero exit code And My xcodescript.sh content is: #!/bin/sh BIN_DIR="bin" if [ ! -d "$BIN_DIR" ]; then mkdir -p "$BIN_DIR" fi BIN_DIR_TMP="bin_tmp" if [ ! -d "$BIN_DIR_TMP" ]; then mkdir -p "$BIN_DIR_TMP" fi DST_DIR1="./../wfchat/Frameworks" if [ ! -d

What does error “Expression type '@lvalue String?' is ambiguous without more context” mean?

此生再无相见时 提交于 2021-01-29 10:51:15
问题 In a TableView Controller, I have multiple UITextFields that allow users to input some information and use Realm to save data from users' input. I use the following ways to add the data but I got the error saying "Expression type '@lvalue String?' is ambiguous without more context" import UIKit import RealmSwift class NewIdeaCreation: UITableViewController, UITextFieldDelegate { let realm = try! Realm() override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading

Xcode: AccessoryType.checkmark pushes other views to the left

ぐ巨炮叔叔 提交于 2021-01-29 10:23:07
问题 Xcode 10, Swift 5, iOS 12 My app contains 3 ViewControllers : Login TableView Detailed info about data of single row in TableView If you edit and save the data in ViewController 3 and use the "back" button (through a NavigationController ) to go back to ViewController 2, a checkmark is added to the corresponding row in the TableView. The problem is that this checkmark pushes everything else to the left, even though I left some space for it: Setup: Horizontal StackView with 2 subviews with 1

How to get the right selector from URLSession.dataTask(with:completionHandler:) on Xcode 11.5?

那年仲夏 提交于 2021-01-29 10:01:11
问题 On Xcode 11.5 (Swift 5.2.4) the compiler gets confused and shows the error below: Cannot convert value of type '(URLSession) -> (URL, @escaping (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTask' to type '(URLSession) -> (URLRequest, @escaping (Data?, URLResponse?, Error?) -> Void) -> URLSessionDataTask' in coercion I'm trying to get the selector like follows, but the compiler still tries to convert to the version with URL instead: let selector = #selector(URLSession.dataTask(with

How to wait till a UIView transition is over

有些话、适合烂在心里 提交于 2021-01-29 09:48:39
问题 This is related to my previous question. I have the following method where it moves a playing card. func moveCard() -> Void{ UIView.animate(withDuration: 5.0) { self.hhview.transform = CGAffineTransform(translationX: -160, y: 0) } completion: { _ in print("Move completed") } } This method is called by different parent methods. But the rest of the parent methods are executed before the completion of the transition. For example, playerCheck continued is printed before Move completed . func

How to manually download GitHub iOS code and have it work in XCode 11.7?

烂漫一生 提交于 2021-01-29 09:41:16
问题 INTRO Greetings! I have recently been granted access to a proprietary (that is, private) GitHub repository for iOS development. I'm on a Mac (OS 10.15.6 Catalina, the latest MacOS as of this writing) with the latest non-beta XCode version installed today (11.7) as well as the latest iOS emulator as of this writing (iOS 13.7). I am new at using Macs, at XCode, and working with this project, and the author of this GitHub code hasn't been available to help me work with his code. (I am well

Use of unresolved identifier 'Map' SwiftUI

放肆的年华 提交于 2021-01-29 09:18:04
问题 I am following the official tutorial for SwiftUI and have run into the error message 'Use of unresolved identifier 'Map'. Even when I copy and and paste the code from the tutorial, it is still giving me the error. I have looked at a few solutions for similar issues and can't seem to find anything that will work. Code below. import SwiftUI import MapKit struct MapView: View { @State private var region = MKCoordinateRegion( center: CLLocationCoordinate2D(latitude: 34.011_286, longitude: -116

UIView ignoring my constraints when setting width equal to scrollview?

喜你入骨 提交于 2021-01-29 07:54:32
问题 Every time I set the width of my view to my scroll view it pushes the green square off the screen. 回答1: @belgrim I had had a rough time working with scroll views. I would like to share my work around. First, drag a scroll view to your storyboard and pin in to four sides. Then, add a view inside the scroll view and pin it to the four sides of its superview (i.e. the scroll view) The result would look like this (Don't worry about the red markers, those will be fixes in the next steps) Add a