This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject!) { | |
if segue.identifier == "ViewImage" { | |
let imageViewController = segue.destinationViewController as ImgurImageViewController | |
let cell = sender as ImageCollectionViewCell | |
if let indexPath = imagesCollectionView.indexPathForCell(cell) { | |
imageViewController.imgurImage = images[indexPath.row] | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@IBAction func touched(sender: AnyObject) { | |
if let button = sender as? Button { | |
button.setTitle("Touched", forState: .Normal) | |
} | |
} | |
@IBAction func touched(sender: AnyObject) { | |
if sender is UISegmentedControl { | |
let segmentedControl = sender as UISegmentedControl | |
let selectedIndex = segmentedControl.selectedSegmentIndex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@IBAction func touched(sender: AnyObject) { | |
if sender is UIButton { | |
let buttonTitle = (sender as UIButton).currentTitle | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for item in toolbarItems! { | |
if let barButtonItem = item as? UIBarButtonItem { | |
// Do something with UIBarButtonItem | |
} | |
if let segmentedControl = item as? UISegmentedControl { | |
// Do something with UISegmentedControl | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// PlacePickerViewController.swift | |
// TaxiReporter | |
// | |
// Created by Kiattisak Anoochitarom on 2/27/2558 BE. | |
// Copyright (c) 2558 Kiattisak Anoochitarom. All rights reserved. | |
// | |
import UIKit | |
import FacebookSDK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" // another package contains function | |
func main() { | |
var hello = "hello gopher!!" // type inference | |
// can be shorten in -> hello := "hello gopher!!" | |
fmt.Println(hello) | |
arr := [6]int{1, 2, 3, 4, 5} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Unable to simultaneously satisfy constraints. | |
Probably at least one of the constraints in the following list is one you don't want. | |
Try this: | |
(1) look at each constraint and try to figure out which you don't expect; | |
(2) find the code that added the unwanted constraint or constraints and fix it. | |
(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) | |
(...........) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UIWindow:0x7f9481c93360 | |
| •UIView:0x7f9481c9d680 | |
| | *UIView:0x7f9481c9d990- AMBIGUOUS LAYOUT for UIView:0x7f9481c9d990.minX{id: 13}, UIView:0x7f9481c9d990.minY{id: 16} | |
| | *_UILayoutGuide:0x7f9481c9e160- AMBIGUOUS LAYOUT for _UILayoutGuide:0x7f9481c9e160.minY{id: 17} | |
| | *_UILayoutGuide:0x7f9481c9ebb0- AMBIGUOUS LAYOUT for _UILayoutGuide:0x7f9481c9ebb0.minY{id: 27} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(lldb) expr ((UIView *)0x7f9ea3d43410).backgroundColor = [UIColor redColor] | |
(UICachedDeviceRGBColor *) $1 = 0x00007f9ea3d43410 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum Optional<T> { | |
case None | |
case Some(T) | |
} |