Nix and Mac OSX (High Sierra) FileVault

I was having problem when trying to enable FileVault, and found out later that because of Nix.  In order to enable it again, in terminal:

  1. List all uses from fdesetup with this command: sudo fdesetup list
  2. Remove user that starts with prefix nixbld from fdesetup: sudo fdesetup remove -user <nixbld_user>
  3. Enable FileVault: sudo fdesetup enable

If success, you should get prompt to enter your username (with admin permission) and password.  You can check encryption status with: sudo fdesetup status, and it should show you the current progress for turning on FileVault.

Not sure if need to add back nixbld user to fdesetup, but probably will find out later if there is problem.

Read More

iOS 9 NSURLConnectionSSL error

Today I was testing an app on iOS9 simulator, and got an Error when connecting to Parse.  After doing some research, I found that there is App Transport Security in iOS9.

For now, I am using couple services, so I have read the quick fix for the App now is to add NSAllowsArbitraryLoads into Info.plist.  Add this to your Info.plist for a quick fix, but you should read the document for a better security.

<key>NSAppTransportSecurity</key>

<dict>

<key>NSAllowsArbitraryLoads</key>

<true/>

</dict>

 

Read More

iOS Popover presentation Segue

popover

This is just a quick guide on how to create a pop over view controller over other view controller with Present As Popover Segue.  

In UI Storyboard, we will create two view controllers.   The first UIViewController we will add a UIButton to active other UIViewController as Pop over, and the other UIViewController will just contains a UILabel.  (I created a class for the pop over view controller as PopOverViewController, but UIViewController will be fine)

popover2

Also, the view controller that will be used as pop over, we will set it to freeform and select your own size in the size inspector.

popover5

 

In Attributes Inspector, also change the Size to Freeform, and no Status Bar.  Select Use Preferred Explicit Size and set the size.

popover6

 

 

Next, we will the connect the button to the pop over controller with popover presentation segue.

Give the segue an Identifier.  In this example, I used “popoverSegue“.

popover3popover4

 

Now, coding time.  In the parent viewcontroller(the one with UIButton), first add a

UIPopoverPresentationControllerDelegate protocol to the class.

then add this:

 

You should be familiar with the first function.  We want to set up the the pop over viewcontroller with style as UIModelPresentationPopover, and set the popoverPresentationController delegate to the parent controller, so that the parent controller will take care the popover viewcontroller presentation style.

Since we don’t want any other style but only pop over style when the segue performs, and the delegate function

adaptivePresentationStyleForPresentationController: 

will do this for us, and tell the APP that we only want the pop over style.

 

Reference: 

https://richardallen.me/2014/11/28/popovers.html

 

 

 

 

 

 

Read More

Open iMessage in the App (iOS8)

To open an iMessage window, you only need to create MFMessageComposeViewController instance.  It is very easy to use and present it like other UIViewController.

 

Your viewcontroller should conform to protocol MFMEssageComposeViewControllerDelegate to handle actions within the MFMMessageComposeViewController.

 

 

 

Read More