It is currently Mon Sep 23, 2019 2:19 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Translation needed
PostPosted: Sat Aug 17, 2019 11:03 am 
Offline
Enthusiast
Enthusiast

Joined: Thu May 30, 2013 4:39 pm
Posts: 453
Can someone translate these swift code to PB?
Code:
    let views = ["view": view];
                let horizontalConstraints = NSLayoutConstraint.constraints(withVisualFormat: "H:|[view]|", options: NSLayoutFormatOptions(rawValue: 0), metrics: nil, views: views)
                superview?.addConstraints(horizontalConstraints)


Top
 Profile  
Reply with quote  
 Post subject: Re: Translation needed
PostPosted: Sat Aug 17, 2019 12:40 pm 
Offline
PureBasic Expert
PureBasic Expert

Joined: Sun Aug 08, 2004 5:21 am
Posts: 3443
Location: Netherlands
I'm not 100% sure but I think it should be something like this
Code:
views = CocoaMessage(0, 0, "NSDictionary dictionaryWithObject:", view, "forKey:$", @"view")
horizontalConstraints = CocoaMessage(0, 0, "NSLayoutConstraint constraintsWithVisualFormat:$", @"H:[view]", "options:", 0, "metrics:", #nil, "views:", views)
CocoaMessage(0, superview, "addConstraints:", horizontalConstraints)

_________________
macOS 10.14 Mojave, PB 5.62 x64


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye