The internet's most comprehensive Swift resource.




by Eirik Madland     myxcode.net
Swift Version: 2.0
I was is need of a Alert Controller thet was self dismissed. Here’s how I did that: Create a Single View Application. Define a global variable for the UIAlertController. let alertView = UIAlertController(title: "Wait 3 seconds", message: "This message will selfdiscruct after... Continue Reading →

by Eirik Madland     myxcode.net
Swift Version: 2.0
I wanted some code to be triggered after a timer was done. Here’s a simple example of that and how I did it. Add a Single View Application. Create a label to see that our code works, change it’s label... Continue Reading →

by Eirik Madland     myxcode.net
Swift Version: 2.0
I was recently in need of adding a volume control to an App that uses AVPlayer to play a stream from Internet. Here’s I solved it (excluding all the parts besides the volume control). In your project you already have... Continue Reading →

by Eirik Madland     myxcode.net
Swift Version: 2.0
Here’s how to get rid of the “App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app’s Info.plist file.” error message when using http in your code.... Continue Reading →

by Eirik Madland     myxcode.net
Swift Version: 2.0
Here’s a way of doing that. Create a new Single View Application. Drag and drop the images you want to your project and name them Bars-0, Bars-1 and so on. (In my project they are called Bars-0, Bars-1, Bars-2 and Bars-3). I... Continue Reading →

by Eirik Madland     myxcode.net
Swift Version: 2.0
Here’s an example on how to add an Interstitial iAd once the App is started and an iAd i available. Create a new Single View Application. In ViewController.swift, import iAd. import iAd Make sure your ViewController is a delegate for your ad. class... Continue Reading →

by Eirik Madland     myxcode.net
Swift Version: 2.0
Here’s what we want to archive: Here’s how to do that. Create a new XCode project using a Single View Application. Add a button to your view controller, name it “View PDF File” and connect an @IBAction to it and... Continue Reading →

by Eirik Madland     myxcode.net
Swift Version: 2.0
Here’s the instructions to make your own Framework and add it to a project. First let us make a simple Framework with a couple of functions. Start a new Xcode project selecting iOS – Framework & Library – Cocoa Touch Framework and... Continue Reading →

by Eirik Madland     myxcode.net
Swift Version: 2.0
Here’s how to do that... Continue Reading →

by Eirik Madland     myxcode.net
Swift Version: 2.0
This is what we want to archive... Continue Reading →

by Eirik Madland     myxcode.net
Swift Version: 2.0
Here’s how to add an animation to your UICollectionView Cell. Override the following function: // Animation of UICollectionViewCell override func collectionView(collectionView: UICollectionView, willDisplayCell cell: UICollectionViewCell, forItemAtIndexPath indexPath: NSIndexPath) { cell.alpha = 0 cell.layer.transform = CATransform3DMakeScale(0.5, 0.5, 0.5) UIView.animateWithDuration(0.4, animations: {... Continue Reading →

by Eirik Madland     myxcode.net
Swift Version: 2.0
Here’s the code to that: // Drop shadow on image myImage.layer.masksToBounds = false myImage.layer.shadowOffset = CGSizeMake(1, 2) myImage.layer.shadowRadius = 2.0 myImage.layer.shadowColor = UIColor.blackColor().CGColor myImage.layer.shadowOpacity = 1.5 Play with the values… That’s it

by Eirik Madland     myxcode.net
Swift Version: 2.0
A site to remember great stuff related to Xcode and Swift. Useful tutorials for myself and other to enjoy.

by Eirik Madland     myxcode.net
Swift Version: 2.0
I have a App getting reviewed by Apple and it got rejected. Reason: “2.2 – Apps that exhibit bugs will be rejected”. If you are using Facebook in any way you might get this error (with the following screenshot): (App... Continue Reading →



© 2015 SoSoSwift. Blog · About · Contact · Privacy policy · Terms of service · RSS