मैं एक खेल का मैदान, एक्सकोड 6.3 (6D543q) चला रहा हूं। इसलिए स्विफ्ट 1.2एक खेल के मैदान से चल रहे सिम्युलेटर में फ़्लिकरिंग UIView
खेल का मैदान XCPlayground आयात करता है। मैं एक UIView बना रहा हूं और XCPShowView() को कॉलिंग के बजाए सिम्युलेटर में प्रस्तुत करने के लिए कॉल कर रहा हूं। मैं भी उसी तरह एक UIAlertView प्रस्तुत कर रहा हूं।
UIAlertView सामान्य के रूप में दिखाई देता है। UIView एक बड़े और छोटे आकार के बीच एक सेकंड के बारे में 5 गुना, उचित अनियमित रूप से झिलमिलाहट। मैंने स्क्रीन की सीमाओं को पूरा करने के लिए इसे आकार देने का प्रयास किया है लेकिन कोई भाग्य नहीं है। नीचे
कोड ....
// Playground - noun: a place where people can play
import UIKit
import Foundation
import XCPlayground
XCPlayground.XCPSetExecutionShouldContinueIndefinitely(continueIndefinitely: true)
@objc class alertHandler: NSObject, UIAlertViewDelegate {
func alertView(alertView: UIAlertView, clickedButtonAtIndex buttonIndex: Int) {
if buttonIndex > 0 {
// View things....
let redRectangleFrame = CGRect(x: 0, y: 0, width: 200, height: 200)
let redRectangle = UIView(frame: redRectangleFrame)
redRectangle.backgroundColor = UIColor.redColor()
redRectangle.setTranslatesAutoresizingMaskIntoConstraints(false)
XCPShowView("Red Rectangle", redRectangle)
// Alert view things...
let recevingAlertView = alertView
let text = alertView.textFieldAtIndex(0)?.text
println("\(text!)")
println("Button \(buttonIndex)")
}
}
}
let anAlertHandler = alertHandler()
let status = "Hey there!"
let message = "Do you have a moment to talk about our Lord and Saviour, Cthulhu?"
let cancel = "Sounds wierd"
let ok = "Oooh! Yes"
let alert = UIAlertView(title: status,
message: message,
delegate: anAlertHandler,
cancelButtonTitle: cancel,
otherButtonTitles: ok)
alert.alertViewStyle = UIAlertViewStyle.PlainTextInput
alert.show()
XCPShowView("Alert", alert)
एनएससीओडर रात से नमस्ते। नशे में। पढ़ नहीं सकता माफ़ कीजिये। – Abizern
मैं आपको माफ करता हूं :) – Cocoadelica
ठीक है, मैंने एक रडार दायर किया: 20256369 – Cocoadelica