2015-03-17 9 views
6

मैं एक खेल का मैदान, एक्सकोड 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) 
+1

एनएससीओडर रात से नमस्ते। नशे में। पढ़ नहीं सकता माफ़ कीजिये। – Abizern

+0

मैं आपको माफ करता हूं :) – Cocoadelica

+1

ठीक है, मैंने एक रडार दायर किया: 20256369 – Cocoadelica

उत्तर

1

कुछ सिम्युलेटर परीक्षण खेल का मैदान उदाहरणों के साथ कुछ झिलमिलाहट स्थानीय स्तर पर देखा this post से

(अपने उदाहरण संस्करण 6.3.2 (6D2105) मेरे लिए दुर्घटनाग्रस्त हो गया था) (उनकी एनीमेशन दिखाई दे रही थी लेकिन झटकेदार, और ओवरलैपिंग)

कुछ सीमाएं हैं और Playgrounds में UIKit पर वापस आती हैं। प्राथमिक सीमा यह है कि प्लेग्राउंड में उपयोग किए जाने पर ऑटो लेआउट में कुछ समस्याएं होती हैं। कुछ बाधाएं में रनटाइम अपवादों का कारण बनती हैं जो संकलित समय में वृद्धि के अतिरिक्त होती हैं। उम्मीद है कि एक्सकोड पर भविष्य के अपडेट इसे हल करेंगे। XCPlayground का उपयोग करते समय एक और ड्रॉ वापस खेल के मैदान का प्रदर्शन है। आईओएस सिम्युलेटर के साथ प्लेग्राउंड के पीछे चलने वाले एक्सकोड के रूप में देरी हो सकती है।

संबंधित मुद्दे