It's 100% opt-in. Yes, you can have all of your photos, notes, bookmarks, etc. synced to iCloud in which case Apple can see the data and provide it to 3rd parties either knowingly (law enforcement agencies) or unknowingly (the fappening). However, you can turn all of the syncing off and none of that data ever leaves your phone and it stays encrypted using your device passcode. Other than the lack of automatic syncing to other Apple devices, there's not really any loss in usability if you disable iCloud.