Move XIB into storyboard

Lately i run into some trouble when i tried to integrate a viewcontroller from another project to a new one.

As usual i dragged the files (classes + XIB) to the new project, added a new uiviewcontroller to the storyboard and set the class to the newly imported.
Starting the app i was greeted with an empty white view and the content of the XIB was ignored.

After some googling i found the needed trick: a view is is added automatically when you add a UIViewController to your storyboard:

Screen Shot 2015-11-27 at 12.18.46

I had to delete this “view”.

When the storyboard-engine does not get a view for the controller it falls back to looking for a XIB with the same name as the class.



animating positions in autolayout

Animations in Swift are pretty straight forward:

UIView.animateWithDuration(0.5, delay: 0.1, options: UIViewAnimationOptions.TransitionNone, animations: { () -> Void in                          
  self.lbl.alpha = 0.0;
}, completion: { (finished: Bool) -> Void in
   self.lbl.hidden = true

but if the position of an element was done by “autolayout” the order is a bit more tricky.

Step 1: you need to set up the connection in “Interface Builder” to a member like this:

@IBOutlet var topConstraint:NSLayoutConstraint!;

Step 2: the animation:

// recommended, although probably not neccesary

self.topConstraint.constant = -30.0;
UIView.animateWithDuration(annitime, delay: 0.1, options: UIViewAnimationOptions.TransitionNone, animations: { () -> Void in
                    }, completion: { (finished: Bool) -> Void in

valid as of Swift 2.1, found here

moving to SWIFT (slowly…)

I’m learning swift. And these series of posts is about the troubles i am facing. Mostly because i did not spend enough time to completely understand the documentation, but also because swift changes fast and LOTS of examples and posts on the internet are already out of date.

For example i found heaps of broken “cellForRowAtIndexPath” implementations.

This one does work(as of today….):

override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        let cellIdentifier = "TableCell1"
        var cell = tableView.dequeueReusableCellWithIdentifier(cellIdentifier)
        if (cell==nil) {
            cell = UITableViewCell.init(style: .Subtitle, reuseIdentifier: cellIdentifier)
        cell?.textLabel?.text = "CellTextlabelText\(indexPath.row)"
        return cell!

Another one that was more difficult than anticipated was “prepareForSegue”

    override func prepareForSegue(segue: UIStoryboardSegue?, sender: AnyObject?) {

            let next:ListeTableView = segue!.destinationViewController as! ListeTableView
            next.daten = self.daten

both viewcontrollers have an array of Objects as a member:

import UIKit

class ListeTableView: UITableViewController {
    var daten: [Shops] = []
// more....





Demo zip für Opensocial bei StudiVZ/MeinVZ/SchülerVZ

Opensocial bei den VZ Netzwerken geht langsam los.
Leider vermisse ich in der Doku ein Beispiel für die ZIP-Datei.

Mit ein wenig rumprobieren und Fragen im Forum habe ich es nun geschafft.
Damit andere nicht rumprobieren müssen hier die Datei:

– css und js werden mit dem ZIP auf CDN gepackt und im XML geladen
– 2 Views werden definiert und ein Link zum jeweils anderen View

Falls jemand noch weiß wie man CSS-images auf das CDN bekommt,
dann habe ich großes Interessen an der Information 😉

“link:” operator is broken in google with a hyphen in domainnames

While playing around with some nice search options that were mentioned here, i noticed a bug in the “link:” operator.

If your domainname has a “-” in it and you try to find the latest links the results are broken.


Notice that the first result has a "<br >", a ".de" and the word "online" in it.

I have no clue how to tell google about their bugs, so i post it here and see what happens 🙂

Posted in Uncategorized | 1 Reply