小编Ano*_*s-E的帖子

Xcode 10:故事板没有显示身份,属性......检查员

在我更新到Xcode 10后,故事板表现得非常奇怪.有时它没有显示身份,属性,大小和连接检查器的任何内容,甚至我清理项目也重新启动我的Xcode,它仍然是相同的.这是一个图像示例: 在此输入图像描述

如何解决这个问题呢?

xcode ios xcode10

17
推荐指数
4
解决办法
3707
查看次数

检测 url 时,Swift ShouldStartLoadWith 不起作用

我的应用程序包含 Webview To Show Payment Form,当我们完成填写数据后,我们可以按下 Done 按钮,然后 Webview 将重定向到其他 Url。我已经搜索过这个函数,我找到了 shouldStartLoadWith 函数来解决这个问题,但是当我实现这个时,它不起作用

这是我的代码:

func webView(_ webView: UIWebView, shouldStartLoadWith request: URLRequest, navigationType: UIWebViewNavigationType) -> Bool {

        if request.url?.absoluteString == "https://xyzbank.com" {

            print("SUCCESS")
            return false
        }
        print("NOT SUCCESS")
        return true
    }
Run Code Online (Sandbox Code Playgroud)

它不是打印它们中的任何一个。

这是我的其余代码:我认为我已经调用了 webview 的委托方法,但它仍然无法正常工作

override func viewDidLoad() {
        super.viewDidLoad()

        hud.textLabel.text = "Processing..."
        hud.show(in: self.view)
        let mpayment: Payment = params.payment

        mywebview.navigationDelegate = self
        //Showing webview url....


    }

    func webView(webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: NSError) {
        print(error.localizedDescription)
    }
    func …
Run Code Online (Sandbox Code Playgroud)

uiwebview swift

5
推荐指数
1
解决办法
3158
查看次数

Swift:Regex用于删除所有内联HTML属性

我想清除HTML String文本中的所有属性.我已经找到了很多答案,但问题是如果我们没有正确的CSS风格,正则表达式的语法不起作用.我的情况很困难,因为从API获取的HTML文本与其样式不一致.它可能是这样的:

<p style="\"text-align:" justify;="" \"=""><span style="\"font-size:" 13px;="" font-family:="" arial;="" text-decoration-skip-ink:="" none;\"=""><b><span style="font-size: 18px;">Angkor Wat</span></b> is a temple complex in Cambodia and the largest religious monument in the world, on a site measuring 162.6 hectares (1,626,000 m2; 402 acres). It was originally constructed as a Hindu temple dedicated to the god Vishnu for the Khmer Empire, gradually transforming into a Buddhist temple towards the end of the 12th century. It was built by the Khmer King Suryavarman II in the …
Run Code Online (Sandbox Code Playgroud)

regex swift swift4

5
推荐指数
1
解决办法
681
查看次数

Swift:MaterialComponents TextFields快速单击时出现意外的占位符行为

我已经在Github上的MaterialComponents上打开了这个问题,但似乎还没有答案.问题是,当我单击文本字段以激活然后我在外面单击时,它工作正常但是当我重复这样做时,文本字段的占位符将始终位于顶部

这是图像的问题

当textfield执行加载时: 在此输入图像描述

当textfield激活时: 在此输入图像描述

当我们重复单击文本字段然后再次单击外部时,它将如下所示 在此输入图像描述

这是代码:

@IBOutlet weak var textfieldFloating: MDCTextField!
let tf = MDCTextInputControllerOutlined()

override func viewDidLoad() {
        super.viewDidLoad()
        textfieldFloating.leftView = UIImageView(image: UIImage(named: "ic_lock_outline_white_18pt"))
        textfieldFloating.leftViewMode = .always
        textfieldFloating.placeholder = "Placeholder"
        tf.textInput = textfieldFloating
}
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
        self.view.endEditing(true)
    }
Run Code Online (Sandbox Code Playgroud)

ios swift material-components material-components-ios

5
推荐指数
1
解决办法
595
查看次数