Time of Update: 2018-07-23
筆試問題 初學者 問題1、(Swift 1.0及其之後的版本的問題)有什麼更好的方法來寫下面的for迴圈。 1 2 3 for var
Time of Update: 2018-07-25
// Playground - noun: a place where people can playimport UIKit//------------------------------------------------------------------------------// 1. 定義固定格式的字典// dict1的所有“索引值”類型一致(都是字串)var dict1 = ["name": "mary", "age":
Time of Update: 2018-07-25
最近一直在納悶如何去判斷AnyObject類型為空白,像以前oc中有nil進行判斷就可以了,但是它卻不能使用此方法進行判斷; 而我在很多資料請求的時候又需要使用AnyObject類型作為傳回值,研究了很久都沒找到有效判斷方式,今天仔細研究了下它的資料結構,終於找到了方法; 首先來分析下它的資料結構,下面分有資料和沒有資料的時候進行區分: 1、有資料的時候: ▿ Optional<AnyObject> ▿ Some : 2 elements
Time of Update: 2018-07-26
自己寫的方法 不比比 自己能看懂就行 只用作自己學習swift的總結 import UIKit typealias block = (String,String) ->() class MoveCarViewController:
Time of Update: 2018-07-26
//: Playground - noun: a place where people can play import UIKit //有序集合 var str = "Hello, playground" var array1: Array<Int> = Array<Int>() var array2: [Int] = array1 var array3 = array2
Time of Update: 2018-07-26
一。給swift添加debug標記 二 。自訂Log //// AppDelegate.swift// 11-自訂Log//// Created by xiaomage on 16/4/1.// Copyright © 2016年 小碼哥. All rights reserved.//import UIKit@UIApplicationMainclass AppDelegate: UIResponder, UIApplicationDelegate {
Time of Update: 2018-07-26
類定義 我們通過關鍵字class和struct來分別表示類和結構體,並在一對大括弧中定義它們的具體內容 /* class SomeClass { // class definition goes here } struct SomeStructure { // structure definition goes here } */ 類和結構體共同點 /* 1.定義屬性用於儲存值 2.定義方法用於提供功能 3.定義附屬指令碼用於訪問值
Time of Update: 2018-07-26
UICountingLabel作為文字動畫的效果顯示,在OC上可謂是用的最多的,今天我們講一下在swift中的基本使用,包括swift3和swift4中如何使用UICountingLabel 想用UICountingLabel還是要先下載過來的 下載地址: https://github.com/dataxpress/UICountingLabel UICountingLabel只支援整形和浮點數樣式
Time of Update: 2018-07-24
一、什麼是外部參數名。 淺顯地說,外部參數名就是在調用一個方法時要在方法的參數前面加上一個特定的名字,目的是便於閱讀代碼,提高維護效率。 二、在最新的Xcode中,外部參數名的性質與用法如下 性質: 函數可同時有局部名稱(內部使用)和外部名稱(調用函數時使用),方法的參數也類似,不過方法和函數的局部名稱和外部名稱的預設行為是不一樣的
Time of Update: 2018-07-25
轉自:http://www.starming.com/index.php?v=index&view=53 先建一個UIBarExtension.swift的檔案來擴充UINavigationBar import Foundationimport UIKitextension UINavigationBar { func hideBottomHairline() { let navigationBarImageView =
Time of Update: 2018-03-11
標籤:標頭檔 user UI blog pat xxxx ade 匯入 檔案匯入 1.首先建立個 swift工程2.在swift 中建立 OC 類 比如建立 Request
Time of Update: 2018-02-03
標籤:.text thunder label sts alertview data- blog click track //建立
Time of Update: 2018-01-15
標籤:swift的 api 代碼 就是 方法 常用 ble 重要 比較 動態性比較重要的一點就是能夠拿到某個類所有的方法、屬性,我們使用如下代碼來列印方法和屬性列表。 純S
Time of Update: 2017-11-26
標籤:version 函數 多個 範圍 尋找 消失 span [] amount 閉包是自包含的功能塊,可以在代碼中傳遞和使用。Swift閉包與c和oc中的block類似,其他語言用lambda
Time of Update: 2017-10-25
標籤:選擇 一個 因此 swift optional 需要 從表 引用 retain 1. weak unowned
Time of Update: 2017-09-02
標籤:div 檔案 order 常用 操作 .com title 接下來 border Swift開發筆記(一)剛開始接觸XCode時,整個操作邏輯與Android Studio、Visual
Time of Update: 2017-08-14
標籤:圖片 比較 view 超出 填充 qq空間 image 不顯示 常用 contentMode屬性是用來設定圖片在UIImageView中的顯示方式,如:展開、置中、填充等。這裡討論的是UI
Time of Update: 2014-06-27
標籤:swift 協議 代理模式 模態 1.功能簡介RootViewController中用個lable和一個按鈕,點擊按鈕跳轉到模態視窗。在模態視窗中有個TextField和一個按鈕,輸入文字點擊關閉模態按鈕後跳轉到RootViewController,並改變其label為輸入的值。2.實現思路ModelViewController中定義一個成員
Time of Update: 2018-12-03
這幾天正在自己搭建一個swift的環境。看了一些資料,結合自己的實踐,寫下了它:1.實體環境說明:Linux系統版本:Ubuntu Server 12.04Proxy Server IP: 10.214.0.181Storage Server One:10.214.0.179Storage Server Two:10.214.0.180Storage Server three:10.214.0.1822.重要組件說明:node:運行一個或多個object storage
Time of Update: 2018-12-05
問題描述:在安裝完swift叢集之後,使用swift stat查看狀態,發現一直沒有響應,初步判斷是由於swift同keystone的認證環節出現問題,查看/opt/stack/data/swift/logs/proxy.error記錄檔發現如下錯誤:UNCAUGHT EXCEPTION#012Traceback (most recent call last):#012 File "/usr/local/bin/swift-proxy-server", line 7, in