This file contains hidden or 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
| import UIKit | |
| import CoreLocation | |
| class WeatherViewController: UIViewController,CLLocationManagerDelegate { | |
| //Constants | |
| let WEATHER_URL = "http://api.openweathermap.org/data/2.5/weather" | |
| let APP_ID = "e72ca729af228beabd5d20e3b7749713" | |
This file contains hidden or 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
| import UIKit | |
| class ViewController: UIViewController { | |
| // Our strings | |
| let story1 = "Your car has blown a tire on a winding road in the middle of nowhere with no cell phone reception. You decide to hitchhike. A rusty pickup truck rumbles to a stop next to you. A man with a wide brimmed hat with soulless eyes opens the passenger door for you and asks: \"Need a ride, boy?\"." | |
| let answer1a = "I\'ll hop in. Thanks for the help!" | |
| let answer1b = "Better ask him if he\'s a murderer first." | |
| let story2 = "He nods slowly, unphased by the question." |
This file contains hidden or 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
| import UIKit | |
| import VisualRecognitionV3 | |
| import SVProgressHUD | |
| class ViewController: UIViewController,UINavigationControllerDelegate,UIImagePickerControllerDelegate { | |
| let apiKey = "f394cba206eb4ff8778fce96d95801f7494fdfc8" | |
| let version = "2017-08-12" | |
| @IBOutlet weak var imageView: UIImageView! |
This file contains hidden or 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
| // | |
| // ViewController.swift | |
| // seefood | |
| // | |
| // Created by 張書涵 on 2017/8/12. | |
| // Copyright © 2017年 AliceChang. All rights reserved. | |
| // | |
| import UIKit | |
| import VisualRecognitionV3 |
This file contains hidden or 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
| import UIKit | |
| import VisualRecognitionV3 | |
| class ViewController: UIViewController,UINavigationControllerDelegate,UIImagePickerControllerDelegate { | |
| let apiKey = "f394cba206eb4ff8778fce96d95801f7494fdfc8" | |
| let version = "2017-08-12" | |
| @IBOutlet weak var imageView: UIImageView! | |
| @IBOutlet weak var cameraButton: UIBarButtonItem! | |
This file contains hidden or 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
| import UIKit | |
| import VisualRecognitionV3 | |
| class ViewController: UIViewController,UINavigationControllerDelegate,UIImagePickerControllerDelegate { | |
| let apiKey = "********************" | |
| //輸入你自己的IBMapiKey:長得像是f394cba206eb4ff8779fce96d95801f7494fdfc2的數字與英文字串 | |
| let version = "2017-08-12" | |
| @IBOutlet weak var imageView: UIImageView! |
This file contains hidden or 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
| import UIKit | |
| class ViewController: UIViewController,UIImagePickerControllerDelegate,UINavigationControllerDelegate{ | |
| //加入UIImagePickerControllerDelegate屬性才能使用相機相關的內容,加入UINavigationControllerDelegate才能讓畫面順利往右 | |
| @IBOutlet weak var ImageView: UIImageView! | |
| @IBOutlet weak var cameraButton: UIBarButtonItem! | |
| let imagePicker = UIImagePickerController() | |
This file contains hidden or 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
| // TableViewController.swift | |
| // table | |
| // | |
| // Created by 張書涵 on 2017/8/3. | |
| // Copyright © 2017年 AliceChang. All rights reserved. | |
| import UIKit | |
| class TableViewController: UITableViewController ,UISearchResultsUpdating { | |
| let appleProduct = ["Apple TV", "Apple Watch", "iMac", "iPhone", "Macbook Pro", "iPad", "iPod", "Air Pod"] |
This file contains hidden or 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 viewDidLoad() { | |
| super.viewDidLoad() | |
| buttonArray = [button1,button2,button3,button4,button5] | |
| if buttonArray != nil{ | |
| for button in buttonArray!{ | |
| let lpgr = UILongPressGestureRecognizer(target: self, action: #selector(ViewController.longPress(sender:))) | |
| lpgr.minimumPressDuration = 1.5 | |
| button.addGestureRecognizer(lpgr) | |
| } | |
| } |
This file contains hidden or 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
| import UIKit | |
| class ContentViewController: UIViewController{ | |
| var nowPageNumber = 0 | |
| @IBOutlet weak var mainImageView: UIImageView! | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| mainImageView.image = UIImage(named:"\(nowPageNumber)") | |
| } |
NewerOlder