顯示具有 iOS 標籤的文章。 顯示所有文章
顯示具有 iOS 標籤的文章。 顯示所有文章

星期四, 12月 29, 2016

[Objective-C] 剛轉入寫iOS Objective的一些簡單筆記~

記錄一下菜到不行的初學者(我本人XD)Objective-C 寫的筆記

變數宣告strong跟weak


用segue轉到另一個view如何退上去的方法

[self dismissViewControllerAnimated:true completion:nil];


用Navigation控制轉viewController

By using below line we can go to parent view controller

[self.navigationController popViewControllerAnimated:YES];


By using below line we can move to main/root view controller

[self.navigationController popToRootViewControllerAnimated:YES];


By using below line we can move to any view controller

[self.navigationController popToViewController:viewControllerObject animated:YES];

星期日, 12月 25, 2016

[Objective-C] 初試一下youtube live streaming (一) 相關資源蒐集

記錄一下工作需要研究的youtube live streaming的呼叫

前置作業

要先到https://console.developers.google.com/ 要先開一個專案並申請api金鑰



帳號啟用直播功能

如果帳號未啟動直播功能,會噴以下錯誤

{
    error =     {
        code = 403;
        errors =         (
                        {
                domain = "youtube.liveBroadcast";
                extendedHelp = "https://www.youtube.com/features";
                message = "The user is not enabled for live streaming.";
                reason = liveStreamingNotEnabled;
            }
        );
        message = "The user is not enabled for live streaming.";
    };
}

可以登入youtube後,到以下連結開通直播功能
https://www.youtube.com/features





Oauth2 處理iOS Client/Server的連線


youtube官方文件

https://support.google.com/youtube/answer/2853700?hl=en&ref_topic=6136989


YouTube Live Streaming API Overviewhttps://developers.google.com/youtube/v3/live/getting-started

YouTube Live Streaming API Code Samples (JAVA/PHP/PYTHON)

Objective C libs for REST

星期四, 1月 21, 2016

[iOS Swift] 如何新增專案內的資料夾

當專案愈來愈大的時候,
就需要好好定義一下專案目錄的結構,
記錄一下Xcode如何在專案中新增資料夾。

1. 專案目錄下按右鍵
2. 選擇New Group即可


星期一, 1月 18, 2016

[iOS Swift] 發送網路請求錯誤: App Transport Security has blocked a cleartext


在使用https://github.com/Alamofire/Alamofire來進行網路資源的request,
執行後發生以下的錯誤:

App Transport Security has blocked a cleartext 

解決方法只要info.plist檔案加入App Transport Security Settings的key,
並在此key下面再新增Allow Arbitrary Loads的key且屬性請設為YES即可


參考:




星期日, 1月 10, 2016

星期一, 6月 09, 2014

[iOS] ibeacon 試玩

本文記錄一些ibeacon的筆記


beacon的種類

  • beacon的device
  • 讓電腦透過beacon USB變成一個beacon
  • iphone可透過iOS內的程式模擬成一個beacon裝置

支援的裝置

目前發現自已的iphone4 完全不能動
iphone 5 以上搭配iOS7都能工作正常

如何偵測ibeacons

必需於APP內指定裝置的UUID才能掃描此區域內的所有含此UUID裝置,
基本上跟廠商採買的beacons裝置都會有一致的UUID,只差在Major/Minor版號不同。
可以透過這UUID與這二個號碼識為一個Region識別的識別碼

http://stackoverflow.com/questions/18784285/search-for-all-ibeacons-and-not-just-with-specific-uuid



An iBeacon is a region, and has as defining property the UUID. Therefore, you can only search for the ones matching a UUID. After you find one or more with a specific UUID, you can figure out which is closest using the delegate callbacks, where the beacons are stored in an array ordered by distance.

***

iBeacons are higher-level constructs than regular BLE peripherals. From what can be determined from the Apple docs, beacons are tied to their service UUID. i.e., a family of beacons is a "region" and a you go into and out of a region based on the range and visibility of a beacon to YOU, not the other way around. Unfortunately Apple has used the term region, which most of us probably associate with MapKit, so this is adding to the general confusion

Here's the bad news: You can only scan for ProximityUUIDs that you know, there is no "wildcard" proximityUUID. Additionally, CLBeacons don't expose the much in the way of lower level CoreBluetooth guts so if you want to find all beacons that happen to be near you, you'll have to use CoreBluetooth, scan for peripherals, then look though the returned peripheries and query each one them to find beacons. Of course Apple has neither registered (with the Bluetooth SIG) or (yet) published the iBeacon characteristics so, you'll need a BT sniffer to reverse engineer what constitutes an iBeacon from any other BLE device.

Android是否相容

Android 4.3支援ibeacon

目前蠻多人用的ibeacon函式庫
http://developer.radiusnetworks.com/ibeacon/android/index.html

實作

  • Monitoring - this refers to a low-power region-monitoring, you get didEnterRegion: and didExitRegion: delegate messages
  • Ranging - this means a higher-power activity where you get the signal strength from individual iBeacons and can estimate distance to them from this

參考資料
http://joris.kluivers.nl/blog/2013/09/27/playing-with-ibeacon/
https://github.com/nicktoumpelis/HiBeacons
http://www.devfright.com/ibeacons-tutorial-ios-7-clbeaconregion-clbeacon/
http://www.appcoda.com/ios7-programming-ibeacons-tutorial/
http://developer.radiusnetworks.com/2013/11/13/ibeacon-monitoring-in-the-background-and-foreground.html
https://developer.apple.com/library/ios/documentation/userexperience/conceptual/LocationAwarenessPG/RegionMonitoring/RegionMonitoring.html#//apple_ref/doc/uid/TP40009497-CH9-SW1
http://www.cocoanetics.com/2013/11/can-you-smell-the-ibeacon/

星期五, 5月 30, 2014

[iOS] 使用Navigation Controller 切換ViewController

今天練習透過用Storyboard viewcontroller將畫面跳轉至xib viewcontroller。

主畫面storyboard的MultiViewViewController.h
//呼叫xib視窗
-(IBAction)twoXibClicked:(id)sender{

    //產生一個xib的ctrl instance
    
    TwoViewController *twoViewCtrl = [[TwoViewController alloc]
                                                  initWithNibName:@"TwoViewController"
                                                  bundle:nil];

    //透過navigationcontroller推到xib的controller
    [self.navigationController pushViewController:twoViewCtrl animated:YES];
    
    
//    [twoViewCtrl release];
}

使用xib的TwoViewController.m
- (IBAction)xibBackToMainClicked:(id)sender {
    
    //使用navigation退回主畫面
    [self.navigationController popToRootViewControllerAnimated:YES];
}

找到這篇討論Navigation多次跳轉的問題: navigationController pushViewController 多次跳转后怎么返回


返回根页面vc用:
[self.navigationController popToRootViewController]
返回指定的某个vc用下面(通过index定位)
[self.navigationController popToViewController:[self.navigationController.viewControllers objectAtIndex:2] animated:YES];
或(通过class定位):
for (UIViewController *controller in self.navigationController.viewControllers) {

    if ([controller isKindOfClass:[你要跳转到的Controller class]]) {

        [self.navigationController popToViewController:controller animated:YES];

    }

}

星期四, 5月 29, 2014

[iOS] 導覽列與Storyboard

經過第一個範例([iOS] 快快樂樂寫iOS hello world (storyboards))練習後,
接著要開始多個頁面的切換練習,這次要練習透過storyboard切換不同的ViewContoller。

版本

XCode 5 


開始實作


Step1: 新增第二個ViewController

在第一個ViewController放入一個按鈕(取Load from storyboard),
然後在Object Library拖進來第二個ViewController

星期三, 5月 28, 2014

[iOS] 快快樂樂寫iOS hello world (storyboards)

萬事起頭難XD克服第一個helloworld iOS程式。
這個範例是參考 http://ios-blog.co.uk/tutorials/ios-7-hello-world-tutorial/
不過有改了一些操作方法:D
另一篇則有簡單的Xcode IDE的介紹:http://codewithchris.com/hello-world-iphone-app/

版本

XCode 5 

題目

透過二個按鈕來操作count次數,並將count的結果顯示在label上


星期一, 1月 23, 2012

[Xcode] 打開storyboard



今天開始寫Xcode,不知怎麼按的,把ios5提供的Storyboard按不見了,只剩UI配置的XML顯示,害我找了一下子才找到XD,不習慣IDE真的很麻煩呀Orz

在storyboard的檔案點二指->Open As->Interface Builder iOS Storyboard

其他你感興趣的文章

Related Posts with Thumbnails