Time of Update: 2017-01-13
有時為了突出圖片,需要給圖片添加陰影製作效果。通過UIImageView的layer陰影屬性設定,可以很方便的實現這個功能。不僅是UIImageView,其他的UI控制項也是可以設定陰影的。下面分別對:普通圖片,背景透明圖片,按鈕添加陰影。效果圖如下:代碼如下:import UIKit class ViewController: UIViewController { @IBOutlet
Time of Update: 2017-01-18
方法在 Swift 中特定類型的相關聯功能被稱為方法。在 Objective C 中類是用來定義方法,其中作為 Swift 語言為使用者提供了靈活性,類,結構和枚舉中可以定義使用方法。執行個體方法在 Swift 語言,類,結構和枚舉執行個體通過執行個體方法訪問。 執行個體方法提供的功能 訪問和修改執行個體屬性 函數關聯執行個體的需要執行個體方法可以寫在花括弧 {} 內。它隱含的存取方法和類執行個體的屬性。當該類型指定具體執行個體它調用獲得訪問該特定執行個體。文法複製代碼
Time of Update: 2017-04-14
標籤:好的 text fill fonts sso down nts font 圖片 近期在學習swift的動畫和圖層。就用現學的東西寫了個遊戲,基本思想
Time of Update: 2016-12-15
標籤:var div code style return nbsp ret 對比 print 1 //用if let與guard let實現同一效果,會發現guard降低一個分支 2
Time of Update: 2016-12-13
標籤:ges cli handle tor resume article 分享 檔案中 ret 關鍵代碼 1 window.location.href =
Time of Update: 2016-12-05
標籤:als selector rem 學習 value pre select blog sel 1、發布新通知:NotificationCenter.default.post(name:
Time of Update: 2016-12-03
標籤:src span 3.0 圖片 list phi uil screen lan IOS可以直接使用單個icon(svg,png)。也可以直接引入字型應用:1:將您從IconFont平台下載
Time of Update: 2016-11-26
標籤:工程師 div 匿名 cat column 括弧 內聯 spec lis 閉包(Closure)這個概念如果沒學過Swift的人應該也不會陌生。學過Javascript的朋友應該知道,在J
Time of Update: 2016-11-23
標籤:它的 size img 提示 log nbsp 不同 .com 隱藏檔案 1.在Object-C項目中調用Swift1.1.建立一個Object-C
Time of Update: 2016-11-20
標籤:for nts product -418 text height code with content To programmaictlly change the content of
Time of Update: 2016-11-16
標籤:冒號 bsp 方法 lips list cap paint class constant //: Playground - noun: a place where people can
Time of Update: 2016-11-15
標籤:字元 enabled turn editing resign tle let targe make import UIKit class ViewController:
Time of Update: 2016-11-16
標籤:int test sorted 元組 turn 語句 通過 方法 函數返回 //: Playground - noun: a place where people can
Time of Update: 2016-11-06
標籤:分享 添加 com 程式 運行 target type nbsp 項目 在swift項目中,引用自己建立的類,編譯會成功的,但是會出現紅色驚嘆號,類似報錯,如:swift建立對象use
Time of Update: 2016-11-01
標籤:style color org div get rgb self pre log 如有OC需要,請自己修改//UIColor的延展 //將color轉換成RGBextension
Time of Update: 2016-04-11
標籤:基礎資料型別 (Elementary Data Type)OC:整型 int intValue = 10;浮點型 double doubleValue = 10.10; float floatValue =
Time of Update: 2015-07-09
標籤:c oc swift 橋接 調用 Swift檔案:main.swiftimport Foundation//Swift調用C函數desc1()//Swift調用OC//拿到OC類var funcClass = Root()funcClass.desc2()OC檔案:Root.h#import <Foundation/
Time of Update: 2015-07-09
標籤:swift oc 調用 修改main.m檔案#import <Foundation/Foundation.h>#import "Root.h"int main(int argc, const char * argv[]){ @autoreleasepool { Root *rt = [[Root alloc] init];
Time of Update: 2015-07-09
標籤:lazy顧名思義就是慢吞吞的,萬非得一就不動。那麼一個變數也是如此,只有你第一次使用的時候才進去載入。所有又稱為消極式載入,需要的時候才載入。=========這樣做的好處:1. 模組化,把對象的代碼都寫在了get方法中,代碼的可讀性更強。2. 佔用記憶體小【在某些情況下,不一定該對象一定要建立】,按需載入 =======如何體現?1.oc:- (UITableView *)tableView{ if(!_tableView){ _tableView =
Time of Update: 2015-07-09
標籤:ios swift /* 定義函數 */ //sayHello的函數主體首先定義了一個新的名為greeting的String常量